Commit 8e1e7c23 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ivas-float-update' into ivas-float-update-cmplx

parents b95930ca b41d89f8
Loading
Loading
Loading
Loading
+88 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ variables:
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv"
  LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  TEST_SUITE: ""
  DUT_ENCODER_PATH: "./IVAS_cod"
@@ -40,6 +41,8 @@ variables:
      - 'sanitizer-stv'
      - 'pytest-renderer'
      - 'complexity'
      - 'coverage'
      - 'voip-be-test'


default:
@@ -185,6 +188,15 @@ stages:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never

.rules-coverage:
  rules:
    - if: $COVERAGE_TEST # Set by scheduled pipeline
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "coverage"
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never

.rules-pytest-saturation-smoke-test:
  rules:
    - if: $PYTEST_SMOKE_TEST # Set by scheduled pipeline
@@ -607,7 +619,7 @@ build-codec-linux-make:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web'
    - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # trigger build job for all MRs
    - if: $CI_PIPELINE_SOURCE == 'schedule'
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
@@ -969,6 +981,60 @@ ivas-smoke-test-saturation:
      - smoke_test_output_hrtf.txt
    expose_as: "saturation smoke test results"


# GCOV/LCOV coverage analysis of self_test suite
coverage-test-on-main-scheduled:
  extends:
    - .test-job-linux
    - .rules-coverage
  stage: test
  timeout: 3 hours
  script:
    - *print-common-info
    - *update-scripts-repo    
    - *update-ltv-repo
    - *copy-ltv-files-to-testv-dir
    - *build-reference-binaries
    # Build DuT binaries with GCOV
    - make clean
    - make GCOV=1 -j
    - cp IVAS_rend IVAS_rend_ref # Copy to ensure instrumented renderer is run in the first pytest call

    - testcase_timeout=$TESTCASE_TIMEOUT_LTV
    - exit_code_dec=0
    - exit_code_enc=0
    - python3 -m pytest --tb=no tests/codec_be_on_mr_nonselection tests/renderer --update_ref 1 -v --create_ref --html=report-dec.html --self-contained-html --junit-xml=report-junit-dec.xml -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $DUT_DECODER_PATH  || exit_code_dec=$?
    - lcov -c -d obj -o coverage_dec_rend.info # extract coverage of decoder/renderer

    - python3 -m pytest --tb=no tests/codec_be_on_mr_nonselection --encoder_only -v  --html=report-enc.html --self-contained-html --junit-xml=report-junit-enc.xml -n auto --testcase_timeout $testcase_timeout --dut_encoder_path $DUT_ENCODER_PATH || exit_code_enc=$?
    - lcov -c -d obj -o coverage_enc_dec_rend.info # extract coverage of encoder/decoder/renderer

    # remove apps and lib_util files from coverage
    - lcov -r coverage_dec_rend.info "*apps*" -o coverage_dec_rend.info
    - lcov -r coverage_dec_rend.info "*lib_util*" -o coverage_dec_rend.info
    - lcov -r coverage_enc_dec_rend.info "*apps*" -o coverage_enc_dec_rend.info
    - lcov -r coverage_enc_dec_rend.info "*lib_util*" -o coverage_enc_dec_rend.info

    - commit_sha=$(git rev-parse HEAD)
    - genhtml coverage_enc_dec_rend.info -o coverage_enc_dec_rend -t "Coverage on main enc/dec/rend @ $commit_sha"
    - genhtml coverage_dec_rend.info -o coverage_dec_rend -t "Coverage on main -- dec/rend @ $commit_sha"
  artifacts:
    name: "main-coverage-sha-$CI_COMMIT_SHORT_SHA"
    when: always
    expire_in: 1 week
    paths:
      - coverage_enc_dec_rend.info
      - coverage_dec_rend.info
      - coverage_enc_dec_rend
      - coverage_dec_rend
      - report-dec.html
      - report-enc.html
    expose_as: "Coverage result"
    reports:
      junit:
        - report-junit-dec.xml
        - report-junit-enc.xml

# ---------------------------------------------------------------
# EVS 26.444 test job
# ---------------------------------------------------------------
@@ -1023,6 +1089,27 @@ ivas-pytest-renderer:
  <<: *ivas-pytest-anchor


# ---------------------------------------------------------------
# Various other tests
# ---------------------------------------------------------------

# TODO: actually run on MR once main problems are fixed
voip-be-on-merge-request:
  extends:
    - .test-job-linux-needs-testv-dir
  rules:
    # - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "voip-be-test"
  stage: test
  needs: ["build-codec-linux-make"]
  timeout: "10 minutes"
  script:
    - *print-common-info
    - make clean
    - make -j
    - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py


