Commit ff8a96c6 authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch 'main' into...

Merge branch 'main' into 13-sba-cpe-mct-artefacts-in-drums-vector-at-48khz-encode-16khz-decode-64-160-256kbps-189
parents 51f37f4f ce3c4d6d
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ scripts/ref/
scripts/test/
scripts/out/
scripts/self_test_summary.txt
tests/dut
tests/ref

# Python files that pop up when running scripts
__pycache__/
+227 −77
Original line number Diff line number Diff line
@@ -2,6 +2,12 @@ variables:
  TESTV_DIR: "/usr/local/testv"
  BUILD_OUTPUT: "build_output.txt"
  EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"
  SANITIZER_TESTS: "CLANG1 CLANG2"
  OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4"
  OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3"
  OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM"
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1


# This sets when pipelines are created. Jobs have more specific rules to restrict them.
@@ -14,7 +20,6 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main
    - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main


stages:
  - maintenance
  - build
@@ -250,7 +255,7 @@ asan-on-merge-request-linux:


# compare bit exactness between target and source branch
self-test-on-merge-request:
pytest-on-merge-request:
  extends: 
    - .test-job-linux
    - .rules-merge-request
@@ -292,40 +297,53 @@ self-test-on-merge-request:
    - mv IVAS_dec ../IVAS_dec_ref
    - cd ..

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

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt

    ### analyse test output

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - evs_non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[evs[ -]*non[ -]*be\]") || true
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - run_errors=$(cat test_output.txt | grep -c "test conditions had run errors") || true
    - bitexact=$(cat test_output.txt | grep -c "All [0-9]* tests are bitexact") || true
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1

    - selftest_exit_code=0
    - expected_nonbe_1=0
    - expected_nonbe_2=0
    - fail_1=0
    - fail_2=0

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # rename test binaries back
    - mv IVAS_cod_test IVAS_cod
    - mv IVAS_dec_test IVAS_dec
    # create references
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2
    - python3 -m pytest tests/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm

    ### run pytest
    - exit_code=0
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

    # check for crashes during the test, if any happened, fail the test
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py"; exit $EXIT_CODE_FAIL; fi
    - if [ $zero_errors != 1 ]; then echo "Run errors in pytest"; fail_1=1; fi

    # check for non bitexact output and store exit code to also always run the SBA pytest
    - if [ $bitexact == 0 ] && [ $non_be_flag == 0 ] ; then echo "Non-bitexact cases without non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_FAIL; fi
    - if [ $bitexact == 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_NON_BE; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures without non-BE tag encountered"; fail_1=1; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "pytest run had failures with non-BE tag encountered"; expected_nonbe_1=1; fi

    ### run SBA pytest
    ### run pytest for EVS cases
    - exit_code=0
    - python3 ./scripts/ivas_pytests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi;
    # return exit code from selftest if everything went well with the pytest run
    - exit $selftest_exit_code
    - 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=$?
    - zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true

    - if [ $zero_errors != 1 ]; then echo "Run errors in pytest for EVS"; fail_2=1; fi

    - if [ $exit_code -eq 1 ] && [ $evs_non_be_flag == 0 ]; then echo "Non-bitexact EVS cases without EVS-non-BE tag encountered"; fail_2=1; fi
    - if [ $exit_code -eq 1 ] && [ $evs_non_be_flag != 0 ]; then echo "Non-bitexact EVS cases with EVS-non-BE tag encountered"; expected_nonbe_2=1; fi

    # Check results from both tests
    - if [ $fail_1 -eq 1 ] || [ $fail_2 -eq 1 ]; then exit $EXIT_CODE_FAIL; fi
    - if [ $expected_nonbe_1 -eq 1 ] || [ $expected_nonbe_2 -eq 1 ]; then exit $EXIT_CODE_NON_BE; fi
    - exit 0

  allow_failure:
    exit_codes:
      - 123
@@ -333,13 +351,13 @@ self-test-on-merge-request:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    when: always
    paths:
      - test_output.txt
      - scripts/test/logs/
      - scripts/ref/logs/
      - report-junit.xml
    expose_as: 'Self test results'
      - report-junit-evs.xml
    expose_as: 'pytest results'
    reports:
      junit: report-junit.xml
      junit:
        - report-junit.xml
        - report-junit-evs.xml


# ---------------------------------------------------------------
@@ -416,37 +434,26 @@ codec-comparison-on-main-push:
    ### re-checkout the latest commit in the main branch
    - git checkout $latest_commit

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt

    ### analyse test output

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # helper variable - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - run_errors=$(cat test_output.txt | grep -c "test conditions had run errors") || true
    - bitexact=$(cat test_output.txt | grep -c "All [0-9]* tests are bitexact") || true
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1

    - selftest_exit_code=0

    # check for crashes during the test, if any happened, fail the test
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py"; exit $EXIT_CODE_FAIL; fi

    # check for non bitexact output and store exit code to also always run the SBA pytest
    - if [ $bitexact == 0 ] && [ $non_be_flag == 0 ] ; then echo "Non-bitexact cases without non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_FAIL; fi
    - if [ $bitexact == 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_NON_BE; fi

    ### run SBA pytest
    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # rename test binaries back
    - mv IVAS_cod_test IVAS_cod
    - mv IVAS_dec_test IVAS_dec
    # create references
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

    ### run pytest
    - exit_code=0
    - python3 ./scripts/ivas_pytests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi;
    # return exit code from selftest if everything went well with the pytest run
    - exit $selftest_exit_code
  allow_failure:
    exit_codes:
      - 123
@@ -454,43 +461,186 @@ codec-comparison-on-main-push:
    name: "main-push--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    when: always
    paths:
      - test_output.txt
      - scripts/test/logs/
      - scripts/ref/logs/
      - report-junit.xml
    expose_as: 'Results of comparison to previous merge commit'
    reports:
      junit: report-junit.xml


# parameterizable job for sanitizer tests per format
# how to set up: create a schedule (CI/CD -> schedules) and enter the respective values for the environment variables:
#   - SANITIZER_TEST_IN_FMT: input format
#   - SANITIZER_TEST_OUT_FMTS: list of output formats, blank-separated, e.g.: stereo mono 5_1
#   - SANITIZER_TEST_TESTS: list of checks to do, can be one of CLANG1, CLANG2, CLANG3, VALGRIND
sanitizer-test-on-main-scheduled:
# ---------------------------------------------------------------
# Scheduled jobs on main
# ---------------------------------------------------------------
.sanitizer-test-template:
  extends:
    - .test-job-linux-needs-testv-dir
    # this next one is maybe not really needed, since there is the rule checking for the existence of the env vars below, but use for clarity
    - .rules-main-scheduled
  stage: test
  tags:
    - sanitizer_test_main
  artifacts:
    name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
    when: always
    paths:
      - ep_015.g192

sanitizer-test-mono:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
  script:
    - python3 ci/run_scheduled_sanitizer_test.py mono mono --tests $SANITIZER_TESTS

sanitizer-test-stereo:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 20 minutes
  script:
    - python3 ci/run_scheduled_sanitizer_test.py stereo $OUT_FORMATS_CHANNEL_BASED --tests $SANITIZER_TESTS

sanitizer-test-stereodmxevs:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 40 minutes
  script:
    - 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
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 1 hour 30 minutes
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 2 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 2 hours 30 minutes
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 3 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 4 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 5 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 6 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 7 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 8 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 9 hours
  script:
    - 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:
  extends: .sanitizer-test-template
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 10 hours
  script:
    - 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
coverage-test-on-main-scheduled:
  extends: 
    - .test-job-linux-needs-testv-dir
    - .rules-main-scheduled    
  tags:
    - coverage-test
  stage: test
  rules:
    # only run in scheduled pipeline that passes this env vars
    - if: $SANITIZER_TEST_IN_FMT && $SANITIZER_TEST_OUT_FMTS && $SANITIZER_TEST_TESTS
    - if: $COVERAGE_TEST  
  script:
    - *print-common-info
    - echo "Running scheduled sanitizer tests $SANITIZER_TEST_TESTS for input format $SANITIZER_TEST_IN_FMT and output format(s) $SANITIZER_TEST_OUT_FMTS"

    - python3 ci/run_scheduled_sanitizer_test.py $SANITIZER_TEST_IN_FMT $SANITIZER_TEST_OUT_FMTS --tests $SANITIZER_TEST_TESTS
    - make GCOV=1 -j
    - python3 tests/create_short_testvectors.py
    - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest tests/test_param_file.py -v -n 0 --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - lcov -c -d obj -o coverage.info
    - genhtml coverage.info -o coverage
  artifacts:
    name: "sanitizer-test-results-and-error_pattern-$SANITIZER_TEST_IN_FMT-in-$SANITIZER_TEST_OUT_FMTS-out"
    name: "main-coverage-sha-$CI_COMMIT_SHORT_SHA"
    when: always
    paths:
      - ep_015.g192
      - "./*/logs"

      - coverage.info
      - coverage

# ---------------------------------------------------------------
# Other jobs
+4 −4
Original line number Diff line number Diff line
@@ -427,25 +427,25 @@ int main(
        /* sanity check */
        if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM )
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n" );
            fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n\n" );
            goto cleanup;
        }

        if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
            fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }

        if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n", arg.renderConfigFilename );
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
            goto cleanup;
        }

        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }
