Commit a9dfe05a authored by norvell's avatar norvell
Browse files

Fixes added under FIX_I173_I174: Remove frame counter from ism_file_writer.c...

Fixes added under FIX_I173_I174: Remove frame counter from ism_file_writer.c and remove counter from ISm enc/dec structs
parent 131109d4
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;
}
+10 −1
Original line number Diff line number Diff line
@@ -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;
}
+14 −0
Original line number Diff line number Diff line
@@ -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, "," );