From a9dfe05ac6ff9c484c1c8948fb17f438f371fe71 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 7 Nov 2022 08:31:27 +0100 Subject: [PATCH] Fixes added under FIX_I173_I174: Remove frame counter from ism_file_writer.c and remove counter from ISm enc/dec structs --- lib_util/ism_file_reader.c | 6 ++++++ lib_util/ism_file_writer.c | 11 ++++++++++- .../renderer_standalone.c | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index c1f08a4c35..665c7ea134 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -43,7 +43,9 @@ struct IsmFileReader { FILE *file; +#ifndef FIX_I173_I174 int32_t frameCounter; +#endif char *file_path; }; @@ -75,7 +77,9 @@ IsmFileReader *IsmFileReader_open( self = calloc( sizeof( IsmFileReader ), 1 ); self->file = file; +#ifndef FIX_I173_I174 self->frameCounter = 0; +#endif self->file_path = calloc( sizeof( char ), strlen( filePath ) + 1 ); strcpy( self->file_path, filePath ); @@ -145,7 +149,9 @@ ivas_error IsmFileReader_readNextFrame( ismMetadata->spread = meta_prm[3]; ismMetadata->gainFactor = meta_prm[4]; +#ifndef FIX_I173_I174 ++self->frameCounter; +#endif return IVAS_ERR_OK; } diff --git a/lib_util/ism_file_writer.c b/lib_util/ism_file_writer.c index 64f04f7b02..65bd72a944 100644 --- a/lib_util/ism_file_writer.c +++ b/lib_util/ism_file_writer.c @@ -43,7 +43,9 @@ struct IsmFileWriter { FILE *file; +#ifndef FIX_I173_I174 int32_t frameCounter; +#endif char *file_path; }; @@ -86,7 +88,9 @@ ivas_error IsmFileWriter_open( self = calloc( sizeof( IsmFileWriter ), 1 ); self->file = file; +#ifndef FIX_I173_I174 self->frameCounter = 0; +#endif self->file_path = calloc( sizeof( char ), strlen( filePath ) + 1 ); strcpy( self->file_path, filePath ); @@ -118,7 +122,11 @@ ivas_error IsmFileWriter_writeFrame( file = ismWriter->file; /* IVAS_fmToDo: work in progress; currently position_azimuth, position_elevation, position_radius, spread, gain_factor */ +#ifdef FIX_I173_I174 + sprintf( char_buff, "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor ); +#else sprintf( char_buff, "%04d,%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f\n", ismWriter->frameCounter, ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor ); +#endif if ( file ) { @@ -128,8 +136,9 @@ ivas_error IsmFileWriter_writeFrame( { return IVAS_ERR_FAILED_FILE_WRITE; } - +#ifndef FIX_I173_I174 ++ismWriter->frameCounter; +#endif return IVAS_ERR_OK; } diff --git a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c index 8afcd73603..494b596b10 100644 --- a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c +++ b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c @@ -160,6 +160,9 @@ int main( int argc, char *argv[] ) { return IVAS_ERR_FAILED_ALLOC; } +#ifdef FIX_I173_I174 + st_ivas->hDecoderConfig->Opt_Headrotation = FALSE; +#endif /* ISm metadata handles */ for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) @@ -315,6 +318,9 @@ int main( int argc, char *argv[] ) fprintf( stderr, "Can not allocate memory for head-tracking\n" ); exit( -1 ); } +#ifdef FIX_I173_I174 + st_ivas->hDecoderConfig->Opt_Headrotation = TRUE; +#endif } /* Init limiter */ @@ -538,7 +544,9 @@ static void readMetadata( float meta_prm[NUM_ISM_METADATA_PER_LINE]; char *char_ptr; int16_t j; +#ifndef FIX_I173_I174 int32_t time_stamp; +#endif if ( fgets( char_buff, META_LINE_LENGTH, file ) == NULL ) { @@ -546,6 +554,11 @@ static void readMetadata( exit( -1 ); } +#ifdef FIX_I173_I174 + j = 0; + char_ptr = strtok( char_buff, "," ); + meta_prm[j++] = (float) atof( char_ptr ); +#else char_ptr = strtok( char_buff, "," ); time_stamp = (int32_t) atoi( char_ptr ); @@ -556,6 +569,7 @@ static void readMetadata( } j = 0; +#endif while ( char_ptr != NULL && j < NUM_ISM_METADATA_PER_LINE ) { char_ptr = strtok( NULL, "," ); -- GitLab