Commit e6b464e1 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into cleanup_main_20251015

- accept switches
- clang-format
parents 8e7d8af3 c2cded69
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -800,10 +800,6 @@ enum
#define CLDFB_NO_COL_MAX_SWITCH_BFI         10                     /* CLDFB resampling - max number of CLDFB col. for switching, BFI */
#define CLDFB_OVRLP_MIN_SLOTS               3                      /* CLDFB resampling - minimize processing to minimum required for transition frame ACELP->TCX/HQ */

#ifndef FIX_2085_FLOATING_POINT_LEFTOVERS
#define INV_CLDFB_BANDWIDTH                 ( 1.f / 800.f )
#endif

#define INV_CLDFB_BANDWIDTH_Q31             ( 2684355l )           /* ( 1.f / 800.f ) Q31 */
#define INV_CLDFB_BANDWIDTH_MDFT_FAC_Q31    ( 10737418 )
#define CLDFB_BANDWIDTH                     800
+0 −12
Original line number Diff line number Diff line
@@ -218,7 +218,6 @@ ivas_error ivas_dirac_config_fx(
    }

    test();
#ifdef FIX_2085_FLOATING_POINT_LEFTOVERS
    IF( EQ_32( ivas_format, SBA_FORMAT ) || EQ_32( ivas_format, SBA_ISM_FORMAT ) )
    {
        // 100861_dirac_dec
@@ -228,17 +227,6 @@ ivas_error ivas_dirac_config_fx(
    {
        ivas_dirac_config_bands_fx( band_grouping, hConfig->nbands, extract_l( Mpy_32_32_r( Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), NULL, 0, 0, hFbMdft, 1 );
    }
#else
    IF( EQ_32( ivas_format, SBA_FORMAT ) || EQ_32( ivas_format, SBA_ISM_FORMAT ) )
    {
        // 100861_dirac_dec
        ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft, 1 );
    }
    ELSE
    {
        ivas_dirac_config_bands_fx( band_grouping, hConfig->nbands, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft, 1 );
    }
#endif

    return error;
}
+2 −8
Original line number Diff line number Diff line
@@ -73,15 +73,9 @@

/* ################### Start FIXES switches ########################### */

#define FIX_1990_SANITIZER_IN_REVERB_LOAD                    /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure. */
#define FIX_1995_REVERB_INIT                                 /* VA/Nokia: issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */

#define FIX_2083_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/
#define FIX_2085_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in ivas_dirac_config_fx() */
#define FIX_1984_SAT_IN_PSYCHAD                              /* VA: Issue 1984: proposal to fix an assert */
#define FIX_1990_SANITIZER_IN_REVERB_LOAD                    /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK            /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/

/* #################### End FIXES switches ############################ */
#define OPT_IGF_GET_WHITE_SPEC_DATA                          /* FhG: optimized version of IGF_getWhiteSpectralData_ivas() */


/* #################### Start BASOP porting switches ############################ */
+6 −10
Original line number Diff line number Diff line
@@ -1427,11 +1427,7 @@ void PsychAdaptLowFreqDeemph(
        tmp_e = min_e;
        move16();
        tmp = Inv16( min, &tmp_e );                                           /*Q15 - tmp_e*/
#ifdef FIX_1984_SAT_IN_PSYCHAD
        L_tmp = L_shl_sat( L_mult_sat( tmp, max_val ), add( tmp_e, max_e ) ); /* Q31 */
#else
        L_tmp = L_shl( L_mult( tmp, max_val ), add( tmp_e, max_e ) ); /* Q31 */
#endif
        L_tmp = BASOP_Util_Log2( L_tmp );                                     /* Q25 */
        L_tmp = L_shr( L_tmp, 7 );                                            /* 0.0078125f = 1.f/(1<<7) */
        L_tmp = BASOP_Util_InvLog2( L_tmp );                                  /* Q31 */
+25 −1
Original line number Diff line number Diff line
@@ -2857,6 +2857,9 @@ static void IGF_getWhiteSpectralData_ivas(
    Word16 tmp_e;
    Word16 out_e_arr[IGF_START_MX + MAX_IGF_SFB_LEN];
    Word16 max_out_e;
#ifdef OPT_IGF_GET_WHITE_SPEC_DATA
    Word64 window_sum;
#endif
    assert( LT_16( stop, IGF_START_MX + MAX_IGF_SFB_LEN ) );

    /* inits */
@@ -2882,8 +2885,22 @@ static void IGF_getWhiteSpectralData_ivas(
    ak_e = add( tmp_e, sub( shl( sub( in_e, s_l ), 1 ), 15 ) ); // tmp_e + 2 * (in_e - s_l) - 15
    ak_e = sub( ak_e, 1 );

#ifdef OPT_IGF_GET_WHITE_SPEC_DATA
    window_sum = 0;
    move64();
    FOR( j = start - level; j < start + level; j++ )
    {
        window_sum = W_mac_32_32( window_sum, in[j], in[j] );
    }
#endif

    FOR( i = start; i < stop - level; i++ )
    {
#ifdef OPT_IGF_GET_WHITE_SPEC_DATA
        window_sum = W_mac_32_32( window_sum, in[i + level], in[i + level] );           /* add the right one */
        ak = Mult_32_16( W_shl_sat_l( window_sum, shift ), quo );                       // add( shl( level, 1 ), 1 ), &tmp_e ) );
        window_sum = W_sub( window_sum, W_mult_32_32( in[i - level], in[i - level] ) ); /* subtract the left one */
#else
        Word64 temp = 0;
        move64();
        FOR( j = i - level; j < i + level + 1; j++ )
@@ -2891,7 +2908,7 @@ static void IGF_getWhiteSpectralData_ivas(
            temp = W_mac_32_32( temp, in[j], in[j] );
        }
        ak = Mult_32_16( W_shl_sat_l( temp, shift ), quo ); // add( shl( level, 1 ), 1 ), &tmp_e ) );

#endif

        n = sub( ak_e, norm_l( ak ) );
        n = shr( n, 1 );
@@ -2903,6 +2920,11 @@ static void IGF_getWhiteSpectralData_ivas(

    FOR( ; i < stop; i++ )
    {
#ifdef OPT_IGF_GET_WHITE_SPEC_DATA
        ak = L_deposit_h( BASOP_Util_Divide3216_Scale( W_shl_sat_l( window_sum, shift ), sub( stop, sub( i, level ) ), &tmp_e ) );
        window_sum = W_sub( window_sum, W_mult_32_32( in[i - level], in[i - level] ) ); /* subtract the left one */
        ak_e = add( tmp_e, eff_e );                                                     // tmp_e + 2 * (in_e - s_l) - 15
#else
        Word64 temp = 0;
        move64();

@@ -2913,6 +2935,8 @@ static void IGF_getWhiteSpectralData_ivas(

        ak = L_deposit_h( BASOP_Util_Divide3216_Scale( W_shl_sat_l( temp, shift ), sub( stop, sub( i, level ) ), &tmp_e ) );
        ak_e = add( tmp_e, eff_e ); // tmp_e + 2 * (in_e - s_l) - 15
#endif

        n = sub( ak_e, add( norm_l( ak ), 1 ) );
        n = shr( n, 1 );

Loading