Commit e2e7dafb authored by multrus's avatar multrus
Browse files

[cleanup] accept CODE_CLEAN_UP_DIRAC

parent 8e908ae6
Loading
Loading
Loading
Loading
+0 −100
Original line number Diff line number Diff line
@@ -41,105 +41,6 @@
#include "prot.h"

#define BAND_SMOOTH_REST_START_IDX ( 2 )
#ifndef CODE_CLEAN_UP_DIRAC
/*-----------------------------------------------------------------------------------------*
 * 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, k;
    if ( ivas_total_brate < IVAS_24k4 )
    {
        for ( j = 0; j < pFb->filterbank_num_bands; j++ )
        {
            float update_factor;
            float *p_bin_to_band;
            update_factor = 0.0f;
            p_bin_to_band = pFb->fb_bin_to_band.pp_short_stride_bin_to_band[j];
            int16_t active_bins;
            active_bins = pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j];

            for ( k = 0; k < active_bins; k++ )
            {
                update_factor += p_bin_to_band[k];
            }

            hCovState->pSmoothing_factor[j] = update_factor / min_pool_size;
            float smooth_fact;
            if ( ivas_total_brate < IVAS_24k4 )
            {
                smooth_fact = 0.5f;
            }
            else
            {
                smooth_fact = 0.75;
            }
            hCovState->pSmoothing_factor[j] *= ( j + 1 ) * smooth_fact;

            if ( hCovState->pSmoothing_factor[j] > max_update_rate )
            {
                hCovState->pSmoothing_factor[j] = max_update_rate;
            }
        }
    }
    else if ( smooth_mode == COV_SMOOTH_MC )
    {
        for ( j = 0; j < pFb->filterbank_num_bands; j++ )
        {
            float update_factor;
            update_factor = 0.0f;

            for ( k = 0; k < pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; k++ )
            {
                update_factor += pFb->fb_bin_to_band.pFb_bin_to_band[j][k];
            }

            hCovState->pSmoothing_factor[j] = update_factor / min_pool_size;

            if ( hCovState->pSmoothing_factor[j] > max_update_rate )
            {
                hCovState->pSmoothing_factor[j] = max_update_rate;
            }
        }
    }
    else
    {
        for ( j = 0; j < pFb->filterbank_num_bands; j++ )
        {
            float update_factor;
            float *p_bin_to_band;
            int16_t active_bins;
            update_factor = 0.0f;
            p_bin_to_band = pFb->fb_bin_to_band.pp_short_stride_bin_to_band[j];
            active_bins = pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j];
            for ( k = 0; k < active_bins; k++ )
            {
                update_factor += p_bin_to_band[k];
            }
            hCovState->pSmoothing_factor[j] = update_factor / min_pool_size;
            hCovState->pSmoothing_factor[j] *= ( j + 1 ) * 0.75f;
            if ( hCovState->pSmoothing_factor[j] > max_update_rate )
            {
                hCovState->pSmoothing_factor[j] = max_update_rate;
            }
        }
    }

    hCovState->prior_bank_idx = -1;

    return;
}
#else

/*-----------------------------------------------------------------------------------------*
 * Function ivas_calculate_update_factor()
@@ -225,7 +126,6 @@ static void ivas_set_up_cov_smoothing(
    hCovState->prior_bank_idx = -1;
}

#endif

/*-------------------------------------------------------------------------
 * ivas_spar_covar_smooth_enc_open()
+0 −23
Original line number Diff line number Diff line
@@ -871,29 +871,6 @@ void ivas_create_fullr_dmx_mat(
    {
        ivas_reorder_array( down_mix_mat1_re, in_chans, order, mixer_mat, start_band, end_band );
    }
#ifndef CODE_CLEAN_UP_DIRAC
    else
    {
        /* Custom 4x4 mult for WYiX case */
        for ( i = 0; i < in_chans; i++ )
        {
            for ( b = start_band; b < end_band; b++ )
            {
                /* row 0 */
                mixer_mat[0][i][b] = down_mix_mat1_re[0][i][b];

                /*row 1 */
                mixer_mat[1][i][b] = IVAS_REMIX_MULT_FAC * ( down_mix_mat1_re[1][i][b] );

                /* row 3 */
                mixer_mat[2][i][b] = IVAS_REMIX_MULT_FAC * ( down_mix_mat1_re[1][i][b] );

                /* row 4 */
                mixer_mat[3][i][b] = down_mix_mat1_re[2][i][b];
            }
        }
    }
#endif

    return;
}
+0 −1
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */


#define CODE_CLEAN_UP_DIRAC                             /* Dlb : code clean up*/
#define COVARIANCE_MEMORY_OPT                           /* Dlb : Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap */
#define NONBE_FIX_589_JBM_TC_OFFSETS                    /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */
#define FIX_MEM_REALLOC_IND_LIST                        /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/
+0 −45
Original line number Diff line number Diff line
@@ -616,11 +616,6 @@ static ivas_error ivas_spar_set_dec_config(
        case 9: /* IVAS_HOA_2_CH */
            hMdDec->num_decorr = IVAS_TD_DECORR_OUT_5CH;
            break;
#ifndef CODE_CLEAN_UP_DIRAC
        case 16: /* IVAS_HOA_3_CH */ // ToDo: is this relevant?
            hMdDec->num_decorr = IVAS_TD_DECORR_OUT_12CH;
            break;
#endif
        case 6: /* IVAS_HOA_2_CH */
            hMdDec->num_decorr = IVAS_TD_DECORR_OUT_2CH;
            break;
@@ -1287,26 +1282,6 @@ static void ivas_get_spar_matrices(
                {
                    ivas_mat_col_rearrange( tmp_dm_re, order, i_ts, hMdDec->mixer_mat, b, numch_out );
                }
#ifndef CODE_CLEAN_UP_DIRAC
                else
                {
                    /* Custom 4x4 mult for WYiX case */
                    for ( i = 0; i < FOA_CHANNELS; i++ )
                    {
                        /* row 0 */
                        hMdDec->mixer_mat[i][0][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_dm_re[i][0];

                        /* row 1 */
                        hMdDec->mixer_mat[i][1][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_dm_re[i][1];

                        /* row 3 */
                        hMdDec->mixer_mat[i][2][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_dm_re[i][1];

                        /* row 4 */
                        hMdDec->mixer_mat[i][3][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_dm_re[i][2];
                    }
                }
#endif
            }
            else
            {
@@ -1314,26 +1289,6 @@ static void ivas_get_spar_matrices(
                {
                    ivas_mat_col_rearrange( tmp_C1_re, order, i_ts, hMdDec->mixer_mat, b, numch_out );
                }
#ifndef CODE_CLEAN_UP_DIRAC
                else
                {
                    /* Custom 4x4 mult for WYiX case */
                    for ( i = 0; i < FOA_CHANNELS; i++ )
                    {
                        /* row 0 */
                        hMdDec->mixer_mat[i][0][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_C1_re[i][0];

                        /* row 1 */
                        hMdDec->mixer_mat[i][1][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_C1_re[i][1];

                        /* row 3 */
                        hMdDec->mixer_mat[i][2][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_C1_re[i][1];

                        /* row 4 */
                        hMdDec->mixer_mat[i][3][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_C1_re[i][2];
                    }
                }
#endif
            }

            if ( dmx_ch > 0 )