Commit 84f71421 authored by premathasara's avatar premathasara
Browse files

Merge remote-tracking branch 'origin/main' into 114-bitrate-switching-in-sba-2

parents 35faa106 d76dee82
Loading
Loading
Loading
Loading
Loading
+60 −21
Original line number Diff line number Diff line
variables:
  TESTV_DIR: "/usr/local/testv"
  LTV_DIR: "/usr/local/ltv"
  BUILD_OUTPUT: "build_output.txt"
  EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"
  SANITIZER_TESTS: "CLANG1 CLANG2"
@@ -82,15 +83,17 @@ stages:
  - mv IVAS_cod_test IVAS_cod
  - mv IVAS_dec_test IVAS_dec

  ### re-checkout the commit from the source branch to have up-to-date self_test.py and scripts/testv (and actually everything)
  - git checkout $source_branch_commit_sha

.merge-request-comparison-check: &merge-request-comparison-check
    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact  cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
    - exit 0

.update-ltv-repo: &update-ltv-repo
  - cd $LTV_DIR
  - git pull
  - cd -

# ---------------------------------------------------------------
# Job templates
# ---------------------------------------------------------------
@@ -334,6 +337,10 @@ ivas-pytest-on-merge-request:

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
    # create short test vectors
@@ -342,6 +349,9 @@ ivas-pytest-on-merge-request:
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

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

    ### run pytest
    - exit_code=0
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
@@ -375,11 +385,18 @@ evs-pytest-on-merge-request:
    
    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[evs[ -]*non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
    # create references
    - python3 -m pytest tests/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm

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

    ### run pytest for EVS cases
    - exit_code=0
    - python3 -m pytest tests/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --junit-xml=report-junit-evs.xml || exit_code=$?
@@ -472,11 +489,12 @@ codec-comparison-on-main-push:
    - mv IVAS_dec ../IVAS_dec_ref
    - cd ..

    ### re-checkout the latest commit in the main branch
    - git checkout $latest_commit

    # helper variable - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### re-checkout the latest commit in the main branch, if ref_using_main is not set
    - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi

    ### prepare pytest
    # create short test vectors
@@ -488,6 +506,9 @@ codec-comparison-on-main-push:
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

    ### re-checkout the latest commit here, if ref_using_main is set
    - if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi

    ### run pytest
    - exit_code=0
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
@@ -513,10 +534,13 @@ codec-comparison-on-main-push:
# ---------------------------------------------------------------
.sanitizer-test-template:
  extends:
    # TODO: still needed since MASA ltv vectors are not there yet
    #       when they were added, we can add a needs-ltv-dir template
    - .test-job-linux-needs-testv-dir
  stage: test
  tags:
    - sanitizer_test_main
  timeout: "2 hours"
  artifacts:
    name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
    when: always
@@ -530,6 +554,7 @@ sanitizer-test-mono:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py mono mono --tests $SANITIZER_TESTS

sanitizer-test-stereo:
@@ -537,8 +562,9 @@ sanitizer-test-stereo:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 20 minutes
      start_in: 1 hour
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py stereo $OUT_FORMATS_CHANNEL_BASED --tests $SANITIZER_TESTS

sanitizer-test-stereodmxevs:
@@ -546,8 +572,9 @@ sanitizer-test-stereodmxevs:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 40 minutes
      start_in: 2 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py StereoDmxEvs mono --tests $SANITIZER_TESTS

sanitizer-test-ism1:
@@ -555,8 +582,9 @@ sanitizer-test-ism1:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 1 hour
      start_in: 3 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-ism2:
@@ -564,8 +592,9 @@ sanitizer-test-ism2:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 1 hour 30 minutes
      start_in: 4 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-ism3:
@@ -573,8 +602,9 @@ sanitizer-test-ism3:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 2 hours
      start_in: 6 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-ism4:
@@ -582,8 +612,9 @@ sanitizer-test-ism4:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 2 hours 30 minutes
      start_in: 8 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1:
@@ -591,8 +622,9 @@ sanitizer-test-mc-5_1:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 3 hours
      start_in: 10 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1_2:
@@ -600,8 +632,9 @@ sanitizer-test-mc-5_1_2:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 4 hours
      start_in: 12 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1_2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1_4:
@@ -609,8 +642,9 @@ sanitizer-test-mc-5_1_4:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 5 hours
      start_in: 14 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-7_1:
@@ -618,8 +652,9 @@ sanitizer-test-mc-7_1:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 6 hours
      start_in: 16 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 7_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-7_1_4:
@@ -627,8 +662,9 @@ sanitizer-test-mc-7_1_4:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 7 hours
      start_in: 18 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 7_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-masa:
@@ -636,8 +672,9 @@ sanitizer-test-masa:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 8 hours
      start_in: 20 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py MASA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

sanitizer-test-sba:
@@ -645,8 +682,9 @@ sanitizer-test-sba:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 9 hours
      start_in: 22 hours
  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

sanitizer-test-planarsba:
@@ -654,8 +692,9 @@ sanitizer-test-planarsba:
  rules:
    - if: $IS_SANITIZER_TEST_RUN
      when: delayed
      start_in: 10 hours
      start_in: 24 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

# GCOV/LCOV coverage analysis of self_test suite
+28 −6
Original line number Diff line number Diff line
@@ -120,11 +120,13 @@ typedef struct
    const char *ca_config_file;
    bool mimeOutput;

#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
#ifdef AGC_ENABLE_FOR_LBR
    IVAS_ENC_AGC agc;
#else
    bool agc;
#endif
#endif /* AGC_ENABLE_FOR_LBR */
#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */
    bool pca;
#ifdef DEBUG_FOA_AGC
    FILE *agcBitstream; /* temporary */
@@ -444,11 +446,25 @@ int main(
            }
            break;
        case IVAS_ENC_INPUT_SBA:
            if ( ( error =
                       IVAS_ENC_ConfigureForAmbisonics(
                           hIvasEnc,
                           arg.inputFs,
                           totalBitrate,
                           arg.max_bwidth_user,
                           bandwidth,
                           arg.dtxConfig,
                           arg.inputFormatConfig.sba.order,
                           arg.inputFormatConfig.sba.isPlanar,
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
                           arg.agc,
#endif
                           arg.pca
#ifdef DEBUG_SBA_AUDIO_DUMP
            if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.agc, arg.pca, &numTransportChannels ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.agc, arg.pca ) ) != IVAS_ERR_OK )
                           ,
                           &numTransportChannels
#endif
                           ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
@@ -874,11 +890,13 @@ static void initArgStruct( EncArguments *arg )
    arg->ca_config_file = NULL;
    arg->mimeOutput = false;

#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
#ifdef AGC_ENABLE_FOR_LBR
    arg->agc = IVAS_ENC_AGC_UNDEFINED;
#else
    arg->agc = IVAS_DEFAULT_AGC;
#endif
#endif /* AGC_ENABLE_FOR_LBR */
#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */
    arg->pca = false;
#ifdef DEBUG_FOA_AGC
    arg->agcBitstream = NULL;
@@ -1384,6 +1402,7 @@ static bool parseCmdlIVAS_enc(
            arg->inputFormatConfig.stereoToMonoDownmix = true;
            i++;
        }
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
        else if ( strcmp( argv_to_upper, "-AGC" ) == 0 )
        {
            i++;
@@ -1409,6 +1428,7 @@ static bool parseCmdlIVAS_enc(
                return false;
            }
        }
#endif
        else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // VE: should be renamed to "-pca"
        {
            i++;
@@ -1648,13 +1668,15 @@ static void usage_enc( void )
#ifdef DEBUG_SBA
    fprintf( stdout, "-tag                : Tag name for intermediate debug files\n" );
#endif
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
#ifdef AGC_ENABLE_FOR_LBR
    fprintf( stdout, "-agc op             : SBA Adaptive gain control, op = (0, 1).  \n" );
    fprintf( stdout, "                      By default op is 1 (activated) for bitrates between 24400 and 32000,\n" );
    fprintf( stdout, "                      otherwise it is 0 (deactivated) for all other bitrates\n" );
#else
    fprintf( stdout, "-agc op             : SBA Adaptive gain control, op = (0, 1), by default op is 0 or deactivated\n" );
#endif
#endif /* AGC_ENABLE_FOR_LBR */
#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */

    fprintf( stdout, "-bypass mode        : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" );
#ifdef DEBUGGING
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ import pathlib


DURATION = "120"
CFG = "ci_linux.json"
CFG = "ci_linux_ltv.json"
SUPPORTED_TESTS = ["CLANG1", "CLANG2", "CLANG3", "VALGRIND"]
EP_FILE = "ep_015.g192"
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {int(DURATION) * 50} {EP_FILE}"
+3 −0
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ enum{

#define MAX_V_MULT_MAT                  100             /* maximum array length for the function v_mult_mat() */

#define SBA_AGC_FORCE_ENABLE            1
#define SBA_AGC_FORCE_DISABLE           0
#define SBA_AGC_DEFAULT                 -1

/*----------------------------------------------------------------------------------*
 * Layers
+0 −8
Original line number Diff line number Diff line
@@ -90,18 +90,10 @@ void fill_spectrum(
    const int16_t element_mode         /* i  : element mode                                          */
)
{
#ifdef FIX_I178_HQ_BUFFER_OVERRUN
    float CodeBook[L_SPEC48k_EXT];
#else
    float CodeBook[FREQ_LENGTH];
#endif
    int16_t cb_size = 0;
    int16_t last_sfm;
#ifdef FIX_I178_HQ_BUFFER_OVERRUN
    float CodeBook_mod[L_SPEC48k_EXT];
#else
    float CodeBook_mod[FREQ_LENGTH];
#endif
    float norm_adj[NB_SFM];
    int16_t high_sfm = 23;
    int16_t flag_32K_env_hangover;
Loading