Commit 0667bb3c authored by TYAGIRIS's avatar TYAGIRIS
Browse files

Merge branch 'main' into 512-remove-deactivated-code

parents f19a0f43 0ede305f
Loading
Loading
Loading
Loading
Loading
+103 −86
Original line number Diff line number Diff line
@@ -12,6 +12,13 @@ variables:
  EXIT_CODE_FAIL: 1
  PROCESSING_SCRIPTS_BIN_DIR: "/test-bin"
  TESTS_DIR_CODEC_BE_ON_MR: "tests/codec_be_on_mr_nonselection"
  MANUAL_PIPELINE_TYPE:
    description: "Type for the manual pipeline run. Use 'test-be-release' to run BE test against release codec."
    value: 'default'
    options:
      - 'default'
      - 'test-be-release'


default:
  interruptible: true # Make all jobs by default interruptible
@@ -31,10 +38,11 @@ workflow:
stages:
  - .pre
  - maintenance
  - prevalidate
  - build
  - test
  - compare
  - validate
  - postvalidate
  - deploy

# ---------------------------------------------------------------
@@ -126,6 +134,14 @@ stages:
  - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
  - sed -i.bak -e "s/\/\/[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)/\1/g"        ./lib_com/options.h

.get-commits-behind-count: &get-commits-behind-count
  - echo $CI_COMMIT_SHA
  - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)

.check-commits-behind-count-in-compare-jobs: &check-commits-behind-count-in-compare-jobs
  - if [ $commits_behind_count -ne 0 ]; then echo "Your branch is not up-to-date with main -> Compare tests will not run as they can contain false negatives this way.\nMain might have changed during your pipeline run. Run 'git merge origin/main' to update."; exit 1; fi

# ---------------------------------------------------------------
# Job templates
# ---------------------------------------------------------------
@@ -143,6 +159,8 @@ stages:
      when: never
    - if: $CI_PIPELINE_SOURCE == 'trigger' # Don't run triggered pipeline by default
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'test-be-release' # Skip all the normal jobs when testing manually against release codec
      when: never
    - when: on_success

.rules-merge-request:
@@ -170,11 +188,13 @@ stages:
.build-job-linux:
  stage: build
  timeout: "4 minutes"
  needs: []
  tags:
    - ivas-linux

.build-job-windows:
  stage: build
  needs: []
  timeout: "4 minutes"
  tags:
    - ivas-windows
@@ -227,19 +247,28 @@ uninterruptible:
# Validation jobs
# ---------------------------------------------------------------

check-if-branch-is-up-to-date-with-main:
branch-is-up-to-date-with-main-pre:
  extends:
    - .rules-merge-request
  stage: validate
  stage: prevalidate
  needs: []
  tags:
    - ivas-linux
  script:
    - echo $CI_COMMIT_SHA
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
    - *get-commits-behind-count
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, run 'git merge origin/main' to update."; exit 1; fi;

branch-is-up-to-date-with-main-post:
  extends:
    - .rules-merge-request
  stage: postvalidate
  tags:
    - ivas-linux
  script:
    - *get-commits-behind-count
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else exit 1; fi;
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, possibly main changed during your pipeline run, run 'git merge origin/main' to update." exit 1; fi;

# ---------------------------------------------------------------
# Build jobs
@@ -329,6 +358,8 @@ codec-smoke-test:
  needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
  script:
    - *print-common-info
    # LTV update needed as ltv ISM metadata files are used
    - *update-ltv-repo
    - bash ci/smoke_test.sh
    ### analyze for failures
    - if ! [ -s smoke_test_output.txt ] || ! [ -s smoke_test_output_plc.txt ] || ! [ -s smoke_test_output_jbm_noEXT.txt ] || ! [ -s smoke_test_output_hrtf.txt ]; then echo "Error in smoke test"; exit 1; fi
