Commit 1eb5ac43 authored by stoutjesdijk's avatar stoutjesdijk 🎧
Browse files

Merge branch 'FhG/external-renderer' into 'Philips/external-renderer-api2'

parents 034ca33e 0057307d
Loading
Loading
Loading
Loading
+152 −76
Original line number Diff line number Diff line
variables:
  TESTV_DIR: "/usr/local/testv"
  LTV_DIR: "/usr/local/ltv"
  BUILD_OUTPUT: "build_output.txt"
  EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"
  SANITIZER_TESTS: "CLANG1 CLANG2"
@@ -9,7 +10,6 @@ variables:
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1


# This sets when pipelines are created. Jobs have more specific rules to restrict them.
workflow:
  rules:
@@ -44,8 +44,8 @@ stages:
.get-previous-merge-commit-sha: &get-previous-merge-commit-sha
  - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H)

.merge_request_comparison_setup: &merge_request_comparison_setup
  ### build test binaries, initial clean for paranoia reasons
.merge_request_comparison_setup:
  &merge_request_comparison_setup ### build test binaries, initial clean for paranoia reasons
  - make clean
  - mkdir build
  - cd build
@@ -53,6 +53,7 @@ stages:
  - make -j
  - mv IVAS_cod ../IVAS_cod_test
  - mv IVAS_dec ../IVAS_dec_test
  - mv IVAS_rend ..
  - cd ..
  - rm -rf build/*

@@ -82,15 +83,17 @@ stages:
  - mv IVAS_cod_test IVAS_cod
  - mv IVAS_dec_test IVAS_dec

  ### re-checkout the commit from the source branch to have up-to-date self_test.py and scripts/testv (and actually everything)
  - git checkout $source_branch_commit_sha

.merge-request-comparison-check: &merge-request-comparison-check
  - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact  cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
  - exit 0

.update-ltv-repo: &update-ltv-repo
  - cd $LTV_DIR
  - git pull
  - cd -

# ---------------------------------------------------------------
# Job templates
# ---------------------------------------------------------------
@@ -125,7 +128,6 @@ stages:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH


# templates to define stages and platforms
.test-job-linux:
  tags:
@@ -137,7 +139,6 @@ stages:
  tags:
    - ivas-linux


# template for test jobs on linux that need the TESTV_DIR
.test-job-linux-needs-testv-dir:
  extends: .test-job-linux
@@ -153,7 +154,6 @@ stages:
    exit_codes:
      - 123


# ---------------------------------------------------------------
# Validation jobs
# ---------------------------------------------------------------
@@ -172,7 +172,6 @@ check-if-branch-is-up-to-date-with-main:
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else exit 1; fi;


# ---------------------------------------------------------------
# Build jobs
# ---------------------------------------------------------------
@@ -238,7 +237,6 @@ build-codec-sanitizers-linux:
    - *print-common-info
    - bash ci/build_codec_sanitizers_linux.sh


# ---------------------------------------------------------------
# Test jobs for merge requests
# ---------------------------------------------------------------
@@ -263,8 +261,7 @@ codec-smoke-test:
      - out/logs/
      - smoke_test_output.txt
      - smoke_test_output_plc.txt
    expose_as: 'Smoke test results'

    expose_as: "Smoke test results"

# code selftest testvectors with memory-sanitizer binaries
msan-on-merge-request-linux:
@@ -285,8 +282,7 @@ msan-on-merge-request-linux:
    paths:
      - scripts/ref/logs/
      - test_output.txt
    expose_as: 'Msan selftest results'

    expose_as: "Msan selftest results"

# code selftest testvectors with address-sanitizer binaries
asan-on-merge-request-linux:
@@ -307,7 +303,7 @@ asan-on-merge-request-linux:
    paths:
      - scripts/ref/logs/
      - test_output.txt
    expose_as: 'Asan selftest results'
    expose_as: "Asan selftest results"

# test external renderer executable
external-renderer-make-pytest:
@@ -320,7 +316,16 @@ external-renderer-make-pytest:
    - make -j IVAS_rend
    - make -j unittests
    - make -j --directory scripts/td_object_renderer/object_renderer_standalone
    - python3 -m pytest tests/renderer/test_renderer.py -q --log-level ERROR -n auto -rA
    - python3 -m pytest -q --log-level ERROR -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    when: always
    paths:
      - report-junit.xml
    expose_as: "external renderer make pytest results"
    reports:
      junit:
        - report-junit.xml

# test external renderer executable with cmake + asan
external-renderer-cmake-asan-pytest:
@@ -333,7 +338,16 @@ external-renderer-cmake-asan-pytest:
    - python3 ci/disable_ram_counting.py
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=asan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - python3 -m pytest tests/renderer/test_renderer.py -q --log-level ERROR -n auto -rA
    - python3 -m pytest -q --log-level ERROR -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    when: always
    paths:
      - report-junit.xml
    expose_as: "external renderer cmake asan pytest results"
    reports:
      junit:
        - report-junit.xml

# test external renderer executable with cmake + msan
external-renderer-cmake-msan-pytest:
@@ -346,7 +360,37 @@ external-renderer-cmake-msan-pytest:
    - python3 ci/disable_ram_counting.py
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=msan  -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - python3 -m pytest tests/renderer/test_renderer.py -q --log-level ERROR -n auto -rA
    - python3 -m pytest -q --log-level ERROR -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    when: always
    paths:
      - report-junit.xml
    expose_as: "external renderer cmake msan pytest results"
    reports:
      junit:
        - report-junit.xml

# test external renderer executable with cmake vs decoder renderer
external-renderer-cmake-vs-decoder-pytest:
  extends:
    - .test-job-linux
    - .rules-merge-request
  needs: ["build-codec-linux-cmake"]
  stage: test
  script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true -DDEC_TO_REND_FLOAT_DUMP=true
    - cmake --build cmake-build -- -j
    - python3 -m pytest -q --log-level ERROR -n 1 -rA --junit-xml=report-junit.xml tests/renderer/test_renderer_vs_decoder.py
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    when: always
    paths:
      - report-junit.xml
    expose_as: "external renderer cmake vs decoder results"
    reports:
      junit:
        - report-junit.xml

# compare bit exactness between target and source branch
ivas-pytest-on-merge-request:
@@ -362,6 +406,10 @@ ivas-pytest-on-merge-request:

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
    # create short test vectors
@@ -370,6 +418,9 @@ ivas-pytest-on-merge-request:
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

    ### Run test using branch scripts and input
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    ### run pytest
    - exit_code=0
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
@@ -385,7 +436,7 @@ ivas-pytest-on-merge-request:
    when: always
    paths:
      - report-junit.xml
    expose_as: 'pytest ivas results'
    expose_as: "pytest ivas results"
    reports:
      junit:
        - report-junit.xml
@@ -403,11 +454,18 @@ evs-pytest-on-merge-request:
    
    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[evs[ -]*non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
    # create references
    - python3 -m pytest tests/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm

    ### Run test using branch scripts and input
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    ### run pytest for EVS cases
    - exit_code=0
    - python3 -m pytest tests/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --junit-xml=report-junit-evs.xml || exit_code=$?
@@ -423,12 +481,11 @@ evs-pytest-on-merge-request:
    when: always
    paths:
      - report-junit-evs.xml
    expose_as: 'pytest evs results'
    expose_as: "pytest evs results"
    reports:
      junit:
        - report-junit-evs.xml


# ---------------------------------------------------------------
# Test jobs for main branch
# ---------------------------------------------------------------
@@ -460,7 +517,6 @@ be-2-evs-linux:
    - cd evs_be_test
    - python3 ../ci/run_evs_be_test.py


codec-comparison-on-main-push:
  extends:
    - .test-job-linux
@@ -500,11 +556,12 @@ codec-comparison-on-main-push:
    - mv IVAS_dec ../IVAS_dec_ref
    - cd ..

    ### re-checkout the latest commit in the main branch
    - git checkout $latest_commit

    # helper variable - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### re-checkout the latest commit in the main branch, if ref_using_main is not set
    - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi

    ### prepare pytest
    # create short test vectors
@@ -516,6 +573,9 @@ codec-comparison-on-main-push:
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

    ### re-checkout the latest commit here, if ref_using_main is set
    - if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi

    ### run pytest
    - exit_code=0
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
@@ -531,20 +591,22 @@ codec-comparison-on-main-push:
    when: always
    paths:
      - report-junit.xml
    expose_as: 'Results of comparison to previous merge commit'
    expose_as: "Results of comparison to previous merge commit"
    reports:
      junit: report-junit.xml


# ---------------------------------------------------------------
# Scheduled jobs on main
# ---------------------------------------------------------------
.sanitizer-test-template:
  extends:
    # TODO: still needed since MASA ltv vectors are not there yet
    #       when they were added, we can add a needs-ltv-dir template
    - .test-job-linux-needs-testv-dir
  stage: test
  tags:
    - sanitizer_test_main
  timeout: "2 hours"
  artifacts:
    name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
    when: always
@@ -558,6 +620,7 @@ sanitizer-test-mono:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py mono mono --tests $SANITIZER_TESTS

sanitizer-test-stereo:
@@ -565,8 +628,9 @@ sanitizer-test-stereo:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 20 minutes
      start_in: 1 hour
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py stereo $OUT_FORMATS_CHANNEL_BASED --tests $SANITIZER_TESTS

sanitizer-test-stereodmxevs:
@@ -574,17 +638,19 @@ sanitizer-test-stereodmxevs:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 40 minutes
      start_in: 2 hours
  script:
    - python3 ci/run_scheduled_sanitizer_test.py StereoDmxEvs mono --tests $SANITIZER_TESTS
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py StereoDmxEVS mono --tests $SANITIZER_TESTS

sanitizer-test-ism1:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 1 hour
      start_in: 3 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-ism2:
@@ -592,8 +658,9 @@ sanitizer-test-ism2:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 1 hour 30 minutes
      start_in: 4 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-ism3:
@@ -601,8 +668,9 @@ sanitizer-test-ism3:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 2 hours
      start_in: 6 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-ism4:
@@ -610,8 +678,9 @@ sanitizer-test-ism4:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 2 hours 30 minutes
      start_in: 8 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1:
@@ -619,8 +688,9 @@ sanitizer-test-mc-5_1:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 3 hours
      start_in: 10 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1_2:
@@ -628,8 +698,9 @@ sanitizer-test-mc-5_1_2:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 4 hours
      start_in: 12 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1_2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1_4:
@@ -637,8 +708,9 @@ sanitizer-test-mc-5_1_4:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 5 hours
      start_in: 14 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-7_1:
@@ -646,8 +718,9 @@ sanitizer-test-mc-7_1:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 6 hours
      start_in: 16 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 7_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-7_1_4:
@@ -655,8 +728,9 @@ sanitizer-test-mc-7_1_4:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 7 hours
      start_in: 18 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 7_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-masa:
@@ -664,8 +738,9 @@ sanitizer-test-masa:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 8 hours
      start_in: 20 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py MASA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-sba:
@@ -673,8 +748,9 @@ sanitizer-test-sba:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 9 hours
      start_in: 22 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py SBA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-planarsba:
@@ -682,8 +758,9 @@ sanitizer-test-planarsba:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 10 hours
      start_in: 24 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py PlanarSBA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

# GCOV/LCOV coverage analysis of self_test suite
@@ -736,4 +813,3 @@ pull-from-3gpp-forge:

    # Push to mirror, include tags. Option `-o ci.skip` tells GitLab to skip CI for the pushed commits (assumed already tested upstream)
    - git push --tags -o ci.skip "https://${GITLAB_USER_LOGIN}:${MIRROR_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}"
+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ endif()
file(GLOB libDebugSrcs "lib_debug/*.c")
file(GLOB libDebugHeaders "lib_debug/*.h")
add_library(lib_debug ${libDebugSrcs} ${libDebugHeaders})
target_link_libraries(lib_debug lib_com)

file(GLOB libEncSrcs "lib_enc/*.c")
file(GLOB libEncHeaders "lib_enc/*.h")

lib_enc/igf_enc.c

100755 → 100644
+0 −0

File mode changed from 100755 to 100644.

+12 −5
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ struct HeadRotFileReader
    bool fileRewind;
};


#ifndef FIX_I173_I174
/*-----------------------------------------------------------------------*
 * HeadRotationFrameCheck()
 *
@@ -66,7 +66,7 @@ static ivas_error HeadRotationFrameCheck(

    return IVAS_ERR_OK;
}

#endif

/*-----------------------------------------------------------------------*
 * HeadRotationFileReader_open()
@@ -121,12 +121,18 @@ ivas_error HeadRotationFileReading(
)
{
    uint16_t i;
#ifndef FIX_I173_I174
    int32_t time_stamp = 0;
#endif
    float w, x, y, z;

    for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
    {
#ifdef FIX_I173_I174
        if ( 4 != fscanf( headRotReader->trajFile, "%f,%f,%f,%f", &w, &x, &y, &z ) )
#else
        if ( 5 != fscanf( headRotReader->trajFile, "%d,%f,%f,%f,%f", &time_stamp, &w, &x, &y, &z ) )
#endif
        {
            if ( feof( headRotReader->trajFile ) )
            {
@@ -137,12 +143,12 @@ ivas_error HeadRotationFileReading(
            return IVAS_ERR_FAILED_FILE_PARSE;
        }


#ifndef FIX_I173_I174
        if ( headRotReader->fileRewind == false && headRotReader->frameCounter != time_stamp )
        {
            return IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH;
        }

#endif

        ( headRotReader->frameCounter )++;

@@ -151,7 +157,7 @@ ivas_error HeadRotationFileReading(
        Quaternions[i].y = y;
        Quaternions[i].z = z;
    }

#ifndef FIX_I173_I174
    if ( headRotReader->fileRewind == false )
    {
        if ( ( time_stamp + 1 ) % IVAS_MAX_PARAM_SPATIAL_SUBFRAMES != 0 )
@@ -164,6 +170,7 @@ ivas_error HeadRotationFileReading(
    {
        return IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH;
    }
#endif

    return IVAS_ERR_OK;
}
+13 −1
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 );

@@ -98,7 +102,9 @@ ivas_error IsmFileReader_readNextFrame(
    float meta_prm[NUM_ISM_METADATA_PER_LINE];
    char *char_ptr;
    int16_t i;
#ifndef FIX_I173_I174
    int32_t time_stamp;
#endif
    FILE *file;

    if ( ismMetadata == NULL || self->file == NULL )
@@ -114,14 +120,18 @@ ivas_error IsmFileReader_readNextFrame(
    }

    char_ptr = strtok( char_buff, "," );
#ifndef FIX_I173_I174
    time_stamp = (int32_t) atoi( char_ptr );

    if ( time_stamp != self->frameCounter )
    {
        return IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH;
    }

#endif
    i = 0;
#ifdef FIX_I173_I174
    meta_prm[i++] = (float) atof( char_ptr );
#endif
    while ( ( char_ptr = strtok( NULL, "," ) ) != NULL && i < NUM_ISM_METADATA_PER_LINE )
    {
        meta_prm[i++] = (float) atof( char_ptr );
@@ -139,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;
}
Loading