Commit e2e5e898 authored by Jouni Paulus's avatar Jouni Paulus
Browse files

Merge remote-tracking branch 'origin/main' into 694-omasa-crash-for-extreme-sample

parents 517883e6 17a3401a
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -52,9 +52,9 @@ scripts/testv/stvOMASA_*.csv
scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav
scripts/testv/stvOMASA_3ISM_1MASA1TC48c.wav
# default reference binary name
IVAS_cod_ref
IVAS_dec_ref
IVAS_rend_ref
IVAS_cod_ref*
IVAS_dec_ref*
IVAS_rend_ref*

# Python files that pop up when running scripts
__pycache__/
+37 −39
Original line number Diff line number Diff line
@@ -68,12 +68,12 @@ stages:
  # needed when depth is lower than the number of commits in the branch
  - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

.mr-get-target-commit: &mr-get-target-commit
  # compare to last target branch commit before pipeline was created
.mr-get-target-commit:
  &mr-get-target-commit # compare to last target branch commit before pipeline was created
  - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H)

.check-for-testvectors: &check-for-testvectors
  # check if the testvector files specified in scripts/config/ci_linux*.json are present
.check-for-testvectors:
  &check-for-testvectors # check if the testvector files specified in scripts/config/ci_linux*.json are present
  - python3 -m pytest ci/test_vectors_available.py

.merge-request-comparison-setup-codec:
@@ -162,7 +162,6 @@ stages:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH


# templates to define stages and platforms
.test-job-linux:
  tags:
@@ -202,7 +201,6 @@ stages:
    exit_codes:
      - 123


# ---------------------------------------------------------------
# .pre jobs for setting up things
# ---------------------------------------------------------------
@@ -225,8 +223,6 @@ uninterruptible:
  tags:
    - ivas-linux



# ---------------------------------------------------------------
# Validation jobs
# ---------------------------------------------------------------
@@ -245,7 +241,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
# ---------------------------------------------------------------
@@ -331,15 +326,18 @@ codec-smoke-test:
    - .rules-merge-request
  timeout: "10 minutes"
  stage: test
  needs: ["build-codec-linux-cmake"]
  needs: ["build-codec-linux-cmake", "build-codec-linux-make",  "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
  script:
    - *print-common-info
    - bash ci/smoke_test.sh
    ### analyze for failures
    - if cat smoke_test_output.txt | grep -c "failed"; then echo "Smoke test without PLC failed"; exit 1; fi
    - if cat smoke_test_output_plc.txt | grep -c "failed"; then echo "Smoke test with PLC failed"; exit 1; fi
    - if cat smoke_test_output_jbm_noEXT.txt | grep -c "failed"; then echo "Smoke test JBM part failed"; exit 1; fi
    - if cat smoke_test_output_hrtf.txt | grep -c "failed"; then echo "Smoke test with external hrtf files failed"; exit 1; fi
    - 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
    - ret_val=0
    - if cat smoke_test_output.txt | grep -c "failed"; then echo "Smoke test without PLC failed"; ret_val=1; fi
    - if cat smoke_test_output_plc.txt | grep -c "failed"; then echo "Smoke test with PLC failed"; ret_val=1; fi
    - if cat smoke_test_output_jbm_noEXT.txt | grep -c "failed"; then echo "Smoke test JBM part failed"; ret_val=1; fi
    - if cat smoke_test_output_hrtf.txt | grep -c "failed"; then echo "Smoke test with external hrtf files failed"; ret_val=1; fi
    - exit $ret_val
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
@@ -526,8 +524,7 @@ renderer-pytest-on-merge-request:
    # write to temporary file as workaround for failures observed with piping echo
    - echo $CI_MERGE_REQUEST_TITLE > tmp.txt
    - non_be_flag=$(grep -c --ignore-case "\[rend\(erer\)*[ -]*non[ -]*be\]" tmp.txt) || true
    # TODO: needs splitting the test between reference and cut generation
    #- ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true
    - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true

    # store the current commit hash
    - source_branch_commit_sha=$(git rev-parse HEAD)
@@ -545,6 +542,9 @@ renderer-pytest-on-merge-request:
    - make clean
    - make -j IVAS_rend

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

    # run test
    - exit_code=0
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_be_comparison.py || exit_code=$?
@@ -605,8 +605,7 @@ split-rendering-pytest-on-merge-request:
    # write to temporary file as workaround for failures observed with piping echo
    - echo $CI_MERGE_REQUEST_TITLE > tmp.txt
    - non_be_flag=$(grep -c --ignore-case "\[split*[ -]*non[ -]*be\]" tmp.txt) || true
    # TODO: needs splitting the test between reference and cut generation
    #- ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true
    - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true

    # store the current commit hash
    - source_branch_commit_sha=$(git rev-parse HEAD)
@@ -629,6 +628,9 @@ split-rendering-pytest-on-merge-request:
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1

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

    # run test
    - exit_code=0
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering_be_comparison.py || exit_code=$?
@@ -807,7 +809,7 @@ clang-format-check:
      - tmp-formatting-fix/
    when: on_failure
    name: "$ARTIFACT_BASE_NAME"
    expose_as: 'formatting patch'
    expose_as: "formatting patch"

# check for crashes if first received frame on decoder side is an SID
check-first-frame-is-sid:
@@ -898,7 +900,6 @@ lc3plus-ensure-no-code-changes:
    - modified_files=$(git status -s)
    - if [[ $modified_files ]]; then printf 'LC3plus codebase was modified!\n\n'"$modified_files"'\n\n'; exit $EXIT_CODE_FAIL; fi


# ---------------------------------------------------------------
# Test jobs for main branch
# ---------------------------------------------------------------
@@ -1062,7 +1063,6 @@ codec-comparison-on-main-push:
  extends:
    - .sanitizer-test-template


sanitizer-test-mono:
  extends: .sanitizer-test-schedule-A
  rules:
@@ -1277,7 +1277,6 @@ sanitizer-test-ism+4:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM+4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS


# GCOV/LCOV coverage analysis of self_test suite
coverage-test-on-main-scheduled:
  extends:
@@ -1312,13 +1311,12 @@ coverage-test-on-main-scheduled:
      - coverage.info
      - coverage


# ---------------------------------------------------------------
# Complexity measurement jobs
# ---------------------------------------------------------------

.complexity-measurements-setup: &complexity-measurements-setup
  # create necessary environment
.complexity-measurements-setup:
  &complexity-measurements-setup # create necessary environment
  - mkdir -p wmops/logs

  - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_COMMIT_REF_NAME $CI_JOB_NAME)
