Commit 05730cab authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch 'main' of forge.3gpp.org:ivas-codec-pc/ivas-codec into 1116-update-review-pytest-ini

parents 2c6c07ee 8704a7b9
Loading
Loading
Loading
Loading
Loading
+9 −67
Original line number Diff line number Diff line
@@ -174,11 +174,6 @@ stages:
  - git pull
  - Pop-Location

.enable-split-rendering: &enable-split-rendering
# automatically enable #define SPLIT_REND_WITH_HEAD_ROT in options.h, handling both /**/-comment and //-comment
  - 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

.disable-limiter: &disable-limiter
# automatically enable #define DISABLE_LIMITER in options.h, handling both /**/-comment and //-comment
  - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*DISABLE_LIMITER\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
@@ -460,30 +455,6 @@ build-codec-sanitizers-linux:
    - *activate-Werror-linux
    - bash ci/build_codec_sanitizers_linux.sh

build-codec-include-split-linux-make:
  extends:
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - make -j INCLUDE_SPLIT=1

build-codec-include-split-linux-cmake:
  extends:
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - mkdir build
    - cd build
    - cmake .. -DINCLUDE_SPLIT=1
    - cd ..
    - make -C build -j

build-codec-windows-cmake:
  extends:
    - .build-job-windows
@@ -494,19 +465,6 @@ build-codec-windows-cmake:
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j

build-codec-windows-include-split-cmake:
  extends:
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - *activate-WX-windows
    - get-content .\lib_com\options.h | %{$_ -replace "/\*#define[\s]*SPLIT_REND_WITH_HEAD_ROT[\s]*\*/", "#define SPLIT_REND_WITH_HEAD_ROT"} | set-content -Path ./options_patched.h
    - rm ./lib_com/options.h
    - mv ./options_patched.h ./lib_com/options.h
    - cmake -DINCLUDE_SPLIT=1 -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j

build-codec-windows-msbuild:
  extends:
    - .build-job-windows
@@ -792,8 +750,7 @@ split-rendering-smoke-test:
  needs: ["build-codec-linux-make"]
  stage: test
  script:
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1
    - make -j
    - testcase_timeout=10
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout
  artifacts:
@@ -814,7 +771,6 @@ lc3-wrapper-unit-test:
  needs: ["build-codec-linux-cmake"]
  stage: test
  script:
    - *enable-split-rendering
    - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test
@@ -848,8 +804,7 @@ split-rendering-pytest-on-merge-request:
    - echo "Building reference codec at commit $target_commit"

    # build reference binaries
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1
    - make -j
    - mv IVAS_cod IVAS_cod_ref
    - mv IVAS_dec IVAS_dec_ref
    - mv IVAS_rend IVAS_rend_ref
