Commit 2de7f4cd authored by Fabian Bauer's avatar Fabian Bauer
Browse files

Merge branch 'main' into 1439-complexity-overhead-stereo-to-stereo-32kbps-fb-float-vs-basop-nonBE

parents 8fa203f8 4f234b04
Loading
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@ variables:
  FAILED_TESTCASES_LIST: "failed-testcases.txt"
  ERRORS_TESTCASES_LIST: "errors-testcases.txt"
  PYTEST_CACHE_ARTIFACT: "pytest_cache.zip"
  FLOAT_REF_COMMIT_FILE: "float-ref-git-sha"
  CUT_COMMIT_FILE: "CuT-git-sha"
  MERGE_TARGET_COMMIT_FILE: "merge-target-git-sha"
  FLOAT_REF_COMMIT_FILE: "float-ref-git-sha.txt"
  CUT_COMMIT_FILE: "CuT-git-sha.txt"
  MERGE_TARGET_COMMIT_FILE: "merge-target-git-sha.txt"
  MANUAL_PIPELINE_TYPE:
    description: "Type for the manual pipeline run. Use 'pytest-compare' to run comparison test against reference float codec."
    value: 'default'
@@ -171,7 +171,7 @@ stages:
  - git pull origin $FLOAT_REF_BRANCH
  - *activate-debug-mode-info-if-set
  - make clean
  - make -j
  - make -j >> /dev/null
  - mv ./IVAS_cod ./$REF_ENCODER_PATH_FOR_BUILD_DO_NOT_MODIFY
  - mv ./IVAS_dec ./$REF_DECODER_PATH_FOR_BUILD_DO_NOT_MODIFY
  - mv ./IVAS_rend ./IVAS_rend_ref
@@ -187,7 +187,7 @@ stages:
  - git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  - *activate-debug-mode-info-if-set
  - make clean
  - make -j
  - make -j >> /dev/null
  - mv ./IVAS_cod ./$MERGE_TARGET_ENCODER_PATH_FOR_BUILD_DO_NOT_MODIFY
  - mv ./IVAS_dec ./$MERGE_TARGET_DECODER_PATH_FOR_BUILD_DO_NOT_MODIFY
  - mv ./IVAS_rend ./IVAS_rend_merge_target
@@ -202,7 +202,7 @@ stages:
### build dut binaries
  - *activate-debug-mode-info-if-set
  - make clean
  - make -j
  - make -j >> /dev/null

.build-and-create-float-ref-outputs: &build-and-create-float-ref-outputs
  - *build-float-ref-and-dut-binaries
@@ -509,7 +509,7 @@ stages:
    - *build-float-ref-binaries
    - *build-merge-target-binaries
    - make clean
    - make -j
    - make -j >> /dev/null
    - *check-up-to-date-in-comparison-jobs

    - exit_code_target=0
@@ -660,7 +660,7 @@ stages:
    - git checkout $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - make clean
    - make -j
    - make -j >> /dev/null
    # 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 $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
@@ -759,7 +759,7 @@ stages:
    -   make_args="$make_args IGNORELIST=1"
    - fi
    - make clean
    - make -j $make_args
    - make -j $make_args >> /dev/null
    - testcase_timeout_arg="--testcase_timeout $TESTCASE_TIMEOUT_LTV_SANITIZERS"
    # disable per-testcase timeout for msan to evaluate what is going on that it takes so long
    - if [[ $CLANG_NUM = 1 ]]; then
@@ -1536,7 +1536,7 @@ coverage-test-on-main-scheduled:
    - *copy-ltv-files-to-testv-dir
    - *build-float-ref-binaries
    # Build DuT binaries with GCOV
    - make clean
    - make clean >> /dev/null
    - make GCOV=1 -j
    - cp IVAS_rend IVAS_rend_ref # Copy to ensure instrumented renderer is run in the first pytest call

@@ -1594,7 +1594,7 @@ be-2-evs-26444:
    - *print-common-info
    - *update-scripts-repo
    - sed -i".bak" "s/\(#define EVS_FLOAT\)/\/\/\1/" lib_com/options.h
    - make -j
    - make -j  >> /dev/null

    # copy over to never change the testvector dir
    - cp -r $EVS_BE_TEST_DIR_BASOP ./evs_be_test