@@ -1333,8 +1331,8 @@ coverage-test-on-main-scheduled:
  - rm artifacts.zip
  - rm -rf $public_dir

.complexity-measurements-prepare-artifacts: &complexity-measurements-prepare-artifacts
  # prepare artifacts -> move to public directory
.complexity-measurements-prepare-artifacts:
  &complexity-measurements-prepare-artifacts # prepare artifacts -> move to public directory
  - public_dir="$CI_JOB_NAME-public"
  - mkdir $public_dir
  - mv -f wmops/log_*_all.txt wmops/*.js ${public_dir}/
+1090 −106

File changed.

Preview size limit exceeded, changes collapsed.

+211 −50
Original line number Diff line number Diff line
@@ -777,7 +777,12 @@ 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();
@@ -996,7 +1001,13 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    }
#endif
    const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 );
    const int16_t frameSize_smpls = (int16_t) (
#ifdef API_5MS
        ( args.framing_5ms ? 5 : 20 )
#else
        20
#endif
        * args.sampleRate / 1000 );

    IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 };
    IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 };
@@ -1006,7 +1017,12 @@ 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 ) ) != IVAS_ERR_OK )
    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 )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -1408,6 +1424,11 @@ int main(
    bitsBuffer.config.bitsRead = 0;
    bitsBuffer.config.bitsWritten = 0;
    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 ) );
@@ -1437,19 +1458,35 @@ 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 ) )
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args )
#ifdef API_5MS
             && splitBinNeedsNewFrame
#endif
        )
        {
            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 );
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection
#ifdef API_5MS
                                                        ,
                                                        &bitsBuffer.config.codec_frame_size_ms
#endif
            );
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1477,7 +1514,11 @@ int main(
        }
#endif

        if ( numSamplesRead == 0 )
        if ( numSamplesRead == 0
#ifdef API_5MS
             && splitBinNeedsNewFrame
#endif
        )
        {
            /* end of input data */
            break;
@@ -1491,7 +1532,19 @@ int main(
#endif
        );

        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 )
@@ -1511,23 +1564,56 @@ int main(
            /* Read from reference rotation trajectory file if specified */
            if ( referenceRotReader != NULL )
            {
            IVAS_QUATERNION quaternion;
            if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK )
                for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
                {
                    IVAS_QUATERNION quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
                    if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternions[sf_idx], NULL ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }

            if ( ( error = IVAS_REND_SetReferenceRotation( hIvasRend, quaternion ) ) != IVAS_ERR_OK )
                    if ( ( error = IVAS_REND_SetReferenceRotation( hIvasRend, quaternions[sf_idx] ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error setting Reference Rotation: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }
                }
            }
#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;
                IVAS_VECTOR3 Pos;

                if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != 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, headRot, Pos
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                          ,
                                                          DEFAULT_AXIS
#endif
#ifdef API_5MS
                                                          ,
                                                          sf_idx
#endif
                                                          ) ) != 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++ )
