Commit a5cdbd87 authored by Manuel Jander's avatar Manuel Jander
Browse files

Merge remote-tracking branch 'origin' into...

Merge remote-tracking branch 'origin' into 867-wide-range-of-values-for-observed-for-reference_power-resulting-in-precision-loss-and-high-mlds-3
parents 63b5aab7 a43b5c15
Loading
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -396,8 +396,8 @@ stages:
    - fi
    - *build-and-create-float-ref-outputs

    - comp_args="--mld --ssnr --odg"

    - INV_LEVEL_SCALING=$(awk "BEGIN {print 1.0 / $LEVEL_SCALING}")
    - comp_args="--mld --ssnr --odg --scalefac $INV_LEVEL_SCALING"
    - summary_args="MLD DIFF SSNR ODG"
    - REPORT_ARG=""
    - if [ "$ENCODER_TEST" = "true" ]; then comp_args="${comp_args} --enc_stats"; fi
@@ -517,7 +517,7 @@ stages:

    - exit_code=0
    - rm -rf .pytest_cache || true
    - python3 -m pytest --tb=no -q $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT --self-contained-html --junit-xml=$XML_REPORT --mld --ssnr --odg --ref_encoder_path $MERGE_TARGET_ENCODER_PATH --ref_decoder_path $MERGE_TARGET_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout > pytest_log.txt || exit_code=$?
    - python3 -m pytest --tb=no -q $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT --self-contained-html --junit-xml=$XML_REPORT --ref_encoder_path $MERGE_TARGET_ENCODER_PATH --ref_decoder_path $MERGE_TARGET_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout > pytest_log.txt || exit_code=$?

    - if [ $exit_code -ne 0 ]; then
    -   exit_code=$EXIT_CODE_NON_BE
@@ -636,13 +636,16 @@ stages:
    - echo $CI_MERGE_REQUEST_TITLE > tmp.txt
    - allow_regressions_flag=$(grep -c --ignore-case "\[allow[ -]*regression\]" tmp.txt) || true

    - INV_LEVEL_SCALING=$(awk "BEGIN {print 1.0 / $LEVEL_SCALING}")
    - comp_args="--mld --ssnr --odg --scalefac $INV_LEVEL_SCALING"

    ### run branch first
    # this per default builds the branch and the reference and creates the reference outputs
    - *build-and-create-float-ref-outputs
    - *check-up-to-date-in-comparison-jobs
    # need to restore cache again
    - *overwrite-pytest-cache-with-artifact
    - python3 -m pytest --tb=no -q $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_BRANCH --self-contained-html --junit-xml=$XML_REPORT_BRANCH --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - python3 -m pytest --tb=no -q $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_BRANCH --self-contained-html --junit-xml=$XML_REPORT_BRANCH $comp_args --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - zero_errors_branch=$(cat $XML_REPORT_BRANCH | grep -c 'errors="0"') || true
    - python3 scripts/parse_xml_report.py $XML_REPORT_BRANCH $CSV_BRANCH

@@ -660,7 +663,7 @@ stages:
    - make -j
    # need to restore cache again
    - *overwrite-pytest-cache-with-artifact
    - python3 -m pytest --tb=no -q $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_MAIN --self-contained-html --junit-xml=$XML_REPORT_MAIN --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - python3 -m pytest --tb=no -q $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_MAIN --self-contained-html --junit-xml=$XML_REPORT_MAIN $comp_args --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - python3 scripts/parse_xml_report.py $XML_REPORT_MAIN $CSV_MAIN

    ### compare the two csv files for regressions
