Commit 1a0f6524 authored by Shikha Shetgeri's avatar Shikha Shetgeri
Browse files

Merge branch 'main' into 280-code-coverage-ivas_spar_md_enc-c

parents 629ff241 8f037b8c
Loading
Loading
Loading
Loading
Loading
+56 −9
Original line number Diff line number Diff line
@@ -7,9 +7,10 @@ variables:
  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"
  OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB"
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1
  PROCESSING_SCRIPTS_BIN_DIR: "/test-bin"

default:
  interruptible: true # Make all jobs by default interruptible
@@ -69,7 +70,9 @@ stages:
  # 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
  - python3 -m pytest ci/test_vectors_available.py

.merge-request-comparison-setup-codec:
  &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons
@@ -283,7 +286,7 @@ build-codec-sanitizers-linux:
build-codec-windows-cmake:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .rules-basis
    - .rules-main-push
  script:
    - *print-common-info-windows
    - $winoutdata = $null
@@ -296,7 +299,7 @@ build-codec-windows-cmake:
build-codec-windows-msbuild:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .rules-basis
    - .rules-main-push
  script:
    - *print-common-info-windows
    - $winoutdata = $null
@@ -660,30 +663,74 @@ clang-format-check:
    expose_as: 'formatting patch'

# check for crashes if first received frame on decoder side is an SID
.check-first-frame-is-sid:
check-first-frame-is-sid:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  tags:
    - ivas-linux
  stage: test
  needs: ["build-codec-linux-cmake"]
  # needs: ["build-codec-linux-cmake"]
  script:
    - *print-common-info
    - *update-ltv-repo
    - *check-for-testvectors
    - cmake .
    - make -j

    # TODO: for some MASA modes, we currently do not have testvectors that actually trigger DTX
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA)
    - echo $modes
    - scripts/runIvasCodec.py -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500
    # SBA is run separately to use shorter part of file
    - 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=$?
    - if [ $exit_code_no_sba != 0 || $exit_code_sba != 0]; then exit 1; fi
  artifacts:
    paths:
      - out/logs
    when: on_failure
    name: "$CI_JOB_NAME--$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--sidstart"
    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

# ---------------------------------------------------------------
# Test jobs for main branch
+20 −0
Original line number Diff line number Diff line
@@ -1580,7 +1580,11 @@ static ivas_error initOnFirstGoodFrame(

            /* Duplicate good first frame metadata to fill the beginning of stream. */
            MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL;
#ifdef FIX_470_MASA_JBM_EXT
            if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                return error;
@@ -1878,7 +1882,11 @@ static ivas_error decodeG192(
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef FIX_470_MASA_JBM_EXT
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
@@ -2426,7 +2434,11 @@ static ivas_error decodeVoIP(
                else if ( bsFormat == IVAS_DEC_BS_MASA )
                {
                    MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef FIX_470_MASA_JBM_EXT
                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
@@ -2838,7 +2850,11 @@ static ivas_error decodeVariableSpeed(
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef FIX_470_MASA_JBM_EXT
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
@@ -3008,7 +3024,11 @@ static ivas_error decodeVariableSpeed(
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef FIX_470_MASA_JBM_EXT
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
+19 −0
Original line number Diff line number Diff line
import pytest
import pathlib
import json
import itertools

TEST_CONFIG_DIR = pathlib.Path(__file__).parent.parent.joinpath("scripts/config")
TEST_CONFIGS = [f for f in TEST_CONFIG_DIR.iterdir() if f.name.startswith("ci_linux")]

def get_testvectors_from_config(config) -> list:
    with open(config) as f:
        cfg = json.load(f)
    return list(cfg["inpaths"].values())

TESTVECTORS = sorted(set(itertools.chain(*[get_testvectors_from_config(cfg) for cfg in TEST_CONFIGS])))

@pytest.mark.parametrize("testvector", TESTVECTORS)
def test_vectors_available(testvector):
    if not pathlib.Path(testvector).exists():
        raise FileNotFoundError(f"Testvector {testvector} can not be found")

lib_com/bitstream.c

100755 → 100644
+4 −329

File changed.File mode changed from 100755 to 100644.

Preview size limit exceeded, changes collapsed.

+0 −3
Original line number Diff line number Diff line
@@ -447,9 +447,6 @@ enum
    IND_STEREO_2ND_CODER_T,

    IND_UNUSED,
#ifndef IND_LIST_DYN
    MAX_NUM_INDICES = IND_UNUSED + 772 /* Total 2640 in line with MAX_BITS_METADATA */
#endif
};

/*----------------------------------------------------------------------------------*
Loading