+14 −3
Original line number Diff line number Diff line
@@ -32,16 +32,27 @@ def main(args):


def get_modes(in_format: str) -> list:
    cmd = [SCRIPT_DIR.joinpath("runIvasCodec.py"), "-l"]

    cmd = [
            SCRIPT_DIR.joinpath("runIvasCodec.py"),
            "-C",
            "MC" if in_format in MC_MODES else in_format,
            "-l"
        ]
    list_process = subprocess.run(cmd, capture_output=True)

    output = list_process.stdout.decode("utf8")

    # correction for multichannel modes to avoid selecting some mono modes...
    if in_format in MC_MODES:
        in_format = "MC_" + in_format
        in_format = "MC_" + in_format + "_b"

    mode_list = [m for m in output.splitlines() if in_format in m]
    if "SBA" in in_format:
        # rate switching not implemented yet
        mode_list = [m for m in mode_list if not "_rs" in m]

    return [m for m in output.splitlines() if in_format in m]
    return mode_list


def run_check(modes: list, out_formats: list, tests: list, run_fec: bool = True):
+28 −1
Original line number Diff line number Diff line
@@ -1820,7 +1820,11 @@ ivas_error preview_indices(
                break;
        }
    }
#ifdef ALIGN_SID_SIZE
    else if ( total_brate == IVAS_SID_5k2 )