@@ -798,10 +801,13 @@ stages:
    - fi
    - *build-float-ref-and-dut-binaries

    - INV_LEVEL_SCALING=$(awk "BEGIN {print 1.0 / $LEVEL_SCALING}")
    - comp_args="--mld --ssnr --odg --scalefac $INV_LEVEL_SCALING"

    ### run pytest
    - exit_code=0
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report-ref.html --self-contained-html --junit-xml=report-junit-ref.xml --mld --ssnr --odg -n auto --testcase_timeout $testcase_timeout --dut_encoder_path $REF_ENCODER_PATH --dut_decoder_path $REF_DECODER_PATH  --compare_to_input || exit_code=$?
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report-dut.html --self-contained-html --junit-xml=report-junit-dut.xml --mld --ssnr --odg -n auto --testcase_timeout $testcase_timeout --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH  --compare_to_input || exit_code=$?
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report-ref.html --self-contained-html --junit-xml=report-junit-ref.xml $comp_args -n auto --testcase_timeout $testcase_timeout --dut_encoder_path $REF_ENCODER_PATH --dut_decoder_path $REF_DECODER_PATH  --compare_to_input || exit_code=$?
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report-dut.html --self-contained-html --junit-xml=report-junit-dut.xml $comp_args -n auto --testcase_timeout $testcase_timeout --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH  --compare_to_input || exit_code=$?
    - zero_errors_ref=$(cat report-junit-ref.xml | grep -c 'errors="0"') || true
    - zero_errors_dut=$(cat report-junit-dut.xml | grep -c 'errors="0"') || true
    - python3 scripts/parse_xml_report.py report-junit-ref.xml report-ref.csv
+9 −0
Original line number Diff line number Diff line
@@ -4984,6 +4984,15 @@ void ivas_dirac_dec_get_response_fx(
    const Word16 ambisonics_order,
    Word16 Q_out );

#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx
/*This is a derivate to ivas_dirac_dec_get_response_fx with fixed Q_out=29*/
void ivas_dirac_dec_get_response_fx_29(
    const Word16 azimuth,
    const Word16 elevation,
    Word32 *response_fx, /*Q_out=29*/
    const Word16 ambisonics_order );
#endif