@@ -1549,9 +1635,17 @@ int main(
                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
                                               ,
@@ -1563,11 +1657,16 @@ int main(
                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 )
        if ( splitRendBFIReader != NULL
#ifdef API_5MS
             && splitBinNeedsNewFrame
#endif
        )
        {
            int16_t bfi;
            SplitRendBFIFileReading( splitRendBFIReader, &bfi );
@@ -1578,13 +1677,16 @@ int main(
        /* Read from external orientation file if specified */
        if ( externalOrientationFileReader != NULL )
        {
            IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME];
            int8_t enableHeadRotation[RENDERER_HEAD_POSITIONS_PER_FRAME];
            int8_t enableExternalOrientation[RENDERER_HEAD_POSITIONS_PER_FRAME];
            IVAS_QUATERNION quatBuffer[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
            int8_t enableHeadRotation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES];
            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 )
                {
@@ -1592,12 +1694,27 @@ 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 )
                {
                    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 */
@@ -1711,6 +1828,10 @@ 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 ) );
@@ -1723,13 +1844,45 @@ int main(
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                }

                if ( ( error = IVAS_REND_FeedSplitBinauralBitstream( hIvasRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK )
                {
                    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 ( args.inConfig.numBinBuses != 0 )
        {
            if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
        }
        else if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
                  args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            if ( ( error = IVAS_REND_GetSplitBinauralBitstream( hIvasRend, outBuffer, &bitsBuffer ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
        }
        else
        {
#endif
            if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer
#ifndef API_5MS
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                 ,
                                                 &bitsBuffer
#endif
#endif
                                                 ) ) != IVAS_ERR_OK )
            {
@@ -1740,6 +1893,9 @@ int main(
#endif
                exit( -1 );
            }
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
        }
#endif

        int16_t num_out_channels;
        num_out_channels = outBuffer.config.numChannels;
@@ -1788,7 +1944,12 @@ 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 ) != IVAS_ERR_OK )
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection
#ifdef API_5MS
                                                     ,
                                                     bitsBuffer.config.codec_frame_size_ms
#endif
                                                     ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
@@ -1929,6 +2090,7 @@ int main(
    }
#endif


    if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
    {
        fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / IVAS_NUM_FRAMES_PER_SEC / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) );
@@ -2695,7 +2857,6 @@ static void parseOption(
                args->directivityPatternId[i] = (int16_t) strtol( optionValues[i], NULL, 10 );
            }
            break;

        case CmdLnOptionId_acousticEnvironmentId:
            assert( numOptionValues == 1 );
            args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
+20 −14
Original line number Diff line number Diff line
@@ -42,19 +42,24 @@ def run_condition(eval_cmd, diff_cmd, id_count):
    cmd = subprocess.run(eval_cmd.split(), capture_output=True, text=True, check=True)

    # diff
    diff_success = 1
    diff_fails = ''
    if ';' in diff_cmd:
        # JBM cases
        diff_cmd1, diff_cmd2 = diff_cmd.split(';')
        cmd1 = subprocess.run(diff_cmd1.split(), capture_output=True, text=True, check=True)
        cmd2 = subprocess.run(diff_cmd2.split(), capture_output=True, text=True, check=True)
        diff_success = cmd1.returncode + cmd2.returncode
        cmd1 = subprocess.run(diff_cmd1.split(), stdout=subprocess.DEVNULL, check=False)
        cmd2 = subprocess.run(diff_cmd2.split(), stdout=subprocess.DEVNULL, check=False)
        if cmd1.returncode != 0:
            diff_fails += f'{diff_cmd1}\n'
        if cmd2.returncode != 0:
            diff_fails += f'{diff_cmd2}\n'
    else:
        cmd = subprocess.run(diff_cmd.split(), capture_output=True, text=True, check=True)
        diff_success = cmd.returncode
    if diff_success == 0:
        return None
        cmd = subprocess.run(diff_cmd.split(), stdout=subprocess.DEVNULL, check=False)
        if cmd.returncode != 0:
            diff_fails += f'{diff_cmd}\n'
    if diff_fails:
        return diff_fails
    else:
        return f'[{str(id_count).rjust(3)}] FAIL: {" ".join(eval_cmd)}\n            {diff_cmd}\n'
        return None


def environment_is_correct(paths):
@@ -116,6 +121,7 @@ if __name__ == '__main__':
                    if os.path.exists(tmp_dir):
                        shutil.rmtree(tmp_dir)
                    os.makedirs(tmp_dir)
                line = line.replace('testv', f'{test_vec_dir}/testv')
                line = line if tmp_dir is None else line.replace(
                    '$TMP/', f'{tmp_dir}/')
                if '$CUT_DEC_BIN' in line:
@@ -138,11 +144,11 @@ if __name__ == '__main__':

    results = [r.get() for r in results if r.get()]
    if results:
        print(f'\n{len(results)} test conditions failed:')
        print('\n'.join(results))
        print(f'\n --- {len(results)} test conditions failed ---')
        print(''.join(results))
        with open('failed.txt', 'w') as f:
            print(f'\n{len(results)} test conditions failed:', file=f)
            print('\n'.join(results), file=f)
            print(f' --- {len(results)} test conditions failed ---', file=f)
            print(''.join(results), file=f)
        sys.exit(1)
    else:
        print('\n *** All tests passed! ***')
Loading