# ---------------------------------------------------------------
# Complexity measurement jobs
# ---------------------------------------------------------------
+5 −0
Original line number Diff line number Diff line
@@ -1257,7 +1257,12 @@ static void ivas_calc_mat_inv(
        int16_t sign = 1;

        ivas_calc_mat_det( dbl_in_re, dim, &det_re );

#ifdef NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3
        det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : 1 / min( det_re, -IVAS_DBL_EPS );
#else
        det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : min( det_re, -IVAS_DBL_EPS );
#endif

        for ( i = 0; i < dim; i++ )
        {
+4 −0
Original line number Diff line number Diff line
@@ -167,6 +167,10 @@
#define NONBE_FIX_943_PORT_1208_DFT_STEREO_PLC_BURST    /* Ericsson: BASOP Issue 943, Float Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */
#define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE   /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */
#define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP        /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */
#define NONBE_FIX_1205_TD_STEREO_MOD_CT                 /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */
#define NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3             /*Dolby: issue 1213: fix for inverse of det < 0*/
#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING    /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */

/* #################### End FIXES switches ############################ */

#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
+24 −0
Original line number Diff line number Diff line
@@ -620,24 +620,48 @@ static void run_min_stats(
               computed only once (for ch == 0) and not again in the second run sive the outcome will be the same anyway */
            if ( ( will_estimate_noise_on_channel[0] == will_estimate_noise_on_channel[1] ) || ch == 0 )
            {
#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING
                float power_spec_scale_fac;

                /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */
                power_spec_scale_fac = 1.f / (float) ( L_FRAME16k * L_FRAME16k );
                power_spec[0] = spec_in[0] * spec_in[0] * power_spec_scale_fac;
                power_spec[L_FRAME16k - 1] = spec_in[L_FRAME16k - 1] * spec_in[L_FRAME16k - 1] * power_spec_scale_fac;
#else
                /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */
                power_spec[0] = spec_in[0] * spec_in[0];
                power_spec[L_FRAME16k - 1] = spec_in[L_FRAME16k - 1] * spec_in[L_FRAME16k - 1];
#endif
                for ( int16_t i = 1; i < L_FRAME16k - 1; i++ )
                {
                    float mdst;
                    mdst = spec_in[i + 1] - spec_in[i - 1];
#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING
                    power_spec[i] = power_spec_scale_fac * ( spec_in[i] * spec_in[i] + mdst * mdst );
#else
                    power_spec[i] = spec_in[i] * spec_in[i] + mdst * mdst;
#endif
                }
            }
#ifndef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING

            noisy_speech_detection( st->hFdCngDec, st->VAD && st->m_frame_type == ACTIVE_FRAME, power_spec );

            st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = 0.99f * st->hFdCngDec->hFdCngCom->likelihood_noisy_speech + 0.01f * (float) st->hFdCngDec->hFdCngCom->flag_noisy_speech;

            st->lp_noise = st->hFdCngDec->lp_noise;
#endif
        }

#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING
        if ( st->core == TCX_20_CORE )
        {
            noisy_speech_detection( st->hFdCngDec, save_VAD[ch] && st->m_frame_type == ACTIVE_FRAME, x[ch][0] );
            st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = 0.99f * st->hFdCngDec->hFdCngCom->likelihood_noisy_speech + 0.01f * (float) st->hFdCngDec->hFdCngCom->flag_noisy_speech;
            st->lp_noise = st->hFdCngDec->lp_noise;
        }
#endif

        if ( will_estimate_noise_on_channel[0] || will_estimate_noise_on_channel[1] || st->bfi )
        {
            ApplyFdCng( NULL, st->bfi ? NULL : power_spec, NULL, NULL, st, st->bfi, 0 );
+0 −1
Original line number Diff line number Diff line
@@ -251,7 +251,6 @@ void tdm_configure_dec(
    }

#ifdef DEBUG_MODE_TD
    dbgwrite( &mod_ct, 2, 1, 320, "res/mod_ct.dec" );
    dbgwrite( tdm_ratio_idx, 2, 1, 320, "res/tdm_ratio_idx.dec" );
    dbgwrite( &tdm_inst_ratio_idx, 2, 1, 320, "res/tdm_inst_ratio_idx.dec" );
    dbgwrite( &hStereoTD->tdm_lp_reuse_flag, 2, 1, 320, "res/tdm_lp_reuse_flag.dec" );
Loading