void calculate_hodirac_sector_parameters_fx(
    DIRAC_ENC_HANDLE hDirAC,                                          /* i  : DirAC handle                                  */
    Word32 RealBuffer_fx[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i  : signal vector (L+1)^2 x N_bins, real part     */
+127 −0
Original line number Diff line number Diff line
@@ -7164,6 +7164,133 @@ void ivas_dirac_dec_get_response_fx(
    return;
}

#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx
/*This is a derivate to ivas_dirac_dec_get_response_fx with fixed Q_out=29*/
void ivas_dirac_dec_get_response_fx_29(
    const Word16 azimuth,
    const Word16 elevation,
    Word32 *response_fx, /*Q_out*/
    const Word16 ambisonics_order )
{
    Word16 index_azimuth, index_elevation;
    Word16 el, az;
    Word32 cos_1_fx, cos_2_fx, sin_1_fx, cos_az_fx[3];
    Word32 sin_az_fx[3];
    Word32 f_fx;
    Word32 c_fx_better;
    Word16 l, m;
    Word16 b, b1, b_2, b1_2;
    // Word16 Q_out = 29;

    index_azimuth = add( azimuth, 180 ) % 360;
    move16();
    index_elevation = add( elevation, 90 );

    Word32 e_fac = L_add( 0x7FFFFFFF, 0 );

    if ( GT_16( index_elevation, 90 ) )
    {
        e_fac = L_add( 0x80000000, 0 );
    }


    el = index_elevation;
    move16();

    if ( GT_16( index_elevation, 90 ) )
    {
        el = sub( 180, index_elevation );
    }

    az = index_azimuth;
    move16();

    if ( GT_16( index_azimuth, 180 ) )
    {
        az = sub( 360, index_azimuth );
    }

    f_fx = 1;
    move16();

    if ( GT_16( index_azimuth, 180 ) )
    {
        f_fx = -1;
    }

    cos_1_fx = L_shr( dirac_gains_trg_term_fx[az][0], 1 );  // q30
    cos_2_fx = L_shl( Mpy_32_32( cos_1_fx, cos_1_fx ), 1 ); // q30
    sin_1_fx = L_shr( dirac_gains_trg_term_fx[az][1], 1 );  // q30

    if ( EQ_32( f_fx, -1 ) )
    {
        sin_1_fx = L_negate( sin_1_fx ); // q30
    }
    cos_az_fx[0] = cos_1_fx; // q30
    move32();
    cos_az_fx[1] = L_shl( L_sub( cos_2_fx, ONE_IN_Q29 /*0.5 q30*/ ), 1 ); /*q30*/
    move32();
    cos_az_fx[2] = L_sub( L_shl( Mpy_32_32( cos_1_fx, cos_az_fx[1] ), 2 ), cos_az_fx[0] /* cos_az_fx[0] q30*/ ); /*q30*/
    move32();
    sin_az_fx[0] = sin_1_fx; /*q30*/
    move32();
    sin_az_fx[1] = L_shl( Mpy_32_32( sin_1_fx, cos_1_fx ), 2 ); /*q30*/
    move32();
    sin_az_fx[2] = L_shl( Mpy_32_32( sin_1_fx, L_sub( cos_2_fx, ONE_IN_Q28 /*1/4 q30*/ ) ), 3 ); /*q30*/
    move32();

    response_fx[0] = 0x20000000;
    move32();

    FOR( l = 1; l <= ambisonics_order; l++ )
    {
        Word16 a;
        b_2 = imult1616( l, l );
        b1_2 = add( b_2, shl( l, 1 ) );
        FOR( m = 0; m < l; m += 2 )
        {
            b = b_2 + m;
            a = dirac_gains_P_idx[b];

            c_fx_better = local_result_table[el][a]; // q30
            move32();
            response_fx[b] = Mpy_32_32( c_fx_better, sin_az_fx[l - m - 1] ); // Q_out
            move32();

            b1 = b1_2 - m;
            response_fx[b1] = Mpy_32_32( c_fx_better, cos_az_fx[l - m - 1] ); // Q_out
            move32();
        }

        FOR( m = 1; m < l; m += 2 )
        {
            b = b_2 + m;
            a = dirac_gains_P_idx[b];
            c_fx_better = local_result_table[el][a]; // q30
            move32();
            c_fx_better = Mpy_32_32( c_fx_better, e_fac );                   // q30
            response_fx[b] = Mpy_32_32( c_fx_better, sin_az_fx[l - m - 1] ); // Q_out
            move32();

            b1 = b1_2 - m;
            response_fx[b1] = Mpy_32_32( c_fx_better, cos_az_fx[l - m - 1] ); // Q_out
            move32();
        }

        b = add( b_2, l );
        a = dirac_gains_P_idx[b];
        c_fx_better = local_result_table_2[el][a]; // q30
        move32();
        if ( s_and( l, 0x01 ) )
        {
            c_fx_better = Mpy_32_32( c_fx_better, e_fac ); // q30
        }
        response_fx[b] = L_shl( c_fx_better, -1 ); // Q_out
        move32();
    }
    return;
}
#endif /*FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx*/
/*-----------------------------------------------------------------------------------------*
 * Function ivas_get_bits_to_encode
 *
+2 −1
Original line number Diff line number Diff line
@@ -69,5 +69,6 @@

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
//#define OPT_STEREO_32KBPS_V1                    /* Optimization made in stereo decoding path for 32kbps decoding */
#define FIX_867_CLDFB_NRG_SCALE
#define FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx                 /*FhG: WMOPS tuning, nonbe*/
#define FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot   /*FhG: WMOPS tuning, nonbe*/
#endif
+4 −0
Original line number Diff line number Diff line
@@ -399,6 +399,10 @@ static void find_enr_dft_ivas_fx(
    BinE_fx[STEREO_DFT_N_12k8_ENC / 2 - 1] = BinE_fx[STEREO_DFT_N_12k8_ENC / 2 - 2]; // // *q_Bin_E
    move32();

    Word16 norm = getScaleFactor32( BinE_fx, L_FFT );
    scale_sig32( BinE_fx, L_FFT, norm );
    *q_Bin_E = add( *q_Bin_E, norm );
    move16();
    L_lerp_fx( BinE_fx, Bin_E_fx, L_FFT / 2, STEREO_DFT_N_12k8_ENC / 2, q_Bin_E );

    MVR2R_WORD32( Bin_E_fx, ptE_fx, VOIC_BINS ); // *q_Bin_E
Loading