@@ -359,7 +390,7 @@ codec-msan:
    - *print-common-info
    - make clean
    - make -j CLANG=1
    - python3 scripts/self_test.py --create | tee test_output.txt
    - python3 scripts/self_test.py -z console --create | tee test_output.txt
    - run_errors=$(cat test_output.txt | grep -ic "run errors") || true
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang memory-sanitizer"; exit 1; fi
  artifacts:
@@ -381,7 +412,7 @@ codec-asan:
    - *print-common-info
    - make clean
    - make -j CLANG=2
    - python3 scripts/self_test.py --create | tee test_output.txt
    - python3 scripts/self_test.py -z console --create | tee test_output.txt
    - run_errors=$(cat test_output.txt | grep -ic "run errors") || true
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang address-sanitizer"; exit 1; fi
  artifacts:
@@ -403,7 +434,7 @@ codec-usan:
    - *print-common-info
    - make clean
    - make -j CLANG=3
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 scripts/self_test.py --create
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 scripts/self_test.py -z console --create
    - grep_exit_code=0
    - grep UndefinedBehaviorSanitizer scripts/ref/logs/* || grep_exit_code=$?
    - if [ $grep_exit_code != 1 ] ; then echo "Run errors in self_test.py with Clang undefined-behavior-sanitizer"; exit 1; fi
@@ -519,6 +550,8 @@ renderer-pytest-on-merge-request:
  stage: compare
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # write to temporary file as workaround for failures observed with piping echo
@@ -600,6 +633,8 @@ split-rendering-pytest-on-merge-request:
  stage: compare
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # write to temporary file as workaround for failures observed with piping echo
@@ -663,6 +698,8 @@ ivas-pytest-on-merge-request:
  timeout: "10 minutes"
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs
    - *merge-request-comparison-setup-codec

    # some helper variables - "|| true" to prevent failures from grep not finding anything
@@ -715,6 +752,8 @@ evs-pytest-on-merge-request:
  timeout: "10 minutes"
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs
    - *merge-request-comparison-setup-codec

    # some helper variables - "|| true" to prevent failures from grep not finding anything
@@ -759,8 +798,8 @@ voip-be-on-merge-request:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: compare # Or should it be test? Comparison is done within one git revision
  needs: ["build-codec-linux-make", codec-smoke-test]
  stage: test
  needs: ["build-codec-linux-make", "codec-smoke-test"]
  timeout: "10 minutes"
  script:
    - *print-common-info
@@ -772,7 +811,7 @@ clang-format-check:
    - .rules-merge-request
  variables:
    ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix"
  stage: validate
  stage: prevalidate
  needs: []
  timeout: "5 minutes"
  script:
@@ -819,7 +858,7 @@ check-first-frame-is-sid:
  tags:
    - ivas-linux
  stage: test
  # needs: ["build-codec-linux-cmake"]
  needs: ["build-codec-linux-cmake"]
  script:
    - *print-common-info
    - *update-ltv-repo
@@ -830,13 +869,16 @@ check-first-frame-is-sid:
    - make -j

    # TODO: for some MASA modes, we currently do not have testvectors that actually trigger DTX
    # SBA is run separately to use shorter part of file
    # SBA modes are run separately to use shorter part of file
    - exit_code_no_sba=0
    - exit_code_sba=0
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA | grep -v SBA)
    - scripts/runIvasCodec.py -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500 -U 0:20 || exit_code_no_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep SBA)
    - scripts/runIvasCodec.py -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500 -U 70:80 || exit_code_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA | grep -vE "FOA|HOA" )
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 200 -U 0:20 || exit_code_no_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 || exit_code_sba=$?
    # need to do FOA separately as VAD apparently behaves differently there
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 || exit_code_sba=$?
    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_sba -ne 0 ]; then exit 1; fi
  artifacts:
    paths:
@@ -846,50 +888,11 @@ check-first-frame-is-sid:
    expose_as: "logs-sidstart"
    expire_in: "5 days"

selection-test-processing:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  tags:
    - processing-scripts-linux
  stage: test
  needs: ["build-codec-linux-make"]
  script:
    # get processing script code
    - git clone https://forge.3gpp.org/rep/ivas-codec-pc/ivas-processing-scripts.git --single-branch -b main

    - mkdir -p ivas-processing-scripts/tests/data/testv
    - cp -r scripts/testv/* ivas-processing-scripts/tests/data/testv/

    # copy binaries into local bin dir, those should take precendence over PATH
    - cp $PROCESSING_SCRIPTS_BIN_DIR/* ivas-processing-scripts/ivas_processing_scripts/bin/
    # for testing with native binaries
    - rm ivas-processing-scripts/ivas_processing_scripts/bin/IVAS*.exe
    - rm ivas-processing-scripts/ivas_processing_scripts/bin/EVS*.exe

    # build codec and put into bin dir
    - make -j
    - cp ./IVAS_* ivas-processing-scripts/ivas_processing_scripts/bin/

    # patch the use_windows_codec_binaries key (weird folding is needed so colons are accepted)
    - >
      sed -i "s/use_windows_codec_binaries: true/use_windows_codec_binaries: false/" ivas-processing-scripts/experiments/selection/*/config/*.yml

    # run experiments test
    - cd ivas-processing-scripts
    - python3 -m pytest tests/test_experiments.py::test_generate_test_items -n auto | tee log.txt
  artifacts:
    paths:
      - ivas-processing-scripts/experiments/selection/*/proc_output/*.log
      - log.txt
    when: on_failure
    expire_in: 1 week

lc3plus-ensure-no-code-changes:
  extends:
    - .test-job-linux
    - .rules-merge-request
  stage: validate
  stage: postvalidate
  needs: []
  timeout: "5 minutes"
  script:
@@ -1037,6 +1040,40 @@ codec-comparison-on-main-push:
    reports:
      junit: report-junit.xml


# ---------------------------------------------------------------
# Manual jobs
# ---------------------------------------------------------------

test-be-to-release:
  stage: test
  tags:
    - ivas-windows
  resource_group: ivas-be-to-release-test-resource
  timeout: "20 minutes"
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-be-release'
  script:

    - echo "$CI_COMMIT_BRANCH"
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression

    # path to release candidate refs defined in config.toml

    - echo "Placeholder for BE test to release script"
    - mkdir logs

  artifacts:
    name: "test-be-to-release--sha-$CI_COMMIT_SHORT_SHA--results"
    when: always
    expire_in: 1 week
    paths:
      - logs/
    expose_as: "test-be-to-release results"

# ---------------------------------------------------------------
# Scheduled jobs on main
# ---------------------------------------------------------------
@@ -1211,15 +1248,15 @@ sanitizer-test-mc-7_1_4:
    - .sanitizer-test-template
  timeout: 6 hours

sanitizer-test-sba:
sanitizer-test-hoa3:
  extends: .sanitizer-test-schedule-C
  rules:
    - if: $SANITIZER_SCHEDULE_C
  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
    - python3 ci/run_scheduled_sanitizer_test.py HOA3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-planarsba:
sanitizer-test-planarhoa3:
  extends: .sanitizer-test-schedule-C
  rules:
    - if: $SANITIZER_SCHEDULE_C
@@ -1227,7 +1264,7 @@ sanitizer-test-planarsba:
      start_in: 6 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
    - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

### --- sanitizer schedule D ---

@@ -1291,6 +1328,7 @@ coverage-test-on-main-scheduled:
  timeout: 2 hours
  script:
    - *print-common-info
    - *update-ltv-repo
    - make GCOV=1 -j
    - cp IVAS_rend IVAS_rend_ref # Copy exec to be able to run renderer script
    - python3 tests/create_short_testvectors.py
@@ -1411,7 +1449,7 @@ complexity-sba-hoa3-in-hoa3-out:
    - *print-common-info
    - *update-ltv-repo
    - *complexity-measurements-setup
    - in_format=SBA
    - in_format=HOA3
    - out_format=HOA3
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
@@ -1476,27 +1514,6 @@ complexity-StereoDmxEVS-stereo-in-mono-out:
# Other jobs
# ---------------------------------------------------------------

upload-selection-BE-log:
  rules:
    - if: $UPLOAD_SELECTION_BE_RESULTS && $CI_PIPELINE_SOURCE == 'trigger'
      when: always
  timeout: 5 minutes
  tags:
    - ericsson-windows-runner
  script:
    - cp -r $SELECTION_BE_RESULT ./selection-BE-result
    - Get-Content -Path selection-BE-result/public_log--sha-*.txt
    - $has_failed_debugging_active = (Select-String -Path selection-BE-result/public_log--sha-*.txt -Pattern '^FAILED tests' -CaseSensitive).Line
    - Get-Content -Path selection-BE-result/public_log_DEBUGGING_inactive--sha-*.txt
    - $has_failed_debugging_inactive = (Select-String -Path selection-BE-result/public_log_DEBUGGING_inactive--sha-*.txt -Pattern '^FAILED tests' -CaseSensitive).Line
    - If($has_failed_debugging_active -or $has_failed_debugging_inactive) {exit -1}
  artifacts:
    paths:
      - selection-BE-result/public_log--sha-*.txt
      - selection-BE-result/public_log_DEBUGGING_inactive--sha-*.txt
    when: always
    expire_in: 1 week

# job that sets up gitlab pages website
pages:
  stage: deploy
+389 −1587

File changed.

Preview size limit exceeded, changes collapsed.

+16 −135
Original line number Diff line number Diff line
@@ -777,12 +777,7 @@ int main(
    int32_t delayTimeScale = 0;
    int16_t i, numChannels;
    ivas_error error = IVAS_ERR_OK;
#ifndef API_5MS
    IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME];
#endif
#ifdef API_5MS
    bool splitBinNeedsNewFrame = true;
#endif

#ifdef WMOPS
    reset_wmops();
@@ -1001,13 +996,7 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    }
#endif
    const int16_t frameSize_smpls = (int16_t) (
#ifdef API_5MS
        ( args.framing_5ms ? 5 : 20 )
#else
        20
#endif
        * args.sampleRate / 1000 );
    const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 );

    IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 };
    IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 };
@@ -1017,12 +1006,8 @@ int main(
    IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 };
#endif

    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain
#ifdef API_5MS
                                   ,
                                   ( args.framing_5ms ) ? 1 : 4
#endif
                                   ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain,
                                   ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -1426,9 +1411,7 @@ int main(
    bitsBuffer.config.bufLenInBytes = bitsBufferSize;
    bitsBuffer.config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.poseCorrection = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef API_5MS
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif
#else
    inFloatBuffer = malloc( inBufferSize * sizeof( float ) );
    outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) );
@@ -1458,35 +1441,23 @@ int main(
        fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" );
    }

#ifdef API_5MS
    ObjectPositionBuffer mtdBuffer;
#endif

    while ( 1 )
    {
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;
#ifdef API_5MS
        const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0;
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
        numSamplesRead = 0;
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args )
#ifdef API_5MS
             && splitBinNeedsNewFrame
#endif
        )
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) && splitBinNeedsNewFrame )
        {
            ivas_error error_tmp;
            numSamplesRead = (int16_t) inBufferSize;
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection
#ifdef API_5MS
                                                        ,
                                                        &bitsBuffer.config.codec_frame_size_ms
#endif
            );
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection,
                                                        &bitsBuffer.config.codec_frame_size_ms );
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1514,11 +1485,7 @@ int main(
        }
#endif

        if ( numSamplesRead == 0
#ifdef API_5MS
             && splitBinNeedsNewFrame
#endif
        )
        if ( numSamplesRead == 0 && splitBinNeedsNewFrame )
        {
            /* end of input data */
            break;
