Commit 7682a7e3 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into 594-lib_com-env_stab-c-missing-include-of-stl-h

parents 69d341c5 f4eb3aa7
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -530,8 +530,7 @@ split-rendering-smoke-test:
        - report-junit.xml

# compare split-rendering bitexactness between target and source branch
# TODO activate after MR !818 is merged ( https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/merge_requests/818 )
.split-rendering-pytest-on-merge-request:
split-rendering-pytest-on-merge-request:
  extends:
    - .test-job-linux
    - .rules-merge-request
+4 −0
Original line number Diff line number Diff line
@@ -95,8 +95,12 @@ float env_stability(
#ifdef BASOP_NOGLOB
        Overflow = 0;
        env_delta = shl_o( *mem_env_delta, 1, &Overflow );
#else
#ifdef FIX_595_SHL_NOGLOB
        env_delta = shl( *mem_env_delta, 1 );
#else
        env_delta = shl_o( *mem_env_delta, 1 );
#endif
#endif
    }
    else
+4 −0
Original line number Diff line number Diff line
@@ -229,7 +229,11 @@ void ifft_rel(
     *-----------------------------------------------------------------*/

    idx = fft256_read_indexes;
#ifdef FIX_622_SILENCE_USAN_WARNING
    xi0 = &temp[0] - 1;
#else
    xi0 = temp - 1;
#endif
    if ( n == 128 )
    {
        for ( i = 0; i < n; i++ )
+5 −0
Original line number Diff line number Diff line
@@ -887,7 +887,12 @@ enum fea_names
#define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE    3

typedef enum {
#ifdef FIX_619_ADD_UNDEF_VAL_FOR_CONCEALMENT_MODE
    NOISE_GEN_MODE_UNDEF = -1,
    EQUAL_CORES = 0,
#else
    EQUAL_CORES,
#endif
    TCX10_IN_0_TCX20_IN_1,
    TCX20_IN_0_TCX10_IN_1,
} TONALMDCTCONC_NOISE_GEN_MODE;
+87 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include "prot.h"

#define BAND_SMOOTH_REST_START_IDX ( 2 )
#ifndef CODE_CLEAN_UP_DIRAC
/*-----------------------------------------------------------------------------------------*
 * Function ivas_set_up_cov_smoothing()
 *
@@ -138,7 +139,93 @@ static void ivas_set_up_cov_smoothing(

    return;
}
#else

/*-----------------------------------------------------------------------------------------*
 * Function ivas_calculate_update_factor()
 *
 * To calculate the update factor
 *-----------------------------------------------------------------------------------------*/

static float ivas_calculate_update_factor( float *p_bin_to_band, int16_t active_bins )
{
    float update_factor_temp = 0.0f;
    int16_t k;
    for ( k = 0; k < active_bins; k++ )
    {
        update_factor_temp += p_bin_to_band[k];
    }
    return update_factor_temp;
}

/*-----------------------------------------------------------------------------------------*
 * Function ivas_calculate_smoothning_factor()
 *
 * To calculate the Smoothning factor
 *-----------------------------------------------------------------------------------------*/

static void ivas_calculate_smoothning_factor( float *Smoothing_factor, float update_factor, const int16_t min_pool_size, const float max_update_rate, const COV_SMOOTHING_TYPE smooth_mode, const int32_t ivas_total_brate, int16_t j )
{
    float smooth_fact;
    *Smoothing_factor = update_factor / min_pool_size;
    if ( smooth_mode != COV_SMOOTH_MC )
    {
        if ( ivas_total_brate < IVAS_24k4 )
        {
            smooth_fact = 0.5f;
        }
        else
        {
            smooth_fact = 0.75f;
        }
        *Smoothing_factor *= ( j + 1 ) * smooth_fact;
    }
    if ( *Smoothing_factor > max_update_rate )
    {
        *Smoothing_factor = max_update_rate;
    }
}

/*-----------------------------------------------------------------------------------------*
 * Function ivas_set_up_cov_smoothing()
 *
 * Setup for covariance smoothing
 *-----------------------------------------------------------------------------------------*/

static void ivas_set_up_cov_smoothing(
    ivas_cov_smooth_state_t *hCovState,
    ivas_filterbank_t *pFb,
    const float max_update_rate,
    const int16_t min_pool_size,
    const COV_SMOOTHING_TYPE smooth_mode, /* i  : flag multichannel vs SPAR       */
    const int32_t ivas_total_brate )
{
    int16_t j;
    float update_factor;
    if ( smooth_mode == COV_SMOOTH_MC )
    {
        for ( j = 0; j < pFb->filterbank_num_bands; j++ )
        {
            int16_t active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j];
            update_factor = ivas_calculate_update_factor( pFb->fb_bin_to_band.pFb_bin_to_band[j], active_bins );
            ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j );
        }
    }
    else
    {
        for ( j = 0; j < pFb->filterbank_num_bands; j++ )
        {
            float *p_bin_to_band = pFb->fb_bin_to_band.pp_short_stride_bin_to_band[j];
            int16_t active_bins = pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j];
            update_factor = ivas_calculate_update_factor( p_bin_to_band, active_bins );
            ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j );
        }
    }

    hCovState->prior_bank_idx = -1;
}

#endif

/*-------------------------------------------------------------------------
 * ivas_spar_covar_smooth_enc_open()
Loading