Commit 27009501 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into...

Merge branch 'main' into Float-1134-BRIR-Level-differences-between-MC-rendering-to-stereo-and-binaural
parents 825df611 7c28d8bc
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -173,6 +173,8 @@
#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_2585_BIT_ALLOCATION_DIFF                    /* VA : issue 2585, bit allocation different behaviors between float and fixed-point for corner cases */
#define FIX_1134_BRIR_LEVEL_DIFFERENCE                /* FhG: fix for issue 1134, level difference between BRIR and HRIR filters in DFT stereo */ 
#define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI         /* Nokia: BASOP issue 2442: Aligns float with identical diffuse gain limitation to minimize diff */

/* ##################### End NON-BE switches ########################### */

/* ################## End MAINTENANCE switches ######################### */
+17 −1
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@
#define DIRAC_AVG_LENGTH_SYNTH_MS_FAST 10
#define DIRAC_ALPHA_MAX_FAST           0.12f
#define DIRECTION_SMOOTHNESS_ALPHA     0.01f
#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI
#define DIRAC_SMALL_DIFF_POW_LIM      65536.0f
#define DIRAC_SMALL_DIFF_POW_MAX_GAIN 2.0f
#endif


/*-------------------------------------------------------------------------
@@ -1250,6 +1254,9 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    float *alpha_synthesis_fast;
    int16_t alphaMaxBin;
    int16_t alphaMaxBinFast;
#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI
    float diff_gain_limit;
#endif

    push_wmops( "dirac_out_synth_sfr" );

@@ -1434,17 +1441,26 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
            /*diffuse*/
            *p_power_diff_smooth_prev = g1 * ( *p_power_smooth_diff++ ) + g2 * ( *p_power_diff_smooth_prev ) + EPSILON;
            *( p_cy_auto_diff_smooth_prev ) = g1 * ( *( p_cy_auto_diff_smooth++ ) ) + g2 * ( *( p_cy_auto_diff_smooth_prev ) );

#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI
            diff_gain_limit = *p_power_diff_smooth_prev < DIRAC_SMALL_DIFF_POW_LIM ? DIRAC_SMALL_DIFF_POW_MAX_GAIN : DIRAC_GAIN_LIMIT;
#endif
            *( p_gains_diff ) = sqrtf( *( p_cy_auto_diff_smooth_prev++ ) / ( *( p_power_diff_smooth_prev++ ) ) );

            if ( *( p_gains_diff ) < 0.f )
            {
                *( p_gains_diff ) = 0.f;
            }
#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI
            else if ( *( p_gains_diff ) > diff_gain_limit )
            {
                *( p_gains_diff ) = diff_gain_limit;
            }
#else
            else if ( *( p_gains_diff ) > DIRAC_GAIN_LIMIT )
            {
                *( p_gains_diff ) = DIRAC_GAIN_LIMIT;
            }
#endif
            p_gains_diff++;
        }

+8 −5
Original line number Diff line number Diff line
@@ -7,12 +7,13 @@ REPRODUCE_REGRESSION_SCRIPT_TMPL = """
#!/bin/bash -x

SCRIPTS_DIR=/usr/local/scripts
REF_DIR=/usr/local/scripts # float main should be the same as the scripts folder from now on. Note that the user needs write access to this folder, so it could be a local clone for reproducing test cases
REF_DIR=../ivas-codec # float main should be the same as the scripts folder from now on. Note that the user needs write access to this folder, so it could be a local clone for reproducing test cases
LTV_DIR=/usr/local/ltv

MIN_DATE={min_date}
MIN_SHA={min_sha}
LEVEL_SCALING={level_scaling}
MLD_PLAYBACK_LEVEL={mld_playback_level}
TESTCASE="{testcase}"

REF_ENC1={REF_ENC1}
@@ -25,8 +26,6 @@ REF_DEC2={REF_DEC2}
DUT_ENC2={DUT_ENC2}
DUT_DEC2={DUT_DEC2}

INV_LEVEL_SCALING=$(awk "BEGIN {{print 1.0 / $LEVEL_SCALING}}")

# Obtain reference executables from past reference
working_dir=$(pwd)
pushd $REF_DIR
@@ -82,7 +81,7 @@ tests/scale_pcm.py ./scripts/testv/ "$LEVEL_SCALING"
cp IVAS_rend_ref_1 IVAS_rend_ref
cp IVAS_rend_1 IVAS_rend
python3 -m pytest "$TESTCASE" -n 1 --update_ref 1 --create_ref --param_file scripts/config/self_test_ltv.prm --use_ltv --ref_encoder_path $REF_ENC1 --ref_decoder_path $REF_DEC1 
python3 -m pytest "$TESTCASE" -n 1                --create_cut --param_file scripts/config/self_test_ltv.prm --use_ltv --dut_encoder_path $DUT_ENC1 --dut_decoder_path $DUT_DEC1 --mld --ssnr --odg --scalefac $INV_LEVEL_SCALING --junit-xml=report1.xml --html=report1.html --self-contained-html
python3 -m pytest "$TESTCASE" -n 1                --create_cut --param_file scripts/config/self_test_ltv.prm --use_ltv --dut_encoder_path $DUT_ENC1 --dut_decoder_path $DUT_DEC1 --mld --ssnr --odg --mld-playback-level $MLD_PLAYBACK_LEVEL --junit-xml=report1.xml --html=report1.html --self-contained-html
python3 scripts/parse_xml_report.py report1.xml report1.csv

# Store results from first run
@@ -94,7 +93,7 @@ cp -r tests/renderer/cut tests1/renderer
cp IVAS_rend_ref_2 IVAS_rend_ref
cp IVAS_rend_2 IVAS_rend
python3 -m pytest "$TESTCASE" -n 1 --update_ref 1 --create_ref --param_file scripts/config/self_test_ltv.prm --use_ltv --ref_encoder_path $REF_ENC2 --ref_decoder_path $REF_DEC2
python3 -m pytest "$TESTCASE" -n 1                --create_cut --param_file scripts/config/self_test_ltv.prm --use_ltv --dut_encoder_path $DUT_ENC2 --dut_decoder_path $DUT_DEC2 --mld --ssnr --odg --scalefac $INV_LEVEL_SCALING --junit-xml=report2.xml --html=report2.html --self-contained-html
python3 -m pytest "$TESTCASE" -n 1                --create_cut --param_file scripts/config/self_test_ltv.prm --use_ltv --dut_encoder_path $DUT_ENC2 --dut_decoder_path $DUT_DEC2 --mld --ssnr --odg --mld-playback-level $MLD_PLAYBACK_LEVEL --junit-xml=report2.xml --html=report2.html --self-contained-html
python3 scripts/parse_xml_report.py report2.xml report2.csv

"""
@@ -106,10 +105,13 @@ def main(critical_list):
    for row_counter, row in critical.iterrows():
        # Find level
        level_scaling = 1.0
        mld_playback_level = 92.0
        if "lev+10" in row["job"]:
            level_scaling = 3.162
            mld_playback_level = 82.0
        if "lev-10" in row["job"]:
            level_scaling = 0.3162
            mld_playback_level = 102.0

        # Find executables setup
        REF_ENC1 = "IVAS_cod_ref_1"
@@ -132,6 +134,7 @@ def main(critical_list):
            min_date=row["min_date"],
            min_sha=row["min_sha"][1:],
            level_scaling=level_scaling,
            mld_playback_level=mld_playback_level,
            testcase=row["testcase"],
            REF_ENC1=REF_ENC1,
            REF_DEC1=REF_DEC1,