@@ -1658,7 +1658,7 @@ voip-be-on-merge-request:
  script:
    - *print-common-info
    - make clean
    - make -j
    - make -j >> /dev/null
    - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py


+0 −143
Original line number Diff line number Diff line
@@ -7555,146 +7555,3 @@ void rfft_fx(

    return;
}

Word16 find_guarded_bits_fx( Word32 n )
{
    // return n <= 1 ? 0 : n <= 2 ? 1
    //   : n <= 4 ? 2
    //   : n <= 8 ? 3
    //   : n <= 16 ? 4
    //   : n <= 32 ? 5
    //   : n <= 64 ? 6
    //   : n <= 128 ? 7
    //   : n <= 256 ? 8
    //   : n <= 512 ? 9
    //   : n <= 1024 ? 10
    //   : n <= 2048 ? 11
    //   : n <= 4096 ? 12
    //   : n <= 8192 ? 13
    //   : n <= 16384 ? 14
    //   : 15;
    /*Word16 val = 0;
    move32();
    test();
    WHILE( GT_32( n, L_shl( 1, val ) ) && LT_32( val, 16 ) )
    {
        val = add( val, 1 );
    }*/
    IF( LE_32( n, 1 ) )
    {
        return 0;
    }
    ELSE
    {

        return sub( 31, norm_l( L_sub( n, 1 ) ) );
    }
}

Word16 L_norm_arr( const Word32 *arr, Word16 size )
{
    Word16 q = 31;
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        Word16 q_tst;

        q_tst = norm_l( arr[i] );
        if ( arr[i] != 0 )
        {
            q = s_min( q, q_tst );
        }
    }

    return q;
}

Word16 norm_arr( Word16 *arr, Word16 size )
{
    Word16 q = 15;
    Word16 exp = 0;
    move16();
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        if ( arr[i] != 0 )
        {
            exp = norm_s( arr[i] );
        }
        if ( arr[i] != 0 )
        {
            q = s_min( q, exp );
        }
    }
    return q;
}

Word16 W_norm_arr( Word64 *arr, Word16 size )
{
    Word16 q = 63;
    Word16 exp = 0;
    move16();
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        if ( arr[i] != 0 )
        {
            exp = W_norm( arr[i] );
        }
        if ( arr[i] != 0 )
        {
            q = s_min( q, exp );
        }
    }
    return q;
}

Word16 get_min_scalefactor( Word32 x, Word32 y )
{
    Word16 scf_y;
    Word16 scf = Q31;
    move16();

    test();
    if ( x == 0 && y == 0 )
    {
        scf = 0;
        move16();
    }

    if ( x != 0 )
    {
        scf = norm_l( x );
    }

    scf_y = norm_l( y );
    if ( y != 0 )
    {
        scf = s_min( scf_y, scf );
    }

    return scf;
}


Flag is_zero_arr( Word32 *arr, Word16 size )
{
    FOR( Word16 i = 0; i < size; i++ )
    IF( arr[i] != 0 )
    {
        return 0;
    }

    return 1;
}

