Commit ba7f2f79 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_331_SBA_HBR_HOA_FIXES, COV_SMOOTH_TUNING,...

[cleanup] accept FIX_331_SBA_HBR_HOA_FIXES, COV_SMOOTH_TUNING, SBA_HPF_TUNING_ENC, SMOOTH_WITH_TRANS_DET
parent 7e2c9ae2
Loading
Loading
Loading
Loading
+0 −33
Original line number Diff line number Diff line
@@ -39,9 +39,7 @@
#include "wmc_auto.h"
#include "prot.h"

#ifdef SMOOTH_WITH_TRANS_DET
#define BAND_SMOOTH_REST_START_IDX ( 2 )
#endif
/*-----------------------------------------------------------------------------------------*
 * Function ivas_set_up_cov_smoothing()
 *
@@ -53,18 +51,14 @@ static void ivas_set_up_cov_smoothing(
    ivas_filterbank_t *pFb,
    const float max_update_rate,
    const int16_t min_pool_size
#ifdef COV_SMOOTH_TUNING
    ,
    const int16_t nchan_inp /* i  : number of input channels       */
#endif
)
{
    int16_t j, k;

#ifdef COV_SMOOTH_TUNING
    if ( nchan_inp <= FOA_CHANNELS )
    {
#endif
        for ( j = 0; j < pFb->filterbank_num_bands; j++ )
        {
            float update_factor;
@@ -83,7 +77,6 @@ static void ivas_set_up_cov_smoothing(
            }
        }

#ifdef COV_SMOOTH_TUNING
    }
    else
    {
@@ -107,7 +100,6 @@ static void ivas_set_up_cov_smoothing(
            }
        }
    }
#endif
    hCovState->prior_bank_idx = -1;

    return;
@@ -153,10 +145,8 @@ ivas_error ivas_spar_covar_smooth_enc_open(
    }

    ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size
#ifdef COV_SMOOTH_TUNING
                               ,
                               nchan_inp
#endif
    );

    *hCovState_out = hCovState;
@@ -218,25 +208,18 @@ static void ivas_compute_smooth_cov(
    const int16_t start_band,
    const int16_t end_band,
    const int16_t num_ch,
#ifdef SMOOTH_WITH_TRANS_DET
    const int16_t transient_det[2]
#else
    const int16_t transient_det
#endif
)
{
    int16_t i, j, k;
    int16_t prev_idx = hCovState->prior_bank_idx;
    float factor = 0;
#ifdef SMOOTH_WITH_TRANS_DET
    int16_t sm_b;
    int16_t non_sm_b_idx;
    sm_b = BAND_SMOOTH_REST_START_IDX;
#endif

    assert( end_band <= pFb->filterbank_num_bands );

#ifdef SMOOTH_WITH_TRANS_DET
    if ( prev_idx == -1 || transient_det[1] == 1 )
    {
        for ( i = 0; i < num_ch; i++ )
@@ -277,18 +260,6 @@ static void ivas_compute_smooth_cov(
            }
        }
    }
#else
    if ( prev_idx == -1 || transient_det == 1 )
    {
        for ( i = 0; i < num_ch; i++ )
        {
            for ( k = start_band; k < end_band; k++ )
            {
                pCov_buf[i][i][k] += ( hCovState->pSmoothing_factor[k] * fac );
            }
        }
    }
