diff --git a/scripts/ivas_conformance/masa-diff-tool/README.md b/scripts/ivas_conformance/masa-diff-tool/README.md index abb9d9f04672c46ef6aec34c636da731e7d1da48..fd633941f78ef287c284ef80437405a8518baa2c 100644 --- a/scripts/ivas_conformance/masa-diff-tool/README.md +++ b/scripts/ivas_conformance/masa-diff-tool/README.md @@ -1,6 +1,6 @@ # MASA-diff-tool -Version: 0.2.2 +Version: 0.3.0 ## Usage @@ -20,8 +20,8 @@ compared metadata files are identical. The summary contains: - Status for descriptive metadata difference - Overall status for spatial metadata difference - Across all frames max ABS and mean difference values for spatial metadata - - Overall max ABS diff in spatial direction (degrees) - - Overall mean ABS diff in spatial direction (degrees) + - Overall max ABS diff in spatial direction (scaled to range 0...1 from 0°...180°) + - Overall mean ABS diff in spatial direction (scaled to range 0...1 from 0°...180°) - Overall max ABS diff in direct-to-total ratio - Overall mean ABS diff in direct-to-total ratio - Overall max ABS diff in diffuse-to-total ratio @@ -47,8 +47,8 @@ When option `--csv` is given, then a frame-by-frame results is constructed in co - Frame index - Diff in descriptive metadata - Diff in number of directions -- Max ABS diff: Direction (degrees spatial angle) -- Mean ABS diff: Direction (degrees spatial angle) +- Max ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle) +- Mean ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle) - Max ABS diff: Direct-to-total ratio - Mean ABS diff: Direct-to-total ratio - Max ABS diff: Diffuse-to-total ratio diff --git a/scripts/ivas_conformance/masa-diff-tool/masaDiffTool.c b/scripts/ivas_conformance/masa-diff-tool/masaDiffTool.c index 22d97a4b34efca26c5a0e3e38eb3dd6da44879cb..7d4217f87245a017dc71404dc07c1606230619b0 100644 --- a/scripts/ivas_conformance/masa-diff-tool/masaDiffTool.c +++ b/scripts/ivas_conformance/masa-diff-tool/masaDiffTool.c @@ -137,50 +137,50 @@ int main( int argc, char *argv[] ) for ( int n = 0; n < argc - 2; ++n ) { - if (strcmp(argv[n], "-h") == 0 || strcmp(argv[n], "--help") == 0) + if ( strcmp( argv[n], "-h" ) == 0 || strcmp( argv[n], "--help" ) == 0 ) { printUsage(); exit( EXIT_FAILURE ); // Will report non-zero so scripts do not succeed accidentally } - if (strcmp(argv[n], "--report") == 0) + if ( strcmp( argv[n], "--report" ) == 0 ) { - state.reportFilePtr = fopen( argv[n+1], "wt" ); + state.reportFilePtr = fopen( argv[n + 1], "wt" ); if ( state.reportFilePtr == NULL ) { fprintf( stderr, "Failed to open output report file for writing\n" ); - fprintf( stderr, "Path was: %s\n", argv[n+1] ); + fprintf( stderr, "Path was: %s\n", argv[n + 1] ); exit( EXIT_FAILURE ); } } - if (strcmp(argv[n], "--csv") == 0) + if ( strcmp( argv[n], "--csv" ) == 0 ) { - state.csvFilePtr = fopen( argv[n+1], "wt" ); + state.csvFilePtr = fopen( argv[n + 1], "wt" ); if ( state.csvFilePtr == NULL ) { fprintf( stderr, "Failed to open output CSV file for writing\n" ); - fprintf( stderr, "Path was: %s\n", argv[n+1] ); + fprintf( stderr, "Path was: %s\n", argv[n + 1] ); exit( EXIT_FAILURE ); } } } - state.refReader = MasaFileReader_open( argv[argc-2] ); + state.refReader = MasaFileReader_open( argv[argc - 2] ); if ( state.refReader == NULL ) { fprintf( stderr, "Failed to open ref file for reading\n" ); exit( EXIT_FAILURE ); } - state.cutReader = MasaFileReader_open( argv[argc-1] ); + state.cutReader = MasaFileReader_open( argv[argc - 1] ); if ( state.cutReader == NULL ) { fprintf( stderr, "Failed to open cut file for reading\n" ); exit( EXIT_FAILURE ); } - if (state.csvFilePtr != NULL) + if ( state.csvFilePtr != NULL ) { writeCsvHeader( state.csvFilePtr ); } @@ -231,7 +231,7 @@ int main( int argc, char *argv[] ) break; } - if (state.reportFilePtr != NULL) + if ( state.reportFilePtr != NULL ) { fprintf( state.reportFilePtr, "Frame %ld\n-----------\n", state.frame ); } @@ -245,7 +245,7 @@ int main( int argc, char *argv[] ) if ( isDiff_frame_descriptiveMeta && refMetadata->descriptive_meta.numberOfDirections != cutMetadata->descriptive_meta.numberOfDirections ) { isDiff_frame_spatialMeta = 1; - if (state.reportFilePtr != NULL) + if ( state.reportFilePtr != NULL ) { fprintf( state.reportFilePtr, "Difference in spatial metadata, number of directions differ\n" ); } @@ -278,12 +278,12 @@ int main( int argc, char *argv[] ) if ( !isDiff_frame_overall ) { - if (state.reportFilePtr != NULL) + if ( state.reportFilePtr != NULL ) { fprintf( state.reportFilePtr, "Metadata is identical\n" ); } } - if (state.reportFilePtr != NULL) + if ( state.reportFilePtr != NULL ) { fprintf( state.reportFilePtr, "\n" ); } @@ -327,7 +327,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) { if ( refMeta->descriptive_meta.formatDescriptor[n] != cutMeta->descriptive_meta.formatDescriptor[n] ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in format descriptor: " ); for ( int k = 0; k < 8; k++ ) @@ -348,7 +348,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) if ( refMeta->descriptive_meta.numberOfDirections != cutMeta->descriptive_meta.numberOfDirections ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in number of directions: %u != %u", refMeta->descriptive_meta.numberOfDirections, cutMeta->descriptive_meta.numberOfDirections ); } @@ -357,7 +357,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) if ( refMeta->descriptive_meta.sourceFormat != cutMeta->descriptive_meta.sourceFormat ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in source format: %u != %u", refMeta->descriptive_meta.sourceFormat, cutMeta->descriptive_meta.sourceFormat ); } @@ -366,7 +366,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) if ( refMeta->descriptive_meta.transportDefinition != cutMeta->descriptive_meta.transportDefinition ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in transport definition: %u != %u", refMeta->descriptive_meta.transportDefinition, cutMeta->descriptive_meta.transportDefinition ); } @@ -375,7 +375,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) if ( refMeta->descriptive_meta.channelAngle != cutMeta->descriptive_meta.channelAngle ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in channel angle: %u != %u", refMeta->descriptive_meta.channelAngle, cutMeta->descriptive_meta.channelAngle ); } @@ -384,7 +384,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) if ( refMeta->descriptive_meta.channelDistance != cutMeta->descriptive_meta.channelDistance ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in channel distance: %u != %u", refMeta->descriptive_meta.channelDistance, cutMeta->descriptive_meta.channelDistance ); } @@ -393,7 +393,7 @@ static int compareMasaFrameDescriptiveMeta( const MasaDiffToolState *state ) if ( refMeta->descriptive_meta.channelLayout != cutMeta->descriptive_meta.channelLayout ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in channel layout: %u != %u", refMeta->descriptive_meta.channelLayout, cutMeta->descriptive_meta.channelLayout ); } @@ -515,11 +515,11 @@ static int compareMasaFrameSpatialMeta( MasaDiffToolState *state, const int isDi if ( isDiff ) { - if (state->reportFilePtr != NULL) + if ( state->reportFilePtr != NULL ) { fprintf( state->reportFilePtr, "Difference in spatial metadata\n" ); - fprintf( state->reportFilePtr, "Max ABS diff in spatial direction (degrees): %f\n", maxAbsDiffDirection ); - fprintf( state->reportFilePtr, "Mean ABS diff in spatial direction (degrees): %f\n", meanAbsDiffDirection ); + fprintf( state->reportFilePtr, "Max ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %f\n", maxAbsDiffDirection / 180.0f ); + fprintf( state->reportFilePtr, "Mean ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %f\n", meanAbsDiffDirection / 180.0f ); fprintf( state->reportFilePtr, "Max ABS diff in direct-to-total ratio: %f\n", maxAbsDiffDirRatio ); fprintf( state->reportFilePtr, "Mean ABS diff in direct-to-total ratio: %f\n", meanAbsDiffDirRatio ); fprintf( state->reportFilePtr, "Max ABS diff in diffuse-to-total ratio: %f\n", maxAbsDiffDiffRatio ); @@ -546,8 +546,8 @@ static int compareMasaFrameSpatialMeta( MasaDiffToolState *state, const int isDi state->frame, isDiff_frame_descriptiveMeta, 0, // Always identical in this function - maxAbsDiffDirection, - meanAbsDiffDirection, + maxAbsDiffDirection / 180.0f, + meanAbsDiffDirection / 180.0f, maxAbsDiffDirRatio, meanAbsDiffDirRatio, maxAbsDiffDiffRatio, @@ -704,9 +704,9 @@ static void writeCsvHeader( FILE *csvFilePtr ) fprintf( csvFilePtr, "," ); fprintf( csvFilePtr, "Diff in number of directions" ); fprintf( csvFilePtr, "," ); - fprintf( csvFilePtr, "Max ABS diff: Direction (degrees spatial angle)" ); + fprintf( csvFilePtr, "Max ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle)" ); fprintf( csvFilePtr, "," ); - fprintf( csvFilePtr, "Mean ABS diff: Direction (degrees spatial angle)" ); + fprintf( csvFilePtr, "Mean ABS diff: Direction (scaled to range 0...1 from 0°...180° spatial angle)" ); fprintf( csvFilePtr, "," ); fprintf( csvFilePtr, "Max ABS diff: Direct-to-total ratio" ); fprintf( csvFilePtr, "," ); @@ -805,8 +805,8 @@ static void printSummary( const MasaDiffToolState *state ) if ( state->isDiff_overall_spatialMeta ) { fprintf( stdout, "Spatial metadata is different.\n" ); - fprintf( stdout, "Overall max ABS diff in spatial direction (degrees): %3.2f\n", state->maxAbsDiffDirection_overall ); - fprintf( stdout, "Overall mean ABS diff in spatial direction (degrees): %3.2f\n", state->sumAbsDiffDirection / (float) state->sumAbsDiffDirectionValueCount ); + fprintf( stdout, "Overall max ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %3.2f\n", state->maxAbsDiffDirection_overall / 180.0f ); + fprintf( stdout, "Overall mean ABS diff in spatial direction (scaled to range 0...1 from 0°...180°): %3.2f\n", ( state->sumAbsDiffDirection / (float) state->sumAbsDiffDirectionValueCount ) / 180.0f ); fprintf( stdout, "Overall max ABS diff in direct-to-total ratio: %1.4f\n", state->maxAbsDiffDirRatio_overall ); fprintf( stdout, "Overall mean ABS diff in direct-to-total ratio: %1.4f\n", state->sumAbsDiffDirRatio / (float) state->sumAbsDiffDirRatioValueCount ); fprintf( stdout, "Overall max ABS diff in diffuse-to-total ratio: %1.4f\n", state->maxAbsDiffDiffRatio_overall ); diff --git a/scripts/tools/Darwin/masaDiffTool b/scripts/tools/Darwin/masaDiffTool index be5e6dedee681592287daae749b23a4ce9729dc9..4ccd5fd42376fcf6001657c7e66a3e1fdd539e17 100755 Binary files a/scripts/tools/Darwin/masaDiffTool and b/scripts/tools/Darwin/masaDiffTool differ diff --git a/scripts/tools/Linux/masaDiffTool b/scripts/tools/Linux/masaDiffTool index 84ade9d56ef08f62c5793c9039f641c6bb146ad4..baa0e0a2c1533bdda085ad6f4600cb8ee76ed44e 100755 Binary files a/scripts/tools/Linux/masaDiffTool and b/scripts/tools/Linux/masaDiffTool differ diff --git a/scripts/tools/Win32/masaDiffTool.exe b/scripts/tools/Win32/masaDiffTool.exe old mode 100644 new mode 100755 index 3fd7f08ae1404e491fdeaa9d79586498ffc95ee7..482418fd124bbfaba323ffca9ec96305e8321994 --- a/scripts/tools/Win32/masaDiffTool.exe +++ b/scripts/tools/Win32/masaDiffTool.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61e2e4234e68c2af1d221ea2490be954299eecf1f3046b24b8a0c24ce99f3528 -size 60928 +oid sha256:43bdd2ef827b62b5894524c1b2c513a2bb1f209bf0126a22d6b09aca2e2dc26f +size 26624 diff --git a/scripts/tools/Win32/wav-diff.exe b/scripts/tools/Win32/wav-diff.exe old mode 100644 new mode 100755