Flag is_zero_arr16( Word16 *arr, Word16 size )
{
    FOR( Word16 i = 0; i < size; i++ )
    IF( arr[i] != 0 )
    {
        return 0;
    }

    return 1;
}
+13 −0
Original line number Diff line number Diff line
@@ -1444,6 +1444,13 @@ void scale_sig32(
    const Word16 lg,  /* i  : size of x[]                     Q0        */
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx xx exp  */
);
void Scale_sig64(
    Word64 x[], /* i/o: signal to scale                 Qx        */
    Word16 len, /* i  : size of x[]                     Q0        */
    Word16 exp  /* i  : exponent: x = round(x << exp)   Qx  exp   */
);
void scale_sig32_r(
    Word32 x[],       /* i/o: signal to scale                 Qx        */
    const Word16 lg,  /* i  : size of x[]                     Q0        */
@@ -10865,8 +10872,11 @@ void ProcessStereoIGF_fx(
    Word16 q_pITFMDCTSpectrum_1,
    Word16 q_pITFMDCTSpectrum_2,
    Word32 *pPowerSpectrum_fx[CPE_CHANNELS],              /* i/o: MDCT^2 + MDST^2 spectrum, or estimate   */
    Word16 exp_pPowerSpectrum_fx[CPE_CHANNELS],           /* i/o: exp of pPowerSpectrum_fx                */
    Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i  : inverse power spectrum                  */
    Word16 exp_pPowerSpectrumMsInv_fx[CPE_CHANNELS],      /* i/o: exp of pPowerSpectrumMsInv_fx           */
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV],        /* i  : inverse spectrum                        */
    Word16 exp_inv_spectrum_fx[CPE_CHANNELS],             /* i/o: exp of inv_spectrum_fx                  */
    const Word16 frameno,                                 /* i  : flag indicating index of current subfr. */
    const Word16 sp_aud_decision0,                        /* i  : sp_aud_decision0                        */
    const Word32 element_brate,                           /* i  : element bitrate                         */
@@ -10879,8 +10889,11 @@ void IGFEncApplyStereo_fx(
    const Word16 igfGridIdx,                              /* i  : IGF grid index                          */
    Encoder_State *sts[CPE_CHANNELS],                     /* i  : Encoder state                           */
    Word32 *pPowerSpectrum_fx[CPE_CHANNELS],              /* i/o: MDCT^2 + MDST^2 spectrum, or estimate   */
    Word16 exp_pPowerSpectrum_fx[CPE_CHANNELS],           /* i/o: exp of pPowerSpectrum_fx                */
    Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i/o: inverse power spectrum                  */
    Word16 exp_pPowerSpectrumMsInv_fx[CPE_CHANNELS],      /* i/o: exp of pPowerSpectrumMsInv_fx           */
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV],        /* i  : inverse spectrum                        */
    Word16 exp_inv_spectrum_fx[CPE_CHANNELS],             /* i  : exp of inverse spectrum                 */
    const Word16 frameno,                                 /* i  : flag indicating index of current subfr. */
    const Word16 sp_aud_decision0,                        /* i  : sp_aud_decision0                        */
    const Word32 element_brate,                           /* i  : element bitrate                         */
+166 −2
Original line number Diff line number Diff line
@@ -3603,8 +3603,8 @@ Word16 erb_diff_search_fx( Word16 *prev_erb, const Word16 *curr_erb, Word16 *dif
            }
            ELSE
            {
                dh = sub( dif_erb[i + offset], cb_fx[j * cb_dim + i] ); /* Q13 */
                Ltemp1 = L_mult( dh, dh );                              /* Q27 */
                dh = sub_sat( dif_erb[i + offset], cb_fx[j * cb_dim + i] ); /* Q13 */
                Ltemp1 = L_mult_sat( dh, dh );                              /* Q27 */
                dh = extract_h( Ltemp1 );
                dl = extract_l( Ltemp1 );

@@ -4550,3 +4550,167 @@ void v_add_fixed_me(

    return;
}

Word16 find_guarded_bits_fx( Word32 n )
{
    // return n <= 1 ? 0 : n <= 2 ? 1
    //   : n <= 4 ? 2
    //   : n <= 8 ? 3
    //   : n <= 16 ? 4
    //   : n <= 32 ? 5
    //   : n <= 64 ? 6
    //   : n <= 128 ? 7
    //   : n <= 256 ? 8
    //   : n <= 512 ? 9
    //   : n <= 1024 ? 10
    //   : n <= 2048 ? 11
    //   : n <= 4096 ? 12
    //   : n <= 8192 ? 13
    //   : n <= 16384 ? 14
    //   : 15;
    /*Word16 val = 0;
    move32();
    test();
    WHILE( GT_32( n, L_shl( 1, val ) ) && LT_32( val, 16 ) )
    {
        val = add( val, 1 );
    }*/
    IF( LE_32( n, 1 ) )
    {
        return 0;
    }
    ELSE
    {

        return sub( 31, norm_l( L_sub( n, 1 ) ) );
    }
}

Word16 L_norm_arr( const Word32 *arr, Word16 size )
{
    Word16 q = 31;
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        Word16 q_tst;

        q_tst = norm_l( arr[i] );
        if ( arr[i] != 0 )
        {
            q = s_min( q, q_tst );
        }
    }

    return q;
}

Word16 norm_arr( Word16 *arr, Word16 size )
{
    Word16 q = 15;
    Word16 exp = 0;
    move16();
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        if ( arr[i] != 0 )
        {
            exp = norm_s( arr[i] );
        }
        if ( arr[i] != 0 )
        {
            q = s_min( q, exp );
        }
    }
    return q;
}