#else
    else if ( total_brate == IVAS_SID_4k4 )
#endif
    {
        /* read SID format */
        st_ivas->sid_format = 0;
@@ -1884,6 +1888,7 @@ ivas_error preview_indices(
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format );
        }
    }
#ifndef ALIGN_SID_SIZE
    else if ( total_brate == IVAS_SID_5k )
    {
        /* SBA SID frame */
@@ -1892,6 +1897,7 @@ ivas_error preview_indices(
        st_ivas->sba_mode = SBA_MODE_SPAR;
        st_ivas->element_mode_init = IVAS_SCE;
    }
#endif

    /* only read element mode from active frames */
    if ( is_DTXrate( total_brate ) == 0 )
@@ -1975,7 +1981,6 @@ ivas_error preview_indices(
        }
        else if ( st_ivas->ivas_format == SBA_FORMAT )
        {

            /* Read SBA planar flag and SBA order */
            st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 );
            st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 );
@@ -1983,7 +1988,11 @@ ivas_error preview_indices(

            st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( total_brate, st_ivas->sba_order );

#ifdef HARMONIZE_SBA_NCHAN_TRANSPORT
            ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ) );
#else
            ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode );
#endif
        }
    }

@@ -2063,6 +2072,9 @@ ivas_error read_indices(
        }
        else if ( k == SIZE_IVAS_BRATE_TBL )
        {
#ifdef ALIGN_SID_SIZE
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error, illegal bitrate (%d) in the  G.192 frame ! Exiting ! \n", total_brate );
#else
            /*temp change for SPAR DTX*/
            if ( total_brate == IVAS_SID_5k )
            {
@@ -2072,6 +2084,7 @@ ivas_error read_indices(
            {
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error, illegal bitrate (%d) in the  G.192 frame ! Exiting ! \n", total_brate );
            }
#endif
        }
        else
        {
@@ -2965,4 +2978,18 @@ void evs_dec_previewFrame(
}


#ifdef ALIGN_SID_SIZE
void dtx_read_padding_bits(
    DEC_CORE_HANDLE st,
    int16_t num_bits )
{
    /* TODO: temporary hack, need to decide what to do with core-coder bitrate */
    int32_t tmp;
    tmp = st->total_brate;
    st->total_brate = st->total_brate + num_bits * FRAMES_PER_SEC;
    get_next_indice( st, num_bits );
    st->total_brate = tmp;
}
#endif

#undef WMC_TOOL_MAN
Loading