Commit 883b9ab6 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 747-ism-todos

parents cc5b3e93 031045d7
Loading
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -370,7 +370,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:
@@ -392,7 +392,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:
@@ -414,7 +414,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
@@ -841,13 +841,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:
@@ -1256,15 +1259,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
@@ -1272,7 +1275,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 ---

@@ -1457,7 +1460,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=$?
+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
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ fi
modes=('SBA_b128_wb_cbr' 'MC_7_1_b96_fb_cbr' 'ISM2_b48_fb_cbr')
output_formats=('STEREO' 'FOA' '7_1' 'HOA3')
limit_input_to_x_seconds=30
verbosity_cmd="-z console"

cfg=./scripts/config/ci_linux.json
dly_profile=./scripts/dly_error_profiles/dly_error_profile_0.dat
@@ -71,8 +72,8 @@ output_dir_default="out"
output_dir_voip="out_voip"

# Run the same modes in VoIP and non-VoIP mode with a neutral delay profile
./scripts/runIvasCodec.py -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt
./scripts/runIvasCodec.py -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$dly_profile" | tee -a voip_be_test_output.txt
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$dly_profile" | tee -a voip_be_test_output.txt

# Check if Python scripts above failed. They return status 0 even when running a mode fails, so we have to parse log file
if grep -iq failed voip_be_test_output.txt ; then
+2 −0
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
        DURATION,
        "-p",
        CFG,
        "-z",
        "console",
        "--checks",
        *tests,
        "-m",
Loading