@@ -1533,18 +1500,10 @@ int main(
        );

        int16_t num_subframes, sf_idx;
#ifdef API_5MS
        num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
#else
        num_subframes = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
#endif

#ifdef API_5MS
        if ( isCurrentFrameMultipleOf20ms )
        {
#else
        ObjectPositionBuffer mtdBuffer;
#endif
            IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer );

            if ( referenceVectorReader != NULL )
@@ -1580,14 +1539,11 @@ int main(
                    }
                }
            }
#ifdef API_5MS
        }
#endif

        /* Read from head rotation trajectory file if specified */
        if ( headRotReader != NULL )
        {
#ifdef API_5MS
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
            {
                IVAS_QUATERNION headRot;
@@ -1603,70 +1559,26 @@ int main(
                                                          ,
                                                          DEFAULT_AXIS
#endif
#ifdef API_5MS
                                                          ,
                                                          sf_idx
#endif
                                                          ) ) != IVAS_ERR_OK )
                                                          sf_idx ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                }
            }
#else
            IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME];

            for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ )
            {
                if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                }
            }

            if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer, Pos
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                      ,
                                                      DEFAULT_AXIS
#endif
                                                      ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
#endif
        }
        else
        {
#ifdef API_5MS
            if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
#else /* API_5MS */
            error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                               ,
                                               DEFAULT_AXIS
#endif
            );
            if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT )
            {
                fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
#endif /* API_5MS */
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
        /* Read from split renderer bfi file if specified */
        if ( splitRendBFIReader != NULL
#ifdef API_5MS
             && splitBinNeedsNewFrame
#endif
        )
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        {
            int16_t bfi;
            SplitRendBFIFileReading( splitRendBFIReader, &bfi );
@@ -1682,11 +1594,7 @@ int main(
            int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
            int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
            int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
#ifdef API_5MS
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
#else
            for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ )
#endif
            {
                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK )
                {
@@ -1694,27 +1602,15 @@ int main(
                    exit( -1 );
                }
            }
#ifdef API_5MS
            for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
            {
                if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx]
#ifdef API_5MS
                                                                 ,
                                                                 sf_idx
#endif
                                                                 ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx],
                                                                 sf_idx ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                }
            }
