Commit b7965606 authored by BOHMRR's avatar BOHMRR
Browse files

Merge branch '42-add-sba-pytest-run-to-mr-pipeline' of...

Merge branch '42-add-sba-pytest-run-to-mr-pipeline' of forge.3gpp.org:ivas-codec-pc/ivas-codec into 42-add-sba-pytest-run-to-mr-pipeline
parents ad0203af d45d0fd5
Loading
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
@@ -144,18 +144,31 @@ self-test-on-merge-request:
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt

    ### analyse test output

    # 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
    - run_errors=$(cat test_output.txt | grep -c "test conditions had run errors") || true
    - bitexact=$(cat test_output.txt | grep -c "All [0-9]* tests are bitexact") || true
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1

    - selftest_exit_code=0

    # check for crashes during the test, if any happened, fail the test
    - if cat test_output.txt | grep -c "Run errors were encountered for the following conditions:"; then echo "Codec had run errors"; exit 1; fi
    # check for non bitexact output and fail test if the merge request does not have a non-BE tag
    - if ! cat test_output.txt | grep -c "All [0-9]* tests are bitexact" && ! echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]"; then echo "Non-bitexact cases without non-BE tag encountered"; exit 1; fi
    - if ! cat test_output.txt | grep -c "All [0-9]* tests are bitexact"; then echo "Non-bitexact cases with non-BE tag encountered"; exit 123; fi
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py"; exit $EXIT_CODE_FAIL; fi

    # check for non bitexact output and store exit code to also always run the SBA pytest
    - if [ $bitexact == 0 ] && [ $non_be_flag == 0 ] ; then echo "Non-bitexact cases without non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_FAIL; fi
    - if [ $bitexact == 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_NON_BE; fi

    ### run SBA pytest
    - exit_code=0
    - python3 ./scripts/ivas_pytests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - if [ $exit_code -eq 1 ] && ! echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]"; then echo "pytest run had failures and non-BE flag not present"; exit 1; fi
    - if [ $exit_code -eq 1 ]; then echo "pytest run had failures and non-BE flag present"; exit 123; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $exit_code; fi;
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ]; then echo "pytest run had failures and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi;
    # return exit code from selftest if everything went well with the pytest run
    - exit $selftest_exit_code
  allow_failure:
    exit_codes:
      - 123
+2 −0
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@

#define FIX_047_ERROR_ENABLING_AGC                      /* IVAS-047, Fix the error reporting when AGC is enabled*/

#define REFACTOR_REVERB_INIT_ADD_CFG_CHECKS             /* Simplify and improve reverb initialization + add range checks on config parameter values */ 

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+1377 −0

File changed.

Preview size limit exceeded, changes collapsed.

+6 −0
Original line number Diff line number Diff line
@@ -540,9 +540,15 @@ void ivas_reverb_calc_color_levels(
        const float alpha = -log__0_001 / t60[freq_idx];
        const float revPredNormEnergy = ( A0_square_est / ( 2.0f * alpha ) ) * output_Fs / ( 0.8776f * minDelayDiff + 26.7741f );

#ifndef REFACTOR_REVERB_INIT_ADD_CFG_CHECKS
        pTarget_color_L[freq_idx] = sqrtf( pAcoustic_dsr[freq_idx] * revEnergyFactor * pHrtf_avg_pwr_L[freq_idx] ) / sqrtf( revPredNormEnergy );

        pTarget_color_R[freq_idx] = sqrtf( pAcoustic_dsr[freq_idx] * revEnergyFactor * pHrtf_avg_pwr_R[freq_idx] ) / sqrtf( revPredNormEnergy );
#else /* REFACTOR_REVERB_INIT_ADD_CFG_CHECKS */
        pTarget_color_L[freq_idx] = sqrtf( pAcoustic_dsr[freq_idx] * revEnergyFactor * pHrtf_avg_pwr_L[freq_idx] ) / max( sqrtf( revPredNormEnergy ), EPS );

        pTarget_color_R[freq_idx] = sqrtf( pAcoustic_dsr[freq_idx] * revEnergyFactor * pHrtf_avg_pwr_R[freq_idx] ) / max( sqrtf( revPredNormEnergy ), EPS );
#endif /*  REFACTOR_REVERB_INIT_ADD_CFG_CHECKS */
    }

    /* Limiting the frequency response gradients
+12 −0
Original line number Diff line number Diff line
@@ -94,8 +94,12 @@ void ivas_reverb_prepare_cldfb_params(
    float avg_pwr_left[CLDFB_NO_CHANNELS_MAX];
    float avg_pwr_right[CLDFB_NO_CHANNELS_MAX];

#ifndef REFACTOR_REVERB_INIT_ADD_CFG_CHECKS
    float delay_diff;
    float ln_1e6_inverted;
#else /* REFACTOR_REVERB_INIT_ADD_CFG_CHECKS */
    float delay_diff, ln_1e6_inverted, exp_argument;
#endif /* REFACTOR_REVERB_INIT_ADD_CFG_CHECKS */
    const float dist = DEFAULT_SRC_DIST;
    const float dmx_gain_2 = 4.0f * EVS_PI * dist * dist / 0.001f;

@@ -111,8 +115,16 @@ void ivas_reverb_prepare_cldfb_params(
    ln_1e6_inverted = 1.0f / logf( 1e06f );
    for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ )
    {
#ifndef REFACTOR_REVERB_INIT_ADD_CFG_CHECKS
        const float tau = pOutput_t60[idx] * ln_1e6_inverted;
        pOutput_ene[idx] *= expf( delay_diff / tau );
#else /* REFACTOR_REVERB_INIT_ADD_CFG_CHECKS */
        exp_argument = delay_diff / ( pOutput_t60[idx] * ln_1e6_inverted );
        /* Limit exponent to approx +/-100 dB in case of incoherent value of delay_diff, to prevent overflow */
        exp_argument = min( exp_argument, 23.0f );
        exp_argument = max( exp_argument, -23.0f );
        pOutput_ene[idx] *= expf( exp_argument );
#endif /* REFACTOR_REVERB_INIT_ADD_CFG_CHECKS */
    }

    ivas_reverb_get_fastconv_hrtf_set_energies( renderer_config, use_brir, output_Fs, avg_pwr_left, avg_pwr_right );
Loading