Word16 W_norm_arr( Word64 *arr, Word16 size )
{
    Word16 q = 63;
    Word16 exp = 0;
    move16();
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        if ( arr[i] != 0 )
        {
            exp = W_norm( arr[i] );
        }
        if ( arr[i] != 0 )
        {
            q = s_min( q, exp );
        }
    }
    return q;
}

Word16 get_min_scalefactor( Word32 x, Word32 y )
{
    Word16 scf_y;
    Word16 scf = Q31;
    move16();

    test();
    if ( x == 0 && y == 0 )
    {
        scf = 0;
        move16();
    }

    if ( x != 0 )
    {
        scf = norm_l( x );
    }

    scf_y = norm_l( y );
    if ( y != 0 )
    {
        scf = s_min( scf_y, scf );
    }

    return scf;
}


Flag is_zero_arr( Word32 *arr, Word16 size )
{
    FOR( Word16 i = 0; i < size; i++ )
    IF( arr[i] != 0 )
    {
        return 0;
    }

    return 1;
}

Flag is_zero_arr16( Word16 *arr, Word16 size )
{
    FOR( Word16 i = 0; i < size; i++ )
    IF( arr[i] != 0 )
    {
        return 0;
    }

    return 1;
}

void Scale_sig64(
    Word64 x[], /* i/o: signal to scale                 Qx        */
    Word16 len, /* i  : size of x[]                     Q0        */
    Word16 exp  /* i  : exponent: x = round(x << exp)   Qx exp    */
)
{
    Word16 i;
    assert( exp <= 63 && exp >= -63 );
    IF( exp == 0 )
    {
        return;
    }

    FOR( i = 0; i < len; i++ )
    {
        /* saturation can occur here */
        x[i] = W_shl( x[i], exp );
        move64();
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -2901,11 +2901,11 @@ void quant_target_fx( DTFS_STRUCTURE *X_fx, const Word16 *curr_lpc, Word16 *w, W
    Ltemp1 = log10_fx( Ltemp1 );

    /*  subtract 10log10(2)*(2Q-13), Q23 */
    Ltemp1 = L_sub( Ltemp1, Ltemp3 );
    Ltemp1 = L_sub_sat( Ltemp1, Ltemp3 );
    Ltemp1 = L_max( 0, Ltemp1 );
    Ltemp2 = getSpEngyFromResAmp_fx( X_fx, 2828, X_fx->upper_cut_off_freq_fx, curr_lpc, sin_tab, cos_tab );
    Ltemp2 = log10_fx( Ltemp2 );          /*  Ltemp1=10log10(eng_hb), Q23, need to adjust for Q factor of energy (2Q-13) */
    Ltemp2 = L_sub( Ltemp2, Ltemp3 ); /*  Ltemp2 in Q23 */
    Ltemp2 = L_sub_sat( Ltemp2, Ltemp3 ); /*  Ltemp2 in Q23 */

    Ltemp2 = L_max( 0, Ltemp2 );

@@ -2929,10 +2929,10 @@ void quant_target_fx( DTFS_STRUCTURE *X_fx, const Word16 *curr_lpc, Word16 *w, W
    tmp = round_fx( Ltemp );            /*  tmp in Q(22-n) */
    Ltemp1 = Mult_32_16( Ltemp1, tmp ); /*  Q(30-n) */
    n = sub( 8, exp );
    w[0] = round_fx( L_shl( Ltemp1, n ) ); /*  w[0] in Q15 */
    w[0] = round_fx_sat( L_shl_sat( Ltemp1, n ) ); /*  w[0] in Q15 */
    move16();
    Ltemp2 = Mult_32_16( Ltemp2, tmp );
    w[1] = round_fx( L_shl( Ltemp2, n ) ); /*  w[1] in Q15 */
    w[1] = round_fx_sat( L_shl_sat( Ltemp2, n ) ); /*  w[1] in Q15 */
    move16();

    logLag = log10_fx( X_fx->lag_fx );                       /*  logLag=10*log10(lag), Q23 */
Loading