#endif
    else if ( prev_idx == 0 )
    {
        for ( i = 0; i < num_ch; i++ )
@@ -329,11 +300,7 @@ void ivas_cov_smooth_process(
    const int16_t start_band,
    const int16_t end_band,
    const int16_t num_ch,
#ifdef SMOOTH_WITH_TRANS_DET
    const int16_t transient_det[2]
#else
    const int16_t transient_det
#endif
)
{
    int16_t i, j;
+0 −16
Original line number Diff line number Diff line
@@ -4140,11 +4140,7 @@ void ivas_enc_cov_handler_process(
    const int16_t end_band,
    const int16_t nchan_inp,
    const int16_t dtx_vad,
#ifdef SMOOTH_WITH_TRANS_DET
    const int16_t transient_det[2]
#else
    const int16_t transient_det
#endif
);

ivas_error ivas_spar_covar_smooth_enc_open( 
@@ -4166,11 +4162,7 @@ void ivas_cov_smooth_process(
    const int16_t start_band,
    const int16_t end_band,
    const int16_t num_ch,
#ifdef SMOOTH_WITH_TRANS_DET
    const int16_t transient_det[2]
#else
    const int16_t transient_det
#endif
);

/* Transient detector module */
@@ -4183,20 +4175,12 @@ void ivas_transient_det_close(
    ivas_trans_det_state_t **hTranDet                           /* i/o: Transient detector handle               */
);

#ifdef SMOOTH_WITH_TRANS_DET
void ivas_transient_det_process( 
    ivas_trans_det_state_t *hTranDet,                           /* i/o: SPAR TD handle                          */
    float *pIn_pcm,                                             /* i  : input audio channels                    */
    const int16_t frame_len,                                    /* i  : frame length in samples                 */
    int16_t transient_det[2]                                    /* o  : transient det outputs                   */
);
#else
int16_t ivas_transient_det_process( 
    ivas_trans_det_state_t *hTranDet,                           /* i/o: Transient detector handle               */
    float *pIn_pcm,                                             /* i  : input audio channels                    */
    const int16_t frame_len                                     /* i  : frame length in samples                 */
);
#endif

void ivas_td_decorr_get_ducking_gains( 
    ivas_trans_det_state_t *hTranDet,                           /* i/o: Transient detector handle               */
+0 −29
Original line number Diff line number Diff line
@@ -211,43 +211,17 @@ void ivas_transient_det_close(
 *
 * Transient detection process call
 *-----------------------------------------------------------------------------------------*/
#ifdef SMOOTH_WITH_TRANS_DET
void ivas_transient_det_process(
    ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle                          */
    float *pIn_pcm,                   /* i  : input audio channels                    */
    const int16_t frame_len,          /* i  : frame length in samples                 */
    int16_t transient_det[2]          /* o: transient det outputs                         */
)
#else
int16_t ivas_transient_det_process(
    ivas_trans_det_state_t *hTranDet, /* i/o: SPAR TD handle                */
    float *pIn_pcm,                   /* i  : input audio channels          */
    const int16_t frame_len           /* i  : frame length in samples       */
)
#endif
{
#ifdef SMOOTH_WITH_TRANS_DET
    float in_duck_gain[L_FRAME48k];
    int16_t num_sf, sf, sf_samp, idx;
#else
    int16_t trans;
#endif
    float mem = hTranDet->in_duck_gain;

#ifndef SMOOTH_WITH_TRANS_DET
    ivas_td_decorr_get_ducking_gains( hTranDet, pIn_pcm, NULL, NULL, frame_len, IVAS_TDET_ONLY );

    if ( mem - hTranDet->in_duck_gain > IVAS_TDET_PARM_TRANS_THR )
    {
        trans = 1;
    }
    else
    {
        trans = 0;
    }

    return trans;
#else
    ivas_td_decorr_get_ducking_gains( hTranDet, pIn_pcm, in_duck_gain, NULL, frame_len, IVAS_TDET_ONLY );

    transient_det[0] = 0;
@@ -270,7 +244,6 @@ int16_t ivas_transient_det_process(
    }

    return;
#endif
}


@@ -344,9 +317,7 @@ void ivas_td_decorr_get_ducking_gains(
        for ( i = 0; i < frame_len; i++ )
        {
            in_duck_gain = ivas_calc_duck_gain( in_duck_gain, in_duck_coeff, e_slow[i], e_fast[i], duck_mult_fac );
#ifdef SMOOTH_WITH_TRANS_DET
            pIn_duck_gains[i] = in_duck_gain;
#endif
        }
        hTranDet->in_duck_gain = in_duck_gain;
    }
+0 −6
Original line number Diff line number Diff line
@@ -144,13 +144,7 @@



#define FIX_331_SBA_HBR_HOA_FIXES                       /* DLB: issue 331 - fix addressing low frequency stuttering with HOA inputs at high bitrates */
#ifdef FIX_331_SBA_HBR_HOA_FIXES
#define COV_SMOOTH_TUNING
#define SBA_HPF_TUNING_ENC
/*#define SBA_HPF_TUNING_DEC*/
#define SMOOTH_WITH_TRANS_DET
#endif

#define BINAURALIZATION_DELAY_REPORT                    /* VA: Issue 255 - Changes the way the decoder delay is reported */
#define FIX_351_HRTF_COMMAND                            /* VA: Issue 354 - improve "-hrtf" command-line option */
+0 −19
Original line number Diff line number Diff line
@@ -806,28 +806,18 @@ void ivas_spar_get_parameters(

    weight = ivas_spar_get_cldfb_slot_gain( hSpar, hDecoderConfig, ts, &ts0, &ts1, &weight_20ms );

#ifdef COV_SMOOTH_TUNING
    split_band = SPAR_DIRAC_SPLIT_START_BAND;
#else
    split_band = hSpar->hMdDec->spar_md.num_bands;
#endif
    for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ )
    {
        for ( out_ch = 0; out_ch < num_ch_out; out_ch++ )
        {
#ifndef COV_SMOOTH_TUNING
            for ( in_ch = 0; in_ch < num_ch_in; in_ch++ )
            {
#endif
                if ( split_band < IVAS_MAX_NUM_BANDS
                     /* 20ms cross-fade for Transport channels in all frequency bands */
                     && ( 0 == ivas_is_res_channel( out_ch, hSpar->hMdDec->spar_md_cfg.nchan_transport ) ) /* sub-frame processing for missing channels in all frequency bands*/
                )
                {
#ifdef COV_SMOOTH_TUNING
                    for ( in_ch = 0; in_ch < num_ch_in; in_ch++ )
                    {
#endif
                        if ( hSpar->i_subframe > 3 )
                        {
                            par_mat[out_ch][in_ch][spar_band] = ( 1.0f - weight ) * hSpar->hMdDec->mixer_mat_prev[ts0][out_ch][in_ch][spar_band] +
@@ -837,26 +827,17 @@ void ivas_spar_get_parameters(
                        {
                            par_mat[out_ch][in_ch][spar_band] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band];
                        }
#ifdef COV_SMOOTH_TUNING
                    }
#endif
                }
                else
                {
#ifdef COV_SMOOTH_TUNING
                    for ( in_ch = 0; in_ch < num_ch_in; in_ch++ )
                    {
#endif
                        /* 20ms Transport channel reconstruction with matching encoder/decoder processing */
                        int16_t prev_idx = SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ? 1 : 0; /* if SPAR_DIRAC_SPLIT_START_BAND == IVAS_MAX_NUM_BANDS, then the sub-frame mixer_mat delay line is not active */
                        par_mat[out_ch][in_ch][spar_band] = ( 1.0f - weight_20ms ) * hSpar->hMdDec->mixer_mat_prev[prev_idx][out_ch][in_ch][spar_band] + weight_20ms * hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band];
#ifdef COV_SMOOTH_TUNING
                    }
#endif
                }
#ifndef COV_SMOOTH_TUNING
            }
#endif
        }
    }

Loading