#else
            if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, quatBuffer, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
#endif
        }

        /* Combine external orientations and head rotation */
@@ -1828,10 +1724,8 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
        for ( i = 0; i < args.inConfig.numBinBuses; ++i )
        {
#ifdef API_5MS
            if ( splitBinNeedsNewFrame )
            {
#endif
                if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
@@ -1850,13 +1744,11 @@ int main(
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                }
#ifdef API_5MS
            }
#endif
        }
#endif

#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT
        if ( args.inConfig.numBinBuses != 0 )
        {
            if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
@@ -1877,14 +1769,7 @@ int main(
        else
        {
#endif
            if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer
#ifndef API_5MS
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                 ,
                                                 &bitsBuffer
#endif
#endif
                                                 ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer ) ) != IVAS_ERR_OK )
            {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) );
@@ -1893,7 +1778,7 @@ int main(
#endif
                exit( -1 );
            }
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT
        }
#endif

@@ -1944,12 +1829,8 @@ int main(
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) )
        {
            if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection
#ifdef API_5MS
                                                     ,
                                                     bitsBuffer.config.codec_frame_size_ms
#endif
                                                     ) != IVAS_ERR_OK )
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection,
                                                     bitsBuffer.config.codec_frame_size_ms ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
+3 −2

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ def main():

    result_dict = dict()
    # run first part in parallel
    with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
    with concurrent.futures.ThreadPoolExecutor() as executor:
        executor.map(
            run_file, README_FILES_PARALLEL, BIN_PATHS, [result_dict] * len(README_FILES_PARALLEL)
        )
Loading