@@ -865,8 +820,7 @@ split-rendering-pytest-on-merge-request:
    - git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts
    - git checkout $source_branch_commit_sha
    - make clean
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1
    - make -j

    ### Run test using scripts and input from main
    - if [ $ref_using_main == 1 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts
@@ -1122,29 +1076,17 @@ check-first-frame-is-sid:
  script:
    - *print-common-info
    - *update-ltv-repo
    # Temporary fix to test only SID start config files in this job
    # this rm makes check-for-testvectors only check for the signals we actually need in this test
    - rm scripts/config/ci_linux_ltv.json scripts/config/ci_linux.json
    - *check-for-testvectors
    - cmake .
    - make -j

    - exit_code_no_sba=0
    - exit_code_hoa=0
    - exit_code_foa=0

    # run all modes and cut bitstream to start with an SID. Use stereo output to limit runtime, test is only about decoding
    - ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv"
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | 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 --oc stereo $ism_md_cmd --timeout 10 || 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 --oc stereo --timeout 10 || exit_code_hoa=$?
    - 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 --oc stereo timeout 10 || exit_code_foa=$?
    - bash ci/run-first-frame-is-sid-test.sh

    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi
  artifacts:
    paths:
      - out/logs
      - logs_enc
      - logs_dec_msan
      - logs_dec_asan
      - logs_dec_usan
    when: always
    name: "$CI_JOB_NAME--$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--sidstart"
    expose_as: "logs-sidstart"
+10 −185

File changed.

Preview size limit exceeded, changes collapsed.

+7 −44
Original line number Diff line number Diff line
@@ -32,17 +32,6 @@

#include "lib_isar_post_rend.h"

#ifndef SPLIT_REND_WITH_HEAD_ROT

int main( int argc, char **argv )
{
    (void) argc;
    (void) argv;
    ISAR_POST_REND_void_func();
    return 0;
}

#else

#include <assert.h>
#include <math.h>
@@ -733,13 +722,9 @@ int main(
    bitsBuffer.config.bufLenInBytes = 0;
    bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    bitsBuffer.config.codec_frame_size_ms = 5;
    bitsBuffer.config.isar_frame_size_ms = 20;
    bitsBuffer.config.lc3plusHighRes = 0;
#else
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
@@ -778,9 +763,7 @@ int main(
     * Open input files
     *------------------------------------------------------------------------------------------*/

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
    hSplitRendFileReadWrite = NULL;
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
@@ -789,14 +772,10 @@ int main(
                                        args.inMetadataFilePaths[0],
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.codec_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
@@ -817,14 +796,10 @@ int main(
                                        args.inputFilePath,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.codec_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
@@ -833,17 +808,11 @@ int main(
        audioReader = NULL;
    }

#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    if ( audioReader != NULL )
    {
        error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
    }
    else
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        if ( hSplitRendFileReadWrite == NULL )
#endif
    else if ( hSplitRendFileReadWrite == NULL )
    {
        inFileSampleRate = args.sampleRate;
    }
@@ -913,13 +882,9 @@ int main(
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
                                                              bitsBuffer.config.codec,
                                                              bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                              ,
                                                              bitsBuffer.config.codec_frame_size_ms,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes
#endif
                                                              ) ) != IVAS_ERR_OK )
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
@@ -1285,5 +1250,3 @@ int main(


#undef WMC_TOOL_SKIP

#endif /* SPLIT_REND_WITH_HEAD_ROT */
+2 −163

File changed.

Preview size limit exceeded, changes collapsed.

+56 −0
Original line number Diff line number Diff line
#! /usr/bin/bash

# build encoder without sanitizers for faster runtime
make clean
make -j IVAS_cod
mv IVAS_cod IVAS_cod_nosan

# run all modes and cut bitstream to start with an SID. Use mono output to limit runtime, test is only about decoding the first frame
modes_no_sba=$(scripts/runIvasCodec.py -l | grep dtx | grep -vE "FOA|HOA" )
modes_hoa=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
modes_foa=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")

# config vars
testcase_timeout=20
bitstream_cut_length=5
common_args="-z console -p scripts/config/ci_linux_sidstart_test.json -s --oc mono --timeout $testcase_timeout --bs_length $bitstream_cut_length"

# first encoder + MSAN decoder
# hack to use the encoder with no sanitizers
mkdir CLANG1
make clean
make IVAS_dec -j CLANG=1
cp IVAS_dec CLANG1/IVAS_dec
cp IVAS_cod_nosan CLANG1/IVAS_cod

exit_code_msan=0
echo "-------------- 1. Encoder + Msan decoder -------------- "
echo "-------------- 1.1 all DTX modes except SBA -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_sba -U 0:20 $common_args || exit_code_msan=$?
echo "-------------- 1.2 HOA2 + HOA3 DTX modes -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_hoa -U 70:80 $common_args || exit_code_msan=$?
echo "-------------- 1.3 FOA DTX modes -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_foa -U 75:110 $common_args || exit_code_msan=$?
# archive encoder logs separately
mkdir logs_enc logs_dec_msan
mv CLANG1/logs/*.enc.txt logs_enc/
mv CLANG1/logs/*.dec*.txt logs_dec_msan/

# ASAN and USAN can be done in one go and decoder only
# copy encoder output from CLANG1 dir
mkdir CLANG2 CLANG3
cp -r CLANG1/enc CLANG2/enc
cp -r CLANG1/enc CLANG3/enc

exit_code_asan_usan=0
echo "-------------- 2. Asan + Usan decoder -------------- "
echo "-------------- 2.1 all DTX modes except SBA -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_no_sba -U 0:20 $common_args || exit_code_asan_usan=$?
echo "-------------- 2.2 HOA2 + HOA3 DTX modes -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_hoa -U 70:80 $common_args || exit_code_asan_usan=$?
echo "-------------- 2.3 FOA DTX modes -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_foa -U 75:110 $common_args || exit_code_asan_usan=$?
mv CLANG2/logs logs_dec_asan
mv CLANG3/logs logs_dec_usan

if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles."; exit 1; fi
Loading