From 7b61675a64fd18c5071261bde259d10e6670d08a Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 1 May 2024 14:29:13 +0200 Subject: [PATCH 01/17] Support for output of main orientation, tracked rotation, and combined orientation vectors using command line --- Workspace_msvc/lib_util.vcxproj | 2 + apps/renderer.c | 134 +++++++++++++++++++++++++++++++ lib_com/options.h | 2 +- lib_rend/lib_rend.c | 6 ++ lib_util/rotation_file_writer.c | 136 ++++++++++++++++++++++++++++++++ lib_util/rotation_file_writer.h | 75 ++++++++++++++++++ 6 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 lib_util/rotation_file_writer.c create mode 100644 lib_util/rotation_file_writer.h diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index c887ffaa96..ca763a2c2b 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -108,6 +108,7 @@ + @@ -134,6 +135,7 @@ + diff --git a/apps/renderer.c b/apps/renderer.c index d6123d53ca..613ddfe9fc 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -45,6 +45,9 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#include "rotation_file_writer.h" +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #include "split_rend_bfi_file_reader.h" @@ -178,6 +181,11 @@ typedef struct int8_t orientation_tracking; int16_t nonDiegeticPan; float nonDiegeticPanGain; +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + char mainOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; + char trackedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; + char combinedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#endif IVAS_REND_COMPLEXITY_LEVEL complexityLevel; bool delayCompensationEnabled; bool quietModeEnabled; @@ -226,6 +234,11 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + CmdLnOptionId_mainOrientationOutputFile, + CmdLnOptionId_trackedRotationOutputFile, + CmdLnOptionId_combinedOrientationOutputFile, +#endif CmdLnOptionId_framing, CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, @@ -377,6 +390,26 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + { + .id = CmdLnOptionId_mainOrientationOutputFile, + .match = "main_orientation_output_file", + .matchShort = "moof", + .description = "Main orientation output file", + }, + { + .id = CmdLnOptionId_trackedRotationOutputFile, + .match = "tracked_rotation_output_file", + .matchShort = "trof", + .description = "Tracked rotation output file", + }, + { + .id = CmdLnOptionId_combinedOrientationOutputFile, + .match = "combined_orientation_output_file", + .matchShort = "coof", + .description = "Combined orientation output file", + }, +#endif { .id = CmdLnOptionId_framing, .match = "framing", @@ -687,6 +720,11 @@ int main( RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; RotFileReader *referenceRotReader = NULL; +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + RotFileWriter *mainOrientationFileWriter = NULL; + RotFileWriter *trackedRotationFileWriter = NULL; + RotFileWriter *combinedOrientationFileWriter = NULL; +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS]; IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS]; @@ -836,6 +874,37 @@ int main( } } +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + if ( !isEmptyString( args.mainOrientationOutputFilePath ) ) + { + convert_backslash( args.mainOrientationOutputFilePath ); + if ( RotationFileWriter_open( args.mainOrientationOutputFilePath, &mainOrientationFileWriter ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.mainOrientationOutputFilePath ); + exit( -1 ); + } + } + + if ( !isEmptyString( args.trackedOrientationOutputFilePath ) ) + { + convert_backslash( args.trackedOrientationOutputFilePath ); + if ( RotationFileWriter_open( args.trackedOrientationOutputFilePath, &trackedRotationFileWriter ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.trackedOrientationOutputFilePath ); + exit( -1 ); + } + } + + if ( !isEmptyString( args.combinedOrientationOutputFilePath ) ) + { + convert_backslash( args.combinedOrientationOutputFilePath ); + if ( RotationFileWriter_open( args.combinedOrientationOutputFilePath, &combinedOrientationFileWriter ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error opening file: %s\n", args.combinedOrientationOutputFilePath ); + exit( -1 ); + } + } +#endif if ( !isEmptyString( args.renderConfigFilePath ) ) { @@ -1659,6 +1728,65 @@ int main( } } +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + if ( mainOrientationFileWriter != NULL ) + { + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + IVAS_QUATERNION mainOrientation; + + if ( ( error = IVAS_REND_GetMainOrientation( hIvasRend, &mainOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error while getting main orientation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + if ( ( error = RotationFileWriter_write( mainOrientationFileWriter, &mainOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error while writing main orientation data: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } + + if ( trackedRotationFileWriter != NULL ) + { + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + IVAS_QUATERNION trackedRotation; + + if ( ( error = IVAS_REND_GetTrackedRotation( hIvasRend, &trackedRotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error while getting main orientation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + if ( ( error = RotationFileWriter_write( trackedRotationFileWriter, &trackedRotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error while writing main orientation data: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } + + if ( combinedOrientationFileWriter != NULL ) + { + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + IVAS_QUATERNION combinedOrientation; + + if ( ( error = IVAS_REND_GetCombinedOrientation( hIvasRend, &combinedOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error while getting main orientation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + if ( ( error = RotationFileWriter_write( combinedOrientationFileWriter, &combinedOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error while writing main orientation data: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } +#endif + /* Combine external orientations and head rotation */ if ( ( error = IVAS_REND_CombineHeadAndExternalOrientation( hIvasRend ) ) != IVAS_ERR_OK ) @@ -2062,9 +2190,15 @@ cleanup: MasaFileWriter_close( &masaWriter ); AudioFileReader_close( &audioReader ); AudioFileWriter_close( &audioWriter ); + RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + RotationFileWriter_close( &mainOrientationFileWriter ); + RotationFileWriter_close( &trackedRotationFileWriter ); + RotationFileWriter_close( &combinedOrientationFileWriter ); +#endif Vector3PairFileReader_close( &referenceVectorReader ); destroy_td_hrtf( hHrtfTD ); diff --git a/lib_com/options.h b/lib_com/options.h index 43cb02520e..3f82eccc8c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,7 @@ #define FIX_NUM_SUBFRAME_UPDATE #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ - +#define FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS /* Philips: issue 1066: orientation output functions support */ /* #################### End BE switches ################################## */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index a0d31fa8a6..da140ed2c0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4803,7 +4803,9 @@ ivas_error IVAS_REND_SetReferenceRotation( * * *-------------------------------------------------------------------*/ +#ifndef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS // ToDo: not used +#endif ivas_error IVAS_REND_GetMainOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ @@ -4830,7 +4832,9 @@ ivas_error IVAS_REND_GetMainOrientation( * * *-------------------------------------------------------------------*/ +#ifndef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS // ToDo: not used +#endif ivas_error IVAS_REND_GetTrackedRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ @@ -4938,7 +4942,9 @@ ivas_error IVAS_REND_CombineHeadAndExternalOrientation( * * *---------------------------------------------------------------------*/ +#ifndef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS // ToDo: not used +#endif ivas_error IVAS_REND_GetCombinedOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ diff --git a/lib_util/rotation_file_writer.c b/lib_util/rotation_file_writer.c new file mode 100644 index 0000000000..948387f6e4 --- /dev/null +++ b/lib_util/rotation_file_writer.c @@ -0,0 +1,136 @@ +/****************************************************************************************************** + + (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include "rotation_file_writer.h" +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + +#include +#include +#include +#include "prot.h" + + +struct RotFileWriter +{ + FILE *pFile; + char *filename; +}; + + +/*-----------------------------------------------------------------------* + * RotationFileWriter_open() + * + * Allocate and initialize rotation file writer + *-----------------------------------------------------------------------*/ + +ivas_error RotationFileWriter_open( + char *filename, /* i : output file name */ + RotFileWriter **pWriter /* o : RotFileWriter handle */ +) +{ + RotFileWriter *self; + FILE *pFile; + + /* Open trajectory file */ + if ( strlen( filename ) < 1 ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } + + pFile = fopen( filename, "wt" ); + + if ( !pFile ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } + + self = calloc( sizeof( RotFileWriter ), 1 ); + self->pFile = pFile; + self->filename = calloc( sizeof( char ), strlen( filename ) + 1 ); + strcpy( self->filename, filename ); + + *pWriter = self; + + return IVAS_ERR_OK; +} + + +/*-----------------------------------------------------------------------* + * RotationFileWriter_write() + * + * Reads values to the trajectory file + *-----------------------------------------------------------------------*/ + +ivas_error RotationFileWriter_write( + RotFileWriter *pWriter, + IVAS_QUATERNION *pPose ) +{ + int32_t bytes_written; + + if ( pWriter == NULL || pPose == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( bytes_written = fprintf( pWriter->pFile, "%f,%f,%f,%f\n", pPose->w, pPose->x, pPose->y, pPose->z ) ) <= 0 ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + + return IVAS_ERR_OK; +} + + +/*-----------------------------------------------------------------------* + * RotationFileWriter_close() + * + * Closes and deallocates the rotation file writer + *-----------------------------------------------------------------------*/ + +void RotationFileWriter_close( + RotFileWriter **pWriter /* i/o: RotFileWriter handle */ +) +{ + if ( pWriter == NULL || *pWriter == NULL ) + { + return; + } + + fclose( ( *pWriter )->pFile ); + free( ( *pWriter )->filename ); + free( *pWriter ); + *pWriter = NULL; + + return; +} + +#endif diff --git a/lib_util/rotation_file_writer.h b/lib_util/rotation_file_writer.h new file mode 100644 index 0000000000..e761bfbfb6 --- /dev/null +++ b/lib_util/rotation_file_writer.h @@ -0,0 +1,75 @@ +/****************************************************************************************************** + + (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef ROTATION_FILE_WRITER_H +#define ROTATION_FILE_WRITER_H + +#include "common_api_types.h" + +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + +typedef struct RotFileWriter RotFileWriter; + +/*-----------------------------------------------------------------------* + * RotationFileWriter_open() + * + * Allocate and initialize rotation file writer + *-----------------------------------------------------------------------*/ + +ivas_error RotationFileWriter_open( + char *filename, + RotFileWriter **pWriter ); + + +/*-----------------------------------------------------------------------* + * RotationFileWriter_write() + * + * Reads values to the trajectory file + *-----------------------------------------------------------------------*/ + +ivas_error RotationFileWriter_write( + RotFileWriter *pWriter, + IVAS_QUATERNION *rotation ); + + +/*-----------------------------------------------------------------------* + * RotationFileWriter_close() + * + * Closes and deallocates the rotation file writer + *-----------------------------------------------------------------------*/ + +void RotationFileWriter_close( + RotFileWriter **pWriter ); + + +#endif +#endif -- GitLab From 217f612562ef27fddb178ab214b702b0a8803cc4 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 1 May 2024 15:36:27 +0200 Subject: [PATCH 02/17] Support for output of main orientation, tracked rotation, and combined orientation vectors using command line --- apps/renderer.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/renderer.c b/apps/renderer.c index 613ddfe9fc..900776d84b 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2930,8 +2930,21 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; - case CmdLnOptionId_customHrtfFile: +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + case CmdLnOptionId_mainOrientationOutputFile: + assert( numOptionValues == 1 ); + strncpy( args->mainOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + break; + case CmdLnOptionId_trackedRotationOutputFile: assert( numOptionValues == 1 ); + strncmp( args->trackedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + break; + case CmdLnOptionId_combinedOrientationOutputFile: + assert( numOptionValues == 1 ); + strncmp( args->combinedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + break; +#endif + case CmdLnOptionId_customHrtfFile : assert( numOptionValues == 1 ); strncpy( args->customHrtfFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_renderConfigFile: -- GitLab From 7b85b968353c57ef0840f2acd238080ccb297c19 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 1 May 2024 15:39:56 +0200 Subject: [PATCH 03/17] Support for output of main orientation, tracked rotation, and combined orientation vectors using command line --- apps/renderer.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 900776d84b..6ac89200be 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -178,14 +178,14 @@ typedef struct char externalOrientationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; - int8_t orientation_tracking; - int16_t nonDiegeticPan; - float nonDiegeticPanGain; #ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS char mainOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char trackedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char combinedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; #endif + int8_t orientation_tracking; + int16_t nonDiegeticPan; + float nonDiegeticPanGain; IVAS_REND_COMPLEXITY_LEVEL complexityLevel; bool delayCompensationEnabled; bool quietModeEnabled; @@ -831,8 +831,13 @@ int main( convert_backslash( args.referenceRotationFilePath ); convert_backslash( args.inLfePanningMatrixFile ); convert_backslash( args.externalOrientationFilePath ); +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + convert_backslash( args.mainOrientationOutputFilePath ); + convert_backslash( args.trackedOrientationOutputFilePath ); + convert_backslash( args.combinedOrientationOutputFilePath ); +#endif - if ( !isEmptyString( args.headRotationFilePath ) ) + if ( !isEmptyString( args.headRotationFilePath ) ) { if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK ) { @@ -877,7 +882,6 @@ int main( #ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS if ( !isEmptyString( args.mainOrientationOutputFilePath ) ) { - convert_backslash( args.mainOrientationOutputFilePath ); if ( RotationFileWriter_open( args.mainOrientationOutputFilePath, &mainOrientationFileWriter ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", args.mainOrientationOutputFilePath ); @@ -887,7 +891,6 @@ int main( if ( !isEmptyString( args.trackedOrientationOutputFilePath ) ) { - convert_backslash( args.trackedOrientationOutputFilePath ); if ( RotationFileWriter_open( args.trackedOrientationOutputFilePath, &trackedRotationFileWriter ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", args.trackedOrientationOutputFilePath ); @@ -897,7 +900,6 @@ int main( if ( !isEmptyString( args.combinedOrientationOutputFilePath ) ) { - convert_backslash( args.combinedOrientationOutputFilePath ); if ( RotationFileWriter_open( args.combinedOrientationOutputFilePath, &combinedOrientationFileWriter ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", args.combinedOrientationOutputFilePath ); @@ -2814,6 +2816,12 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); +#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS + clearString( args.mainOrientationOutputFilePath ); + clearString( args.trackedOrientationOutputFilePath ); + clearString( args.combinedOrientationOutputFilePath ); +#endif + args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; @@ -2944,7 +2952,8 @@ static void parseOption( strncmp( args->combinedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; #endif - case CmdLnOptionId_customHrtfFile : assert( numOptionValues == 1 ); + case CmdLnOptionId_customHrtfFile: + assert( numOptionValues == 1 ); strncpy( args->customHrtfFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_renderConfigFile: -- GitLab From 7482084bb7f16f511a28fe48156a7fd92b181edc Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 1 May 2024 15:54:44 +0200 Subject: [PATCH 04/17] Support for output of main orientation, tracked rotation, and combined orientation vectors using command line --- apps/renderer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 6ac89200be..6bf59319aa 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2945,11 +2945,11 @@ static void parseOption( break; case CmdLnOptionId_trackedRotationOutputFile: assert( numOptionValues == 1 ); - strncmp( args->trackedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + strncpy( args->trackedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_combinedOrientationOutputFile: assert( numOptionValues == 1 ); - strncmp( args->combinedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + strncpy( args->combinedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; #endif case CmdLnOptionId_customHrtfFile: -- GitLab From ba14c725c0755fd6c89d5dc9cf60bf13ba423488 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Tue, 21 May 2024 17:26:48 +0200 Subject: [PATCH 05/17] Add switch --- lib_com/options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_com/options.h b/lib_com/options.h index 6c4363df17..973682ec80 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -190,6 +190,7 @@ #define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ +#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From 728f91d69c65f0ac47ee9cfac94cb193e4101f96 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Thu, 23 May 2024 09:40:20 +0200 Subject: [PATCH 06/17] Add functions --- lib_dec/lib_dec.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++ lib_dec/lib_dec.h | 20 ++++++++++++ 2 files changed, 100 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 9f59528a0c..fd1d647352 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2500,6 +2500,86 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_ #undef WMC_TOOL_SKIP } +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +/*-------------------------------------------------------------------* + * IVAS_DEC_GetMainOrientation() + * + * + *-------------------------------------------------------------------*/ +ivas_error IVAS_DEC_GetMainOrientation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ +) +{ + ivas_error error; + + if ( hIvasDec == NULL || pOrientation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( error = ivas_orient_trk_GetMainOrientation( hIvasDec->st_ivas->hHeadTrackData->OrientationTracker, pOrientation ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------* + * IVAS_DEC_GetTrackedRotation() + * + * + *-------------------------------------------------------------------*/ +ivas_error IVAS_DEC_GetTrackedRotation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ +) +{ + ivas_error error; + + if ( hIvasDec == NULL || pRotation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( error = ivas_orient_trk_GetTrackedRotation( hIvasDec->st_ivas->hHeadTrackData->OrientationTracker, pRotation ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + +/*---------------------------------------------------------------------* + * IVAS_DEC_GetCombinedOrientation() + * + * + *---------------------------------------------------------------------*/ +ivas_error IVAS_DEC_GetCombinedOrientation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ +) +{ + int16_t i; + + if ( hIvasDec == NULL || pOrientation == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( hIvasDec->st_ivas->hCombinedOrientationData != NULL ) + { + for ( i = 0; i < hIvasDec->st_ivas->hCombinedOrientationData->num_subframes; ++i ) + { + pOrientation[i] = hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i]; + } + } + + return IVAS_ERR_OK; +} +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_FeedFrame( ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index bafbf36dac..62a1c5a10a 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -482,6 +482,26 @@ ivas_error IVAS_DEC_GetPcmFrameSize( int32_t *pcmFrameSize /* o : total size of the PCM output frame. This takes into account the number of output channels */ ); +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +/*! r: error code */ +ivas_error IVAS_DEC_GetMainOrientation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ +); + +/*! r: error code */ +ivas_error IVAS_DEC_GetTrackedRotation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ +); + +/*! r: error code */ +ivas_error IVAS_DEC_GetCombinedOrientation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ +); +#endif + /*! r: true if decoder has no data in VoIP jitter buffer */ bool IVAS_DEC_VoIP_IsEmpty( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -- GitLab From fa7154d502e3788d4562c5df212670b3ff864a28 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Thu, 23 May 2024 22:04:14 +0200 Subject: [PATCH 07/17] Add quaternion file writer --- Workspace_msvc/lib_util.vcxproj | 2 + apps/decoder.c | 3 + lib_util/quaternion_file_writer.c | 160 ++++++++++++++++++++++++++++++ lib_util/quaternion_file_writer.h | 69 +++++++++++++ 4 files changed, 234 insertions(+) create mode 100644 lib_util/quaternion_file_writer.c create mode 100644 lib_util/quaternion_file_writer.h diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index c887ffaa96..cffdc19cf3 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -108,6 +108,7 @@ + @@ -134,6 +135,7 @@ + diff --git a/apps/decoder.c b/apps/decoder.c index 9d38acb1da..456eb92f0e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -43,6 +43,9 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#include "quaternion_file_writer.h" +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #endif diff --git a/lib_util/quaternion_file_writer.c b/lib_util/quaternion_file_writer.c new file mode 100644 index 0000000000..327e3061d6 --- /dev/null +++ b/lib_util/quaternion_file_writer.c @@ -0,0 +1,160 @@ +/****************************************************************************************************** + + (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include "quaternion_file_writer.h" +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#include +#include + + +#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ + + +struct QuaternionFileWriter +{ + FILE *file; + char *file_path; +}; + +/*---------------------------------------------------------------------* + * QuaternionFileWriter_open() + * + * Allocates memory for an QuaternionFileReader and opens the file at given path for writing. + *---------------------------------------------------------------------*/ + +/*! r: error code */ +ivas_error QuaternionFileWriter_open( + const char *filePath, /* i : path to output file */ + QuaternionFileWriter **quatWriter /* o : pointer to QuaternionFileWriter handle */ +) +{ + QuaternionFileWriter *self; + FILE *file; + + if ( strlen( filePath ) < 1 ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } + + file = fopen( filePath, "w" ); + + if ( !file ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } + + self = calloc( sizeof( QuaternionFileWriter ), 1 ); + self->file = file; + self->file_path = calloc( sizeof( char ), strlen( filePath ) + 1 ); + strcpy( self->file_path, filePath ); + + *quatWriter = self; + + return IVAS_ERR_OK; +} + +/*---------------------------------------------------------------------* + * QuaternionFileWriter_writeFrame() + * + * Writes quaternion data into a previously opened file + *---------------------------------------------------------------------*/ + +/*! r: error code */ +ivas_error QuaternionFileWriter_writeFrame( + QuaternionFileWriter *quatWriter, /* o : QuaternionFileWriter handle */ + const IVAS_QUATERNION quatData /* i : Quaternion data */ +) +{ + FILE *file; + + if ( quatWriter->file == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + file = quatWriter->file; + + if ( file ) + { + fprintf( file, "%f,%f,%f,%f\n", quatData.w, quatData.x, quatData.y, quatData.z ); + } + else + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + + return IVAS_ERR_OK; +} + + +/*---------------------------------------------------------------------* + * QuaternionFileWriter_close() + * + * De-allocates all underlying memory of an QuaternionFileWriter. + *---------------------------------------------------------------------*/ + +void QuaternionFileWriter_close( + QuaternionFileWriter **quatWriter /* i/o: pointer to QuaternionFileWriter handle */ +) +{ + if ( quatWriter == NULL || *quatWriter == NULL ) + { + return; + } + + fclose( ( *quatWriter )->file ); + free( ( *quatWriter )->file_path ); + free( *quatWriter ); + *quatWriter = NULL; + + return; +} + + +/*---------------------------------------------------------------------* + * IsmFileWriter_getFilePath() + * + *---------------------------------------------------------------------*/ + +/*! r: path to the currently opened file or NULL if `ismWriter` is NULL */ +const char *QuaternionFileWriter_getFilePath( + QuaternionFileWriter *quatWriter /* i : QuaternionFileWriter handle */ +) +{ + if ( quatWriter == NULL ) + { + return NULL; + } + + return quatWriter->file_path; +} +#endif diff --git a/lib_util/quaternion_file_writer.h b/lib_util/quaternion_file_writer.h new file mode 100644 index 0000000000..fd860a696f --- /dev/null +++ b/lib_util/quaternion_file_writer.h @@ -0,0 +1,69 @@ +/****************************************************************************************************** + + (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_QUATERNION_WRITER_H +#define IVAS_QUATERNION_WRITER_H + +#include "common_api_types.h" + +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + +typedef struct QuaternionFileWriter QuaternionFileWriter; + +/* clang-format off */ + +/*! r: error code */ +ivas_error QuaternionFileWriter_open( + const char *filePath, /* i : path to output file */ + QuaternionFileWriter **quatWriter /* o : pointer to QuaternionFileWriter handle */ +); + +/*! r: error code */ +ivas_error QuaternionFileWriter_writeFrame( + QuaternionFileWriter *quatWriter, /* o : QuaternionFileWriter handle */ + const IVAS_QUATERNION quatData /* i : Quaternion data */ +); + +void QuaternionFileWriter_close( + QuaternionFileWriter **quatWriter /* i/o: pointer to QuaternionFileWriter handle */ +); + +/*! r: path to the currently opened file or NULL if `ismWriter` is NULL */ +const char *QuaternionFileWriter_getFilePath( + QuaternionFileWriter *quatWriter /* i : QuaternionFileWriter handle */ +); + +/* clang-format on */ + +#endif + +#endif /* IVAS_QUATERNION_WRITER_H */ -- GitLab From cb8d4469b44fbff010b062b3f3de1aa5c5e31908 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Fri, 24 May 2024 16:35:59 +0200 Subject: [PATCH 08/17] Extract data according to command line params --- apps/decoder.c | 232 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index 456eb92f0e..b977265790 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -116,6 +116,14 @@ typedef struct bool voipMode; bool enableHeadRotation; char *headrotTrajFileName; +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + bool mainOrientationWriterEnabled; + char *mainOrientationFilename; + bool trackedRotationWriterEnabled; + char *trackedRotationFilename; + bool combinedOrientationWriterEnabled; + char *combinedOrientationFilename; +#endif bool enableReferenceRotation; char *refrotTrajFileName; bool enableReferenceVectorTracking; @@ -172,12 +180,21 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#else +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#endif +static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); +#else #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #else static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); +#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); @@ -211,6 +228,11 @@ int main( RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; RotFileReader *refRotReader = NULL; +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + QuaternionFileWriter *mainOrientWriter = NULL; + QuaternionFileWriter *trackRotWriter = NULL; + QuaternionFileWriter *combOrientWriter = NULL; +#endif Vector3PairFileReader *referenceVectorReader = NULL; RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; @@ -346,6 +368,47 @@ int main( } } +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + /*------------------------------------------------------------------------------------------* + * Open main orientation file + *------------------------------------------------------------------------------------------*/ + + if ( arg.mainOrientationWriterEnabled ) + { + if ( ( error = QuaternionFileWriter_open( arg.mainOrientationFilename, &mainOrientWriter ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open main orientation file %s \n\n", arg.mainOrientationFilename ); + goto cleanup; + } + } + + /*------------------------------------------------------------------------------------------* + * Open tracked rotation file + *------------------------------------------------------------------------------------------*/ + + if ( arg.trackedRotationWriterEnabled ) + { + if ( ( error = QuaternionFileWriter_open( arg.trackedRotationFilename, &trackRotWriter ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open tracked rotation file %s \n\n", arg.trackedRotationFilename ); + goto cleanup; + } + } + + /*------------------------------------------------------------------------------------------* + * Open combined orientation file + *------------------------------------------------------------------------------------------*/ + + if ( arg.combinedOrientationWriterEnabled ) + { + if ( ( error = QuaternionFileWriter_open( arg.combinedOrientationFilename, &combOrientWriter ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open combined orientation file %s \n\n", arg.combinedOrientationFilename ); + goto cleanup; + } + } +#endif + /*------------------------------------------------------------------------------------------* * Open reference rotation file *------------------------------------------------------------------------------------------*/ @@ -882,14 +945,26 @@ int main( if ( arg.voipMode ) { +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, hIvasDec ); +#else error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); +#endif } else { +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef SPLIT_REND_WITH_HEAD_ROT + error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); +#else + error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, hIvasDec, pcmBuf ); +#endif +#else #ifdef SPLIT_REND_WITH_HEAD_ROT error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #else error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf ); +#endif #endif } @@ -960,6 +1035,11 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &refRotReader ); +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + QuaternionFileWriter_close( &mainOrientWriter ); + QuaternionFileWriter_close( &trackRotWriter ); + QuaternionFileWriter_close( &combOrientWriter ); +#endif Vector3PairFileReader_close( &referenceVectorReader ); RenderConfigReader_close( &renderConfigReader ); @@ -1111,6 +1191,14 @@ static bool parseCmdlIVAS_dec( arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + arg->mainOrientationWriterEnabled = false; + arg->mainOrientationFilename = NULL; + arg->trackedRotationWriterEnabled = false; + arg->trackedRotationFilename = NULL; + arg->combinedOrientationWriterEnabled = false; + arg->combinedOrientationFilename = NULL; +#endif arg->orientation_tracking = ORIENT_TRK_NONE; arg->enableReferenceRotation = false; arg->headrotTrajFileName = NULL; @@ -1345,6 +1433,53 @@ static bool parseCmdlIVAS_dec( arg->headrotTrajFileName = argv[i]; i++; } +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + else if ( strcmp( argv_to_upper, "-MORI" ) == 0 ) + { + arg->mainOrientationWriterEnabled = true; + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Main orientation file name not specified!\n\n" ); + usage_dec(); + return false; + } + + arg->mainOrientationFilename = argv[i]; + i++; + } + else if ( strcmp( argv_to_upper, "-TROT" ) == 0 ) + { + arg->trackedRotationWriterEnabled = true; + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Tracked rotation file name not specified!\n\n" ); + usage_dec(); + return false; + } + + arg->trackedRotationFilename = argv[i]; + i++; + } + else if ( strcmp( argv_to_upper, "-CORI" ) == 0 ) + { + arg->combinedOrientationWriterEnabled = true; + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Combined orientation file name not specified!\n\n" ); + usage_dec(); + return false; + } + + arg->combinedOrientationFilename = argv[i]; + i++; + } +#endif else if ( strcmp( argv_to_upper, "-FR" ) == 0 ) { int32_t tmp; @@ -1848,6 +1983,9 @@ static void usage_dec( void ) fprintf( stdout, " default bitstream file format is G.192\n" ); fprintf( stdout, "-hrtf File : HRTF filter File used in BINAURAL output configuration\n" ); fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); + fprintf( stdout, "-mori File : Main orientation data output file\n" ); + fprintf( stdout, "-trot File : Tracked rotation data output file\n" ); + fprintf( stdout, "-cori File : Combined orientation data output file\n" ); fprintf( stdout, "-otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' \n" ); fprintf( stdout, " or 'ref_vec_lev' (only for binaural rendering)\n" ); fprintf( stdout, "-rf File : Reference rotation specified by external trajectory File\n" ); @@ -2265,6 +2403,11 @@ static ivas_error decodeG192( RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + QuaternionFileWriter *mainOrientWriter, + QuaternionFileWriter *trackRotWriter, + QuaternionFileWriter *combOrientWriter, +#endif Vector3PairFileReader *referenceVectorReader, #ifdef SPLIT_REND_WITH_HEAD_ROT ISAR_SPLIT_REND_BITS_DATA *splitRendBits, @@ -2507,6 +2650,24 @@ static ivas_error decodeG192( goto cleanup; } } + +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + if ( arg.mainOrientationWriterEnabled ) + { + IVAS_QUATERNION orientation; + IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ); + + QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ); + } + + if ( arg.trackedRotationWriterEnabled ) + { + IVAS_QUATERNION rotation; + IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ); + + QuaternionFileWriter_writeFrame( trackRotWriter, rotation ); + } +#endif } if ( arg.enableExternalOrientation ) @@ -2535,6 +2696,16 @@ static ivas_error decodeG192( } } +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) + { + IVAS_QUATERNION orientation; + IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ); + + QuaternionFileWriter_writeFrame( combOrientWriter, orientation ); + } +#endif + /* decode and get samples */ nSamplesRendered = 0; nSamplesToRender = nOutSamples; @@ -2867,7 +3038,35 @@ static ivas_error decodeG192( fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } + +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + if ( arg.mainOrientationWriterEnabled ) + { + IVAS_QUATERNION orientation; + IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ); + + QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ); + } + + if ( arg.trackedRotationWriterEnabled ) + { + IVAS_QUATERNION rotation; + IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ); + + QuaternionFileWriter_writeFrame( trackRotWriter, rotation ); + } +#endif + } + +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) + { + IVAS_QUATERNION orientation; + IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ); + + QuaternionFileWriter_writeFrame( combOrientWriter, orientation ); } +#endif /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -3160,6 +3359,11 @@ static ivas_error decodeVoIP( RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + QuaternionFileWriter *mainOrientWriter, + QuaternionFileWriter *trackRotWriter, + QuaternionFileWriter *combOrientWriter, +#endif Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ) { @@ -3413,6 +3617,24 @@ static ivas_error decodeVoIP( goto cleanup; } } + +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + if ( arg.mainOrientationWriterEnabled ) + { + IVAS_QUATERNION orientation; + IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ); + + QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ); + } + + if ( arg.trackedRotationWriterEnabled ) + { + IVAS_QUATERNION rotation; + IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ); + + QuaternionFileWriter_writeFrame( trackRotWriter, rotation ); + } +#endif } if ( arg.enableExternalOrientation ) @@ -3443,6 +3665,16 @@ static ivas_error decodeVoIP( } } +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) + { + IVAS_QUATERNION orientation; + IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ); + + QuaternionFileWriter_writeFrame( combOrientWriter, orientation ); + } +#endif + /* read all packets with a receive time smaller than the system time */ while ( nextPacketRcvTime_ms <= systemTime_ms ) { -- GitLab From e4babd317ad64f4dd90f4ca0a22a0e2c1bd5af9e Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 27 May 2024 11:08:28 +0200 Subject: [PATCH 09/17] Update in comments --- lib_com/options.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 973682ec80..772949bf26 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -190,7 +190,8 @@ #define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ -#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application +#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From 0a5b6429934effa046fd2b00c0a591ccafb26e7a Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 27 May 2024 13:18:06 +0200 Subject: [PATCH 10/17] Fix comment error --- lib_com/options.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 772949bf26..130b85160d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -190,8 +190,7 @@ #define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ -#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application - +#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From 3aa79bb83da6f454fec5e2107879494fe5a151e3 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Tue, 28 May 2024 15:30:53 +0200 Subject: [PATCH 11/17] Review comments --- apps/decoder.c | 155 ++++++++++++++++++++++++------ lib_com/options.h | 3 +- lib_dec/lib_dec.c | 12 +-- lib_util/quaternion_file_writer.c | 6 +- 4 files changed, 137 insertions(+), 39 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index b977265790..8e80524139 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -377,7 +377,7 @@ int main( { if ( ( error = QuaternionFileWriter_open( arg.mainOrientationFilename, &mainOrientWriter ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError: Can't open main orientation file %s \n\n", arg.mainOrientationFilename ); + fprintf( stderr, "\nError: Can't open main orientation output file %s \n\n", arg.mainOrientationFilename ); goto cleanup; } } @@ -390,7 +390,7 @@ int main( { if ( ( error = QuaternionFileWriter_open( arg.trackedRotationFilename, &trackRotWriter ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError: Can't open tracked rotation file %s \n\n", arg.trackedRotationFilename ); + fprintf( stderr, "\nError: Can't open tracked rotation output file %s \n\n", arg.trackedRotationFilename ); goto cleanup; } } @@ -403,7 +403,7 @@ int main( { if ( ( error = QuaternionFileWriter_open( arg.combinedOrientationFilename, &combOrientWriter ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError: Can't open combined orientation file %s \n\n", arg.combinedOrientationFilename ); + fprintf( stderr, "\nError: Can't open combined orientation output file %s \n\n", arg.combinedOrientationFilename ); goto cleanup; } } @@ -1441,7 +1441,7 @@ static bool parseCmdlIVAS_dec( if ( argc - i <= 4 || argv[i][0] == '-' ) { - fprintf( stderr, "Error: Main orientation file name not specified!\n\n" ); + fprintf( stderr, "Error: Main orientation output file name not specified!\n\n" ); usage_dec(); return false; } @@ -1456,7 +1456,7 @@ static bool parseCmdlIVAS_dec( if ( argc - i <= 4 || argv[i][0] == '-' ) { - fprintf( stderr, "Error: Tracked rotation file name not specified!\n\n" ); + fprintf( stderr, "Error: Tracked rotation output file name not specified!\n\n" ); usage_dec(); return false; } @@ -1471,7 +1471,7 @@ static bool parseCmdlIVAS_dec( if ( argc - i <= 4 || argv[i][0] == '-' ) { - fprintf( stderr, "Error: Combined orientation file name not specified!\n\n" ); + fprintf( stderr, "Error: Combined orientation output file name not specified!\n\n" ); usage_dec(); return false; } @@ -1983,9 +1983,11 @@ static void usage_dec( void ) fprintf( stdout, " default bitstream file format is G.192\n" ); fprintf( stdout, "-hrtf File : HRTF filter File used in BINAURAL output configuration\n" ); fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); - fprintf( stdout, "-mori File : Main orientation data output file\n" ); - fprintf( stdout, "-trot File : Tracked rotation data output file\n" ); - fprintf( stdout, "-cori File : Combined orientation data output file\n" ); +#ifdef NONBE_FIX_1100_OUTPUT_ORIENT + fprintf( stdout, "-mori File : Main orientation data output File\n" ); + fprintf( stdout, "-trot File : Tracked rotation data output File\n" ); + fprintf( stdout, "-cori File : Combined orientation data output File\n" ); +#endif fprintf( stdout, "-otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' \n" ); fprintf( stdout, " or 'ref_vec_lev' (only for binaural rendering)\n" ); fprintf( stdout, "-rf File : Reference rotation specified by external trajectory File\n" ); @@ -2655,17 +2657,39 @@ static ivas_error decodeG192( if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; - IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ); - QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ); + if ( ( error = IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetMainOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } if ( arg.trackedRotationWriterEnabled ) { IVAS_QUATERNION rotation; - IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ); - QuaternionFileWriter_writeFrame( trackRotWriter, rotation ); + if ( ( error = IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetTrackedRotation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( trackRotWriter, rotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } #endif } @@ -2700,9 +2724,20 @@ static ivas_error decodeG192( if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; - IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ); - QuaternionFileWriter_writeFrame( combOrientWriter, orientation ); + if ( ( error = IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetCombinedOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( combOrientWriter, orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } #endif @@ -3043,17 +3078,39 @@ static ivas_error decodeG192( if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; - IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ); - QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ); + if ( ( error = IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetMainOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } if ( arg.trackedRotationWriterEnabled ) { IVAS_QUATERNION rotation; - IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ); - QuaternionFileWriter_writeFrame( trackRotWriter, rotation ); + if ( ( error = IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetTrackedRotation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( trackRotWriter, rotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } #endif } @@ -3062,9 +3119,20 @@ static ivas_error decodeG192( if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; - IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ); - QuaternionFileWriter_writeFrame( combOrientWriter, orientation ); + if ( ( error = IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetCombinedOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( combOrientWriter, orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } #endif @@ -3622,17 +3690,39 @@ static ivas_error decodeVoIP( if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; - IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ); - QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ); + if ( ( error = IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetMainOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } if ( arg.trackedRotationWriterEnabled ) { IVAS_QUATERNION rotation; - IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ); - QuaternionFileWriter_writeFrame( trackRotWriter, rotation ); + if ( ( error = IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetTrackedRotation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( trackRotWriter, rotation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } #endif } @@ -3669,9 +3759,20 @@ static ivas_error decodeVoIP( if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; - IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ); - QuaternionFileWriter_writeFrame( combOrientWriter, orientation ); + if ( ( error = IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_GetCombinedOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + else + { + if ( ( error = QuaternionFileWriter_writeFrame( combOrientWriter, orientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } } #endif diff --git a/lib_com/options.h b/lib_com/options.h index 130b85160d..afcd3a005e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,6 +175,7 @@ #define FIX_989_TD_REND_ROM /* Eri: Clean-up for TD renderer and completion of ROM generation tool */ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ +#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ /* #################### End BE switches ################################## */ @@ -190,7 +191,7 @@ #define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ -#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index fd1d647352..ccec6e8947 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2504,10 +2504,10 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_ /*-------------------------------------------------------------------* * IVAS_DEC_GetMainOrientation() * - * + * Get main orientation *-------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetMainOrientation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ ) { @@ -2530,10 +2530,10 @@ ivas_error IVAS_DEC_GetMainOrientation( /*-------------------------------------------------------------------* * IVAS_DEC_GetTrackedRotation() * - * + * Get tracked rotation *-------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetTrackedRotation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ ) { @@ -2555,10 +2555,10 @@ ivas_error IVAS_DEC_GetTrackedRotation( /*---------------------------------------------------------------------* * IVAS_DEC_GetCombinedOrientation() * - * + * Get combined orientation *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetCombinedOrientation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ ) { diff --git a/lib_util/quaternion_file_writer.c b/lib_util/quaternion_file_writer.c index 327e3061d6..20e8516449 100644 --- a/lib_util/quaternion_file_writer.c +++ b/lib_util/quaternion_file_writer.c @@ -103,11 +103,7 @@ ivas_error QuaternionFileWriter_writeFrame( file = quatWriter->file; - if ( file ) - { - fprintf( file, "%f,%f,%f,%f\n", quatData.w, quatData.x, quatData.y, quatData.z ); - } - else + if ( fprintf( file, "%f,%f,%f,%f\n", quatData.w, quatData.x, quatData.y, quatData.z ) <= 0 ) { return IVAS_ERR_FAILED_FILE_WRITE; } -- GitLab From ebb248084607074a4fcd5ea8e309ea697b4c2640 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Tue, 28 May 2024 15:41:44 +0200 Subject: [PATCH 12/17] Update readme.txt --- readme.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index e7e5d432f5..bdb1d43f79 100644 --- a/readme.txt +++ b/readme.txt @@ -271,9 +271,12 @@ Options: Format files, the magic word in the mime file is used to determine which of the two supported formats is in use. default bitstream file format is G.192 --fr L : render frame size in ms L=(5,10,20), default is 20 +-fr L : render frame size in ms L=(5,10,20), default is 20 -hrtf File : HRTF filter File used in BINAURAL rendering -T File : Head rotation specified by external trajectory File +-mori File : Main orientation data output File +-trot File : Tracked rotation data output File +-cori File : Combined orientation data output File -otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' or 'ref_vec_lev' (only for binaural rendering) -rf File : Reference rotation specified by external trajectory File -- GitLab From a049ffd9da65c6d698eec2758516437e312cab93 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 28 May 2024 16:11:16 +0200 Subject: [PATCH 13/17] improve comments --- apps/decoder.c | 6 +++--- lib_dec/lib_dec.c | 18 ++++++++++++------ lib_dec/lib_dec.h | 12 ++++++------ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 8e80524139..cef5cad6f7 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -370,7 +370,7 @@ int main( #ifdef NONBE_FIX_1100_OUTPUT_ORIENT /*------------------------------------------------------------------------------------------* - * Open main orientation file + * Open main orientation output file for writing *------------------------------------------------------------------------------------------*/ if ( arg.mainOrientationWriterEnabled ) @@ -383,7 +383,7 @@ int main( } /*------------------------------------------------------------------------------------------* - * Open tracked rotation file + * Open tracked rotation output file for writing *------------------------------------------------------------------------------------------*/ if ( arg.trackedRotationWriterEnabled ) @@ -396,7 +396,7 @@ int main( } /*------------------------------------------------------------------------------------------* - * Open combined orientation file + * Open combined orientation output file for writing *------------------------------------------------------------------------------------------*/ if ( arg.combinedOrientationWriterEnabled ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index ccec6e8947..d39e46bf62 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2500,15 +2500,17 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_ #undef WMC_TOOL_SKIP } + #ifdef NONBE_FIX_1100_OUTPUT_ORIENT /*-------------------------------------------------------------------* * IVAS_DEC_GetMainOrientation() * * Get main orientation *-------------------------------------------------------------------*/ + ivas_error IVAS_DEC_GetMainOrientation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* o : Quaternion pointer for main orientation */ ) { ivas_error error; @@ -2532,9 +2534,10 @@ ivas_error IVAS_DEC_GetMainOrientation( * * Get tracked rotation *-------------------------------------------------------------------*/ + ivas_error IVAS_DEC_GetTrackedRotation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + IVAS_QUATERNION *pRotation /* o : Quaternion pointer processed rotation */ ) { ivas_error error; @@ -2552,14 +2555,16 @@ ivas_error IVAS_DEC_GetTrackedRotation( return IVAS_ERR_OK; } + /*---------------------------------------------------------------------* * IVAS_DEC_GetCombinedOrientation() * * Get combined orientation *---------------------------------------------------------------------*/ + ivas_error IVAS_DEC_GetCombinedOrientation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* o: Quaternion pointer processed orientation */ ) { int16_t i; @@ -2581,6 +2586,7 @@ ivas_error IVAS_DEC_GetCombinedOrientation( } #endif + /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_FeedFrame( ) * diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 62a1c5a10a..33406e46cc 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -485,20 +485,20 @@ ivas_error IVAS_DEC_GetPcmFrameSize( #ifdef NONBE_FIX_1100_OUTPUT_ORIENT /*! r: error code */ ivas_error IVAS_DEC_GetMainOrientation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* o : Quaternion pointer for main orientation */ ); /*! r: error code */ ivas_error IVAS_DEC_GetTrackedRotation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + IVAS_QUATERNION *pRotation /* o : Quaternion pointer processed rotation */ ); /*! r: error code */ ivas_error IVAS_DEC_GetCombinedOrientation( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ + IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ + IVAS_QUATERNION *pOrientation /* o : Quaternion pointer processed orientation */ ); #endif -- GitLab From 458de603680df9891c636f5bc96ffe7b0d0cdc8d Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Thu, 30 May 2024 15:15:34 +0200 Subject: [PATCH 14/17] Combine decoder and renderer work --- Workspace_msvc/lib_util.vcxproj | 2 - apps/decoder.c | 50 +++++------ apps/renderer.c | 62 +++++++------- lib_com/options.h | 3 +- lib_dec/lib_dec.c | 2 +- lib_dec/lib_dec.h | 2 +- lib_rend/lib_rend.c | 6 +- lib_util/quaternion_file_writer.c | 2 +- lib_util/quaternion_file_writer.h | 2 +- lib_util/rotation_file_writer.c | 136 ------------------------------ lib_util/rotation_file_writer.h | 75 ---------------- readme.txt | 9 +- 12 files changed, 70 insertions(+), 281 deletions(-) delete mode 100644 lib_util/rotation_file_writer.c delete mode 100644 lib_util/rotation_file_writer.h diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 9c01363dbe..d5cc5da17b 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -110,7 +110,6 @@ - @@ -139,7 +138,6 @@ - diff --git a/apps/decoder.c b/apps/decoder.c index 5914404a9f..11bf1d152e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -46,7 +46,7 @@ #ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" #endif -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT #include "quaternion_file_writer.h" #endif #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -119,7 +119,7 @@ typedef struct bool voipMode; bool enableHeadRotation; char *headrotTrajFileName; -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT bool mainOrientationWriterEnabled; char *mainOrientationFilename; bool trackedRotationWriterEnabled; @@ -183,7 +183,7 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #else @@ -231,7 +231,7 @@ int main( RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; RotFileReader *refRotReader = NULL; -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT QuaternionFileWriter *mainOrientWriter = NULL; QuaternionFileWriter *trackRotWriter = NULL; QuaternionFileWriter *combOrientWriter = NULL; @@ -371,7 +371,7 @@ int main( } } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT /*------------------------------------------------------------------------------------------* * Open main orientation output file for writing *------------------------------------------------------------------------------------------*/ @@ -948,7 +948,7 @@ int main( if ( arg.voipMode ) { -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, hIvasDec ); #else error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); @@ -956,7 +956,7 @@ int main( } else { -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT #ifdef SPLIT_REND_WITH_HEAD_ROT error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #else @@ -1038,7 +1038,7 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &refRotReader ); -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT QuaternionFileWriter_close( &mainOrientWriter ); QuaternionFileWriter_close( &trackRotWriter ); QuaternionFileWriter_close( &combOrientWriter ); @@ -1194,7 +1194,7 @@ static bool parseCmdlIVAS_dec( arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT arg->mainOrientationWriterEnabled = false; arg->mainOrientationFilename = NULL; arg->trackedRotationWriterEnabled = false; @@ -1436,8 +1436,8 @@ static bool parseCmdlIVAS_dec( arg->headrotTrajFileName = argv[i]; i++; } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT - else if ( strcmp( argv_to_upper, "-MORI" ) == 0 ) +#ifdef FIX_1100_OUTPUT_ORIENT + else if ( strcmp( argv_to_upper, "-MOOF" ) == 0 ) { arg->mainOrientationWriterEnabled = true; i++; @@ -1452,7 +1452,7 @@ static bool parseCmdlIVAS_dec( arg->mainOrientationFilename = argv[i]; i++; } - else if ( strcmp( argv_to_upper, "-TROT" ) == 0 ) + else if ( strcmp( argv_to_upper, "-TROF" ) == 0 ) { arg->trackedRotationWriterEnabled = true; i++; @@ -1467,7 +1467,7 @@ static bool parseCmdlIVAS_dec( arg->trackedRotationFilename = argv[i]; i++; } - else if ( strcmp( argv_to_upper, "-CORI" ) == 0 ) + else if ( strcmp( argv_to_upper, "-COOF" ) == 0 ) { arg->combinedOrientationWriterEnabled = true; i++; @@ -1946,10 +1946,10 @@ static void usage_dec( void ) fprintf( stdout, " default bitstream file format is G.192\n" ); fprintf( stdout, "-hrtf File : HRTF filter File used in BINAURAL output configuration\n" ); fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT - fprintf( stdout, "-mori File : Main orientation data output File\n" ); - fprintf( stdout, "-trot File : Tracked rotation data output File\n" ); - fprintf( stdout, "-cori File : Combined orientation data output File\n" ); +#ifdef FIX_1100_OUTPUT_ORIENT + fprintf( stdout, "-moof File : Main orientation data output File\n" ); + fprintf( stdout, "-trof File : Tracked rotation data output File\n" ); + fprintf( stdout, "-coof File : Combined orientation data output File\n" ); #endif fprintf( stdout, "-otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' \n" ); fprintf( stdout, " or 'ref_vec_lev' (only for binaural rendering)\n" ); @@ -2366,7 +2366,7 @@ static ivas_error decodeG192( RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, @@ -2614,7 +2614,7 @@ static ivas_error decodeG192( } } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; @@ -2681,7 +2681,7 @@ static ivas_error decodeG192( } } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; @@ -3035,7 +3035,7 @@ static ivas_error decodeG192( goto cleanup; } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; @@ -3076,7 +3076,7 @@ static ivas_error decodeG192( #endif } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; @@ -3388,7 +3388,7 @@ static ivas_error decodeVoIP( RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, @@ -3647,7 +3647,7 @@ static ivas_error decodeVoIP( } } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; @@ -3716,7 +3716,7 @@ static ivas_error decodeVoIP( } } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; diff --git a/apps/renderer.c b/apps/renderer.c index 6e42c2a49f..162d737a36 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -45,8 +45,8 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS -#include "rotation_file_writer.h" +#ifdef FIX_1100_OUTPUT_ORIENT +#include "quaternion_file_writer.h" #endif #ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" @@ -181,7 +181,7 @@ typedef struct char externalOrientationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT char mainOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char trackedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char combinedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; @@ -237,7 +237,7 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT CmdLnOptionId_mainOrientationOutputFile, CmdLnOptionId_trackedRotationOutputFile, CmdLnOptionId_combinedOrientationOutputFile, @@ -393,24 +393,24 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT { .id = CmdLnOptionId_mainOrientationOutputFile, .match = "main_orientation_output_file", .matchShort = "moof", - .description = "Main orientation output file", + .description = "Main orientation data output File", }, { .id = CmdLnOptionId_trackedRotationOutputFile, .match = "tracked_rotation_output_file", .matchShort = "trof", - .description = "Tracked rotation output file", + .description = "Tracked rotation data output File", }, { .id = CmdLnOptionId_combinedOrientationOutputFile, .match = "combined_orientation_output_file", .matchShort = "coof", - .description = "Combined orientation output file", + .description = "Combined orientation data output File", }, #endif { @@ -723,10 +723,10 @@ int main( RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; RotFileReader *referenceRotReader = NULL; -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS - RotFileWriter *mainOrientationFileWriter = NULL; - RotFileWriter *trackedRotationFileWriter = NULL; - RotFileWriter *combinedOrientationFileWriter = NULL; +#ifdef FIX_1100_OUTPUT_ORIENT + QuaternionFileWriter *mainOrientationFileWriter = NULL; + QuaternionFileWriter *trackedRotationFileWriter = NULL; + QuaternionFileWriter *combinedOrientationFileWriter = NULL; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS]; @@ -841,13 +841,13 @@ int main( convert_backslash( args.referenceRotationFilePath ); convert_backslash( args.inLfePanningMatrixFile ); convert_backslash( args.externalOrientationFilePath ); -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT convert_backslash( args.mainOrientationOutputFilePath ); convert_backslash( args.trackedOrientationOutputFilePath ); convert_backslash( args.combinedOrientationOutputFilePath ); #endif - if ( !isEmptyString( args.headRotationFilePath ) ) + if ( !isEmptyString( args.headRotationFilePath ) ) { if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK ) { @@ -889,10 +889,10 @@ int main( } } -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT if ( !isEmptyString( args.mainOrientationOutputFilePath ) ) { - if ( RotationFileWriter_open( args.mainOrientationOutputFilePath, &mainOrientationFileWriter ) != IVAS_ERR_OK ) + if ( QuaternionFileWriter_open( args.mainOrientationOutputFilePath, &mainOrientationFileWriter ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", args.mainOrientationOutputFilePath ); exit( -1 ); @@ -901,7 +901,7 @@ int main( if ( !isEmptyString( args.trackedOrientationOutputFilePath ) ) { - if ( RotationFileWriter_open( args.trackedOrientationOutputFilePath, &trackedRotationFileWriter ) != IVAS_ERR_OK ) + if ( QuaternionFileWriter_open( args.trackedOrientationOutputFilePath, &trackedRotationFileWriter ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", args.trackedOrientationOutputFilePath ); exit( -1 ); @@ -910,7 +910,7 @@ int main( if ( !isEmptyString( args.combinedOrientationOutputFilePath ) ) { - if ( RotationFileWriter_open( args.combinedOrientationOutputFilePath, &combinedOrientationFileWriter ) != IVAS_ERR_OK ) + if ( QuaternionFileWriter_open( args.combinedOrientationOutputFilePath, &combinedOrientationFileWriter ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening file: %s\n", args.combinedOrientationOutputFilePath ); exit( -1 ); @@ -1794,8 +1794,8 @@ int main( } } -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS - if ( mainOrientationFileWriter != NULL ) +#ifdef FIX_1100_OUTPUT_ORIENT + if ( mainOrientationFileWriter != NULL && headRotReader != NULL ) { for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { @@ -1806,7 +1806,7 @@ int main( fprintf( stderr, "Error while getting main orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - if ( ( error = RotationFileWriter_write( mainOrientationFileWriter, &mainOrientation ) ) != IVAS_ERR_OK ) + if ( ( error = QuaternionFileWriter_writeFrame( mainOrientationFileWriter, mainOrientation ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while writing main orientation data: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1814,7 +1814,7 @@ int main( } } - if ( trackedRotationFileWriter != NULL ) + if ( trackedRotationFileWriter != NULL && headRotReader != NULL ) { for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { @@ -1825,7 +1825,7 @@ int main( fprintf( stderr, "Error while getting main orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - if ( ( error = RotationFileWriter_write( trackedRotationFileWriter, &trackedRotation ) ) != IVAS_ERR_OK ) + if ( ( error = QuaternionFileWriter_writeFrame( trackedRotationFileWriter, trackedRotation ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while writing main orientation data: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1833,7 +1833,7 @@ int main( } } - if ( combinedOrientationFileWriter != NULL ) + if ( combinedOrientationFileWriter != NULL && ( headRotReader != NULL || externalOrientationFileReader != NULL ) ) { for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { @@ -1844,7 +1844,7 @@ int main( fprintf( stderr, "Error while getting main orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - if ( ( error = RotationFileWriter_write( combinedOrientationFileWriter, &combinedOrientation ) ) != IVAS_ERR_OK ) + if ( ( error = QuaternionFileWriter_writeFrame( combinedOrientationFileWriter, combinedOrientation ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while writing main orientation data: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -2260,10 +2260,10 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS - RotationFileWriter_close( &mainOrientationFileWriter ); - RotationFileWriter_close( &trackedRotationFileWriter ); - RotationFileWriter_close( &combinedOrientationFileWriter ); +#ifdef FIX_1100_OUTPUT_ORIENT + QuaternionFileWriter_close( &mainOrientationFileWriter ); + QuaternionFileWriter_close( &trackedRotationFileWriter ); + QuaternionFileWriter_close( &combinedOrientationFileWriter ); #endif Vector3PairFileReader_close( &referenceVectorReader ); @@ -2838,7 +2838,7 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT clearString( args.mainOrientationOutputFilePath ); clearString( args.trackedOrientationOutputFilePath ); clearString( args.combinedOrientationOutputFilePath ); @@ -2960,7 +2960,7 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifdef FIX_1100_OUTPUT_ORIENT case CmdLnOptionId_mainOrientationOutputFile: assert( numOptionValues == 1 ); strncpy( args->mainOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); diff --git a/lib_com/options.h b/lib_com/options.h index ce2cf6607d..7b3b1f39a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -176,8 +176,7 @@ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define FIX_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ -#define NONBE_FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ -#define FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS /* Philips: issue 1066: orientation output functions support */ +#define FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d39e46bf62..a4ab661fa0 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2501,7 +2501,7 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_ } -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT /*-------------------------------------------------------------------* * IVAS_DEC_GetMainOrientation() * diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 33406e46cc..6d77ef0073 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -482,7 +482,7 @@ ivas_error IVAS_DEC_GetPcmFrameSize( int32_t *pcmFrameSize /* o : total size of the PCM output frame. This takes into account the number of output channels */ ); -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT /*! r: error code */ ivas_error IVAS_DEC_GetMainOrientation( IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index fe5e1e6e0c..cd5a713bbb 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4818,7 +4818,7 @@ ivas_error IVAS_REND_SetReferenceRotation( * * *-------------------------------------------------------------------*/ -#ifndef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifndef FIX_1100_OUTPUT_ORIENT // ToDo: not used #endif ivas_error IVAS_REND_GetMainOrientation( @@ -4847,7 +4847,7 @@ ivas_error IVAS_REND_GetMainOrientation( * * *-------------------------------------------------------------------*/ -#ifndef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifndef FIX_1100_OUTPUT_ORIENT // ToDo: not used #endif ivas_error IVAS_REND_GetTrackedRotation( @@ -4957,7 +4957,7 @@ ivas_error IVAS_REND_CombineHeadAndExternalOrientation( * * *---------------------------------------------------------------------*/ -#ifndef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS +#ifndef FIX_1100_OUTPUT_ORIENT // ToDo: not used #endif ivas_error IVAS_REND_GetCombinedOrientation( diff --git a/lib_util/quaternion_file_writer.c b/lib_util/quaternion_file_writer.c index 20e8516449..f7d72db12e 100644 --- a/lib_util/quaternion_file_writer.c +++ b/lib_util/quaternion_file_writer.c @@ -31,7 +31,7 @@ *******************************************************************************************************/ #include "quaternion_file_writer.h" -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT #include #include diff --git a/lib_util/quaternion_file_writer.h b/lib_util/quaternion_file_writer.h index fd860a696f..b2f1383ec5 100644 --- a/lib_util/quaternion_file_writer.h +++ b/lib_util/quaternion_file_writer.h @@ -35,7 +35,7 @@ #include "common_api_types.h" -#ifdef NONBE_FIX_1100_OUTPUT_ORIENT +#ifdef FIX_1100_OUTPUT_ORIENT typedef struct QuaternionFileWriter QuaternionFileWriter; diff --git a/lib_util/rotation_file_writer.c b/lib_util/rotation_file_writer.c deleted file mode 100644 index 948387f6e4..0000000000 --- a/lib_util/rotation_file_writer.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include "rotation_file_writer.h" -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS - -#include -#include -#include -#include "prot.h" - - -struct RotFileWriter -{ - FILE *pFile; - char *filename; -}; - - -/*-----------------------------------------------------------------------* - * RotationFileWriter_open() - * - * Allocate and initialize rotation file writer - *-----------------------------------------------------------------------*/ - -ivas_error RotationFileWriter_open( - char *filename, /* i : output file name */ - RotFileWriter **pWriter /* o : RotFileWriter handle */ -) -{ - RotFileWriter *self; - FILE *pFile; - - /* Open trajectory file */ - if ( strlen( filename ) < 1 ) - { - return IVAS_ERR_FAILED_FILE_OPEN; - } - - pFile = fopen( filename, "wt" ); - - if ( !pFile ) - { - return IVAS_ERR_FAILED_FILE_OPEN; - } - - self = calloc( sizeof( RotFileWriter ), 1 ); - self->pFile = pFile; - self->filename = calloc( sizeof( char ), strlen( filename ) + 1 ); - strcpy( self->filename, filename ); - - *pWriter = self; - - return IVAS_ERR_OK; -} - - -/*-----------------------------------------------------------------------* - * RotationFileWriter_write() - * - * Reads values to the trajectory file - *-----------------------------------------------------------------------*/ - -ivas_error RotationFileWriter_write( - RotFileWriter *pWriter, - IVAS_QUATERNION *pPose ) -{ - int32_t bytes_written; - - if ( pWriter == NULL || pPose == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - if ( ( bytes_written = fprintf( pWriter->pFile, "%f,%f,%f,%f\n", pPose->w, pPose->x, pPose->y, pPose->z ) ) <= 0 ) - { - return IVAS_ERR_FAILED_FILE_WRITE; - } - - return IVAS_ERR_OK; -} - - -/*-----------------------------------------------------------------------* - * RotationFileWriter_close() - * - * Closes and deallocates the rotation file writer - *-----------------------------------------------------------------------*/ - -void RotationFileWriter_close( - RotFileWriter **pWriter /* i/o: RotFileWriter handle */ -) -{ - if ( pWriter == NULL || *pWriter == NULL ) - { - return; - } - - fclose( ( *pWriter )->pFile ); - free( ( *pWriter )->filename ); - free( *pWriter ); - *pWriter = NULL; - - return; -} - -#endif diff --git a/lib_util/rotation_file_writer.h b/lib_util/rotation_file_writer.h deleted file mode 100644 index e761bfbfb6..0000000000 --- a/lib_util/rotation_file_writer.h +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#ifndef ROTATION_FILE_WRITER_H -#define ROTATION_FILE_WRITER_H - -#include "common_api_types.h" - -#ifdef FIX_1066_ORIENTATION_OUTPUT_FUNCTIONS - -typedef struct RotFileWriter RotFileWriter; - -/*-----------------------------------------------------------------------* - * RotationFileWriter_open() - * - * Allocate and initialize rotation file writer - *-----------------------------------------------------------------------*/ - -ivas_error RotationFileWriter_open( - char *filename, - RotFileWriter **pWriter ); - - -/*-----------------------------------------------------------------------* - * RotationFileWriter_write() - * - * Reads values to the trajectory file - *-----------------------------------------------------------------------*/ - -ivas_error RotationFileWriter_write( - RotFileWriter *pWriter, - IVAS_QUATERNION *rotation ); - - -/*-----------------------------------------------------------------------* - * RotationFileWriter_close() - * - * Closes and deallocates the rotation file writer - *-----------------------------------------------------------------------*/ - -void RotationFileWriter_close( - RotFileWriter **pWriter ); - - -#endif -#endif diff --git a/readme.txt b/readme.txt index 41f1c4c5f6..9b2be6e46c 100644 --- a/readme.txt +++ b/readme.txt @@ -274,9 +274,9 @@ Options: -fr L : render frame size in ms L=(5,10,20), default is 20 -hrtf File : HRTF filter File used in BINAURAL rendering -T File : Head rotation specified by external trajectory File --mori File : Main orientation data output File --trot File : Tracked rotation data output File --cori File : Combined orientation data output File +-moof File : Main orientation data output File +-trof File : Tracked rotation data output File +-coof File : Combined orientation data output File -otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' or 'ref_vec_lev' (only for binaural rendering) -rf File : Reference rotation specified by external trajectory File @@ -315,6 +315,9 @@ Options: -fr L : render frame size in ms L=(5,10,20), default is 20 -hrtf File : Custom HRTF File for binaural rendering (only for binaural outputs) -T File : Head rotation trajectory File for simulation of head tracking (only for binaural outputs) +-moof File : Main orientation data output File +-trof File : Tracked rotation data output File +-coof File : Combined orientation data output File -otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for binaural outputs) -rf File : Reference rotation trajectory File for simulation of head tracking (only for binaural outputs) -rvf File : Reference vector trajectory File for simulation of head tracking (only for binaural outputs) -- GitLab From d19f133b6a686f601ad177d6cd12bfa7a6021ea3 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Thu, 30 May 2024 15:46:18 +0200 Subject: [PATCH 15/17] Add DEBUGGING switch --- apps/decoder.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++ apps/renderer.c | 22 ++++++++++++++++++++ lib_com/options.h | 2 +- readme.txt | 6 ------ 4 files changed, 76 insertions(+), 7 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 11bf1d152e..702e85766a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -47,8 +47,10 @@ #include "aeid_file_reader.h" #endif #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING #include "quaternion_file_writer.h" #endif +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #endif @@ -120,12 +122,14 @@ typedef struct bool enableHeadRotation; char *headrotTrajFileName; #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING bool mainOrientationWriterEnabled; char *mainOrientationFilename; bool trackedRotationWriterEnabled; char *trackedRotationFilename; bool combinedOrientationWriterEnabled; char *combinedOrientationFilename; +#endif #endif bool enableReferenceRotation; char *refrotTrajFileName; @@ -184,6 +188,7 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #else @@ -198,6 +203,14 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF #endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #endif +#else +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#else +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#endif +static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); +#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); @@ -232,9 +245,11 @@ int main( RotFileReader *externalOrientationFileReader = NULL; RotFileReader *refRotReader = NULL; #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING QuaternionFileWriter *mainOrientWriter = NULL; QuaternionFileWriter *trackRotWriter = NULL; QuaternionFileWriter *combOrientWriter = NULL; +#endif #endif Vector3PairFileReader *referenceVectorReader = NULL; RenderConfigReader *renderConfigReader = NULL; @@ -372,6 +387,7 @@ int main( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING /*------------------------------------------------------------------------------------------* * Open main orientation output file for writing *------------------------------------------------------------------------------------------*/ @@ -410,6 +426,7 @@ int main( goto cleanup; } } +#endif #endif /*------------------------------------------------------------------------------------------* @@ -949,7 +966,11 @@ int main( if ( arg.voipMode ) { #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, hIvasDec ); +#else + error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); +#endif #else error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); #endif @@ -957,6 +978,7 @@ int main( else { #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING #ifdef SPLIT_REND_WITH_HEAD_ROT error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, mainOrientWriter, trackRotWriter, combOrientWriter, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #else @@ -968,6 +990,13 @@ int main( #else error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf ); #endif +#endif +#else +#ifdef SPLIT_REND_WITH_HEAD_ROT + error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); +#else + error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf ); +#endif #endif } @@ -1039,9 +1068,11 @@ cleanup: RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &refRotReader ); #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING QuaternionFileWriter_close( &mainOrientWriter ); QuaternionFileWriter_close( &trackRotWriter ); QuaternionFileWriter_close( &combOrientWriter ); +#endif #endif Vector3PairFileReader_close( &referenceVectorReader ); RenderConfigReader_close( &renderConfigReader ); @@ -1195,12 +1226,14 @@ static bool parseCmdlIVAS_dec( arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING arg->mainOrientationWriterEnabled = false; arg->mainOrientationFilename = NULL; arg->trackedRotationWriterEnabled = false; arg->trackedRotationFilename = NULL; arg->combinedOrientationWriterEnabled = false; arg->combinedOrientationFilename = NULL; +#endif #endif arg->orientation_tracking = ORIENT_TRK_NONE; arg->enableReferenceRotation = false; @@ -1437,6 +1470,7 @@ static bool parseCmdlIVAS_dec( i++; } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-MOOF" ) == 0 ) { arg->mainOrientationWriterEnabled = true; @@ -1482,6 +1516,7 @@ static bool parseCmdlIVAS_dec( arg->combinedOrientationFilename = argv[i]; i++; } +#endif #endif else if ( strcmp( argv_to_upper, "-FR" ) == 0 ) { @@ -1947,9 +1982,11 @@ static void usage_dec( void ) fprintf( stdout, "-hrtf File : HRTF filter File used in BINAURAL output configuration\n" ); fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING fprintf( stdout, "-moof File : Main orientation data output File\n" ); fprintf( stdout, "-trof File : Tracked rotation data output File\n" ); fprintf( stdout, "-coof File : Combined orientation data output File\n" ); +#endif #endif fprintf( stdout, "-otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' \n" ); fprintf( stdout, " or 'ref_vec_lev' (only for binaural rendering)\n" ); @@ -2367,9 +2404,11 @@ static ivas_error decodeG192( RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, +#endif #endif Vector3PairFileReader *referenceVectorReader, #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2615,6 +2654,7 @@ static ivas_error decodeG192( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; @@ -2652,6 +2692,7 @@ static ivas_error decodeG192( } } } +#endif #endif } @@ -2682,6 +2723,7 @@ static ivas_error decodeG192( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; @@ -2700,6 +2742,7 @@ static ivas_error decodeG192( } } } +#endif #endif /* decode and get samples */ @@ -3036,6 +3079,7 @@ static ivas_error decodeG192( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; @@ -3073,10 +3117,12 @@ static ivas_error decodeG192( } } } +#endif #endif } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; @@ -3095,6 +3141,7 @@ static ivas_error decodeG192( } } } +#endif #endif /* decode and get samples */ @@ -3389,9 +3436,11 @@ static ivas_error decodeVoIP( RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, +#endif #endif Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ) @@ -3648,6 +3697,7 @@ static ivas_error decodeVoIP( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( arg.mainOrientationWriterEnabled ) { IVAS_QUATERNION orientation; @@ -3685,6 +3735,7 @@ static ivas_error decodeVoIP( } } } +#endif #endif } @@ -3717,6 +3768,7 @@ static ivas_error decodeVoIP( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) ) { IVAS_QUATERNION orientation; @@ -3735,6 +3787,7 @@ static ivas_error decodeVoIP( } } } +#endif #endif /* read all packets with a receive time smaller than the system time */ diff --git a/apps/renderer.c b/apps/renderer.c index 162d737a36..19b0d8a480 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -46,8 +46,10 @@ #include "render_config_reader.h" #include "rotation_file_reader.h" #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING #include "quaternion_file_writer.h" #endif +#endif #ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" #endif @@ -182,9 +184,11 @@ typedef struct char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING char mainOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char trackedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char combinedOrientationOutputFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#endif #endif int8_t orientation_tracking; int16_t nonDiegeticPan; @@ -238,9 +242,11 @@ typedef enum CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING CmdLnOptionId_mainOrientationOutputFile, CmdLnOptionId_trackedRotationOutputFile, CmdLnOptionId_combinedOrientationOutputFile, +#endif #endif CmdLnOptionId_framing, CmdLnOptionId_syncMdDelay, @@ -394,6 +400,7 @@ static const CmdLnParser_Option cliOptions[] = { .description = "External orientation trajectory file for simulation of external orientations", }, #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING { .id = CmdLnOptionId_mainOrientationOutputFile, .match = "main_orientation_output_file", @@ -412,6 +419,7 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "coof", .description = "Combined orientation data output File", }, +#endif #endif { .id = CmdLnOptionId_framing, @@ -724,10 +732,12 @@ int main( RotFileReader *externalOrientationFileReader = NULL; RotFileReader *referenceRotReader = NULL; #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING QuaternionFileWriter *mainOrientationFileWriter = NULL; QuaternionFileWriter *trackedRotationFileWriter = NULL; QuaternionFileWriter *combinedOrientationFileWriter = NULL; #endif +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS]; IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS]; @@ -842,9 +852,11 @@ int main( convert_backslash( args.inLfePanningMatrixFile ); convert_backslash( args.externalOrientationFilePath ); #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING convert_backslash( args.mainOrientationOutputFilePath ); convert_backslash( args.trackedOrientationOutputFilePath ); convert_backslash( args.combinedOrientationOutputFilePath ); +#endif #endif if ( !isEmptyString( args.headRotationFilePath ) ) @@ -890,6 +902,7 @@ int main( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( !isEmptyString( args.mainOrientationOutputFilePath ) ) { if ( QuaternionFileWriter_open( args.mainOrientationOutputFilePath, &mainOrientationFileWriter ) != IVAS_ERR_OK ) @@ -916,6 +929,7 @@ int main( exit( -1 ); } } +#endif #endif if ( !isEmptyString( args.renderConfigFilePath ) ) @@ -1795,6 +1809,7 @@ int main( } #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING if ( mainOrientationFileWriter != NULL && headRotReader != NULL ) { for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) @@ -1851,6 +1866,7 @@ int main( } } } +#endif #endif /* Combine external orientations and head rotation */ @@ -2261,9 +2277,11 @@ cleanup: RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING QuaternionFileWriter_close( &mainOrientationFileWriter ); QuaternionFileWriter_close( &trackedRotationFileWriter ); QuaternionFileWriter_close( &combinedOrientationFileWriter ); +#endif #endif Vector3PairFileReader_close( &referenceVectorReader ); @@ -2839,9 +2857,11 @@ static CmdlnArgs defaultArgs( clearString( args.externalOrientationFilePath ); #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING clearString( args.mainOrientationOutputFilePath ); clearString( args.trackedOrientationOutputFilePath ); clearString( args.combinedOrientationOutputFilePath ); +#endif #endif args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; @@ -2961,6 +2981,7 @@ static void parseOption( strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; #ifdef FIX_1100_OUTPUT_ORIENT +#ifdef DEBUGGING case CmdLnOptionId_mainOrientationOutputFile: assert( numOptionValues == 1 ); strncpy( args->mainOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -2973,6 +2994,7 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->combinedOrientationOutputFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; +#endif #endif case CmdLnOptionId_customHrtfFile: assert( numOptionValues == 1 ); diff --git a/lib_com/options.h b/lib_com/options.h index 7b3b1f39a1..142ec29ef3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -176,7 +176,7 @@ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define FIX_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ -#define FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ +#define FIX_1100_OUTPUT_ORIENT /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */ /* #################### End BE switches ################################## */ diff --git a/readme.txt b/readme.txt index 9b2be6e46c..ce95e63fce 100644 --- a/readme.txt +++ b/readme.txt @@ -274,9 +274,6 @@ Options: -fr L : render frame size in ms L=(5,10,20), default is 20 -hrtf File : HRTF filter File used in BINAURAL rendering -T File : Head rotation specified by external trajectory File --moof File : Main orientation data output File --trof File : Tracked rotation data output File --coof File : Combined orientation data output File -otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' or 'ref_vec_lev' (only for binaural rendering) -rf File : Reference rotation specified by external trajectory File @@ -315,9 +312,6 @@ Options: -fr L : render frame size in ms L=(5,10,20), default is 20 -hrtf File : Custom HRTF File for binaural rendering (only for binaural outputs) -T File : Head rotation trajectory File for simulation of head tracking (only for binaural outputs) --moof File : Main orientation data output File --trof File : Tracked rotation data output File --coof File : Combined orientation data output File -otr tracking_type : Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for binaural outputs) -rf File : Reference rotation trajectory File for simulation of head tracking (only for binaural outputs) -rvf File : Reference vector trajectory File for simulation of head tracking (only for binaural outputs) -- GitLab From e5ca97bdf9521192c1c584e3ee237de2c4e5c70b Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 10 Jun 2024 22:28:57 +0200 Subject: [PATCH 16/17] Remove SPLIT_REND_WITH_HEAD_ROT --- apps/decoder.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 9f8fe82c5c..94a1d3997b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -178,21 +178,13 @@ static void usage_dec( void ); #ifdef FIX_1100_OUTPUT_ORIENT #ifdef DEBUGGING static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#else -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, QuaternionFileWriter *mainOrientWriter, QuaternionFileWriter *trackRotWriter, QuaternionFileWriter *combOrientWriter, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #else -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #endif #else -#ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#else -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -#endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #endif -- GitLab From 382c5b974e74097680debcb491435e6cb8fde1d2 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 10 Jun 2024 22:36:54 +0200 Subject: [PATCH 17/17] Fix clang error --- apps/decoder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 94a1d3997b..20424dd248 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -917,7 +917,6 @@ int main( #else error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #endif - } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) -- GitLab