Commit 8e908ae6 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_280_PLANAR_CP

parent fcbf6bab
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -4614,10 +4614,6 @@ void ivas_calc_c_p_coeffs(
    const int16_t band_idx,
    const int16_t dtx_vad,
    const int16_t compute_p_flag
#ifndef FIX_280_PLANAR_CP
    ,
    const int16_t planarCP 
#endif
#ifdef FIX_SBA_VANISHING_RESIDUAL
    ,
    const int16_t dyn_active_w_flag
@@ -5129,10 +5125,6 @@ void ivas_copy_band_coeffs_idx_to_arr(
    int16_t *pSymbol_re, 
    ivas_cell_dim_t *pCell_dims, 
    const ivas_coeffs_type_t coeff_type
#ifndef FIX_280_PLANAR_CP
    ,
    const int16_t planarCP
#endif
);

void ivas_clear_band_coeffs( 
+0 −13
Original line number Diff line number Diff line
@@ -1313,10 +1313,6 @@ void ivas_calc_c_p_coeffs(
    const int16_t band_idx,
    const int16_t dtx_vad,
    const int16_t compute_p_flag
#ifndef FIX_280_PLANAR_CP
    ,
    const int16_t planarCP
#endif
#ifdef FIX_SBA_VANISHING_RESIDUAL
    ,
    const int16_t dyn_active_w_flag
@@ -1666,21 +1662,12 @@ void ivas_compute_spar_params(

        if ( ndm != num_ch )
        {
#ifndef FIX_280_PLANAR_CP
            ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, 0
#ifdef FIX_SBA_VANISHING_RESIDUAL
                                  ,
                                  dyn_active_w_flag
#endif
            );
#else
            ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1
#ifdef FIX_SBA_VANISHING_RESIDUAL
                                  ,
                                  dyn_active_w_flag
#endif
            );
#endif

#ifdef SPAR_HOA_DBG
            /* if (b == 0) */
+0 −27
Original line number Diff line number Diff line
@@ -244,16 +244,9 @@ void ivas_copy_band_coeffs_idx_to_arr(
    int16_t *pSymbol_re,
    ivas_cell_dim_t *pCell_dims,
    const ivas_coeffs_type_t coeff_type
#ifndef FIX_280_PLANAR_CP
    ,
    const int16_t planarCP
#endif
)
{
    int16_t i, len;
#ifndef FIX_280_PLANAR_CP
    int16_t j, k;
#endif
    int16_t *pPtr_idx = NULL;

    for ( i = 0; i < nB; i++ )
@@ -283,28 +276,8 @@ void ivas_copy_band_coeffs_idx_to_arr(
        len = pCell_dims[i].dim1 * pCell_dims[i].dim2;
        if ( ( coeff_type != DECX_COEFF ) )
        {
#ifndef FIX_280_PLANAR_CP
            if ( ( coeff_type == PRED_COEFF ) || !planarCP )
            {
#endif
                mvs2s( pPtr_idx, pSymbol_re, len );
                pSymbol_re += len;
#ifndef FIX_280_PLANAR_CP
            }
            else
            {
                k = 0;
                for ( j = 0; j < len; j++ )
                {
                    if ( keep_planar[(int16_t) floor( j / pCell_dims[i].dim2 )] )
                    {
                        pSymbol_re[k] = pPtr_idx[j];
                        k++;
                    }
                }
                pSymbol_re += k;
            }
#endif
        }
    }

+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 FIX_280_PLANAR_CP                               /* Dlb : fix issue 28 : remove planarCP=1 related code*/
#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 */
+0 −151
Original line number Diff line number Diff line
@@ -69,14 +69,6 @@ static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int1
#endif
);

#ifndef FIX_280_PLANAR_CP
static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate );

static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, const int16_t planarCP );

static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type, const int16_t planarCP );

#else
#ifndef FIX_279_CODE_COVERAGE
static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t strat, const int32_t ivas_total_brate );
#else
@@ -87,7 +79,6 @@ static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_St

static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type );

#endif
#ifndef FIX_279_CODE_COVERAGE
static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const ivas_coeffs_type_t coeff_type );
#endif
@@ -103,12 +94,8 @@ static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decode

static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 );

#ifndef FIX_280_PLANAR_CP
static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode, const int32_t last_active_brate );
#else
static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t sba_inactive_mode, const int32_t last_active_brate );

#endif


/*-------------------------------------------------------------------------
@@ -786,9 +773,6 @@ void ivas_spar_md_dec_process(
#endif

    ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate,
#ifndef FIX_280_PLANAR_CP
                               ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff,
#endif
                               st_ivas->hQMetaData->sba_inactive_mode, st_ivas->last_active_ivas_total_brate );

#ifdef FIX_527_SBA_MONO_INPUT
@@ -1581,9 +1565,6 @@ static void ivas_spar_dec_parse_md_bs(
    int16_t *bands_bw,
    int16_t *dtx_vad,
    const int32_t ivas_total_brate,
#ifndef FIX_280_PLANAR_CP
    const int16_t use_planar_coeff,
#endif
    const int16_t sba_inactive_mode,
    const int32_t last_active_brate )
{
@@ -1597,9 +1578,6 @@ static void ivas_spar_dec_parse_md_bs(
    int16_t strat, no_ec;
#endif
    int16_t do_diff[IVAS_MAX_NUM_BANDS];
#ifndef FIX_280_PLANAR_CP
    int16_t planarCP;
#endif
    float quant[IVAS_SPAR_MAX_C_COEFF];
    int16_t do_repeat[IVAS_MAX_NUM_BANDS];
    int16_t bw_final, bw_fact;
@@ -1712,16 +1690,6 @@ static void ivas_spar_dec_parse_md_bs(

    qs = hMdDec->spar_md_cfg.quant_strat[qsi];

#ifndef FIX_280_PLANAR_CP
    planarCP = 0;
    if ( ( qsi == 2 ) && ( use_planar_coeff ) )
    {
        planarCP = 1;
#ifdef SPAR_HOA_DBG
        fprintf( stdout, "planarCP = 1\n" );
#endif
    }
#endif
    strat = get_next_indice( st0, 3 );

#ifndef FIX_279_CODE_COVERAGE
@@ -1784,19 +1752,12 @@ static void ivas_spar_dec_parse_md_bs(
        ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff,
#ifndef FIX_279_CODE_COVERAGE
                              freq_diff,
#endif
#ifndef FIX_280_PLANAR_CP
                              planarCP,
#endif
                              strat, ivas_total_brate );
    }
    else
    {
        ivas_decode_huffman_bs( hMdDec, st0, qsi, *nB, *bands_bw
#ifndef FIX_280_PLANAR_CP
                                ,
                                planarCP
#endif
        );
    }

@@ -1870,9 +1831,6 @@ static void ivas_decode_arith_bs(
    int16_t *pDo_diff,
#ifndef FIX_279_CODE_COVERAGE
    const int16_t freq_diff,
#endif
#ifndef FIX_280_PLANAR_CP
    const int16_t planarCP,
#endif
    const int16_t strat,
    const int32_t ivas_total_brate )
@@ -1949,10 +1907,6 @@ static void ivas_decode_arith_bs(
            }
        }
        ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, pred_cell_dims, PRED_COEFF
#ifndef FIX_280_PLANAR_CP
                                          ,
                                          planarCP
#endif
        );
    }

@@ -1960,10 +1914,6 @@ static void ivas_decode_arith_bs(
                                        st0, pred_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re );

    ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF
#ifndef FIX_280_PLANAR_CP
                               ,
                               planarCP
#endif
    );

    if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag )
@@ -1988,77 +1938,35 @@ static void ivas_decode_arith_bs(
    if ( any_diff == 1 )
    {
        ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, drct_cell_dims, DRCT_COEFF
#ifndef FIX_280_PLANAR_CP
                                          ,
                                          planarCP
#endif
        );
    }

#ifndef FIX_280_PLANAR_CP
    if ( planarCP )
    {
        for ( i = 0; i < nB; i++ )
        {
            drct_cell_dims[i].dim1 = drct_cell_dims[i].dim1 - IVAS_SPAR_HOA3_NP_CHS;
        }
    }
#endif

    ivas_arith_decode_cmplx_cell_array( &hMdDec->arith_coeffs.drct_arith_re[qsi], &hMdDec->arith_coeffs.drct_arith_re_diff[qsi],
                                        st0, drct_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re );

    ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, drct_cell_dims, DRCT_COEFF
#ifndef FIX_280_PLANAR_CP
                               ,
                               planarCP
#endif
    );

    if ( any_diff == 1 )
    {
        ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decd_cell_dims, DECD_COEFF
#ifndef FIX_280_PLANAR_CP
                                          ,
                                          planarCP
#endif
        );
    }

#ifndef FIX_280_PLANAR_CP
    if ( planarCP )
    {
        for ( i = 0; i < nB; i++ )
        {
            decd_cell_dims[i].dim1 = decd_cell_dims[i].dim1 - IVAS_SPAR_HOA3_NP_CHS;
        }
    }
#endif
    ivas_arith_decode_cmplx_cell_array( &hMdDec->arith_coeffs.decd_arith_re[qsi], &hMdDec->arith_coeffs.decd_arith_re_diff[qsi],
                                        st0, decd_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re );

    ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decd_cell_dims, DECD_COEFF
#ifndef FIX_280_PLANAR_CP
                               ,
                               planarCP
#endif
    );

    if ( any_diff == 1 )
    {
        ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decx_cell_dims, DECX_COEFF
#ifndef FIX_280_PLANAR_CP
                                          ,
                                          planarCP
#endif
        );
    }

    ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF
#ifndef FIX_280_PLANAR_CP
                               ,
                               planarCP
#endif
    );
#ifndef FIX_279_CODE_COVERAGE
    if ( freq_diff == 1 )
@@ -2166,17 +2074,9 @@ static void ivas_fill_band_coeffs_idx(
    int16_t *pSymbol_re,
    ivas_cell_dim_t *pCell_dims,
    const ivas_coeffs_type_t coeff_type
#ifndef FIX_280_PLANAR_CP
    ,
    const int16_t planarCP
#endif
)
{
#ifndef FIX_280_PLANAR_CP
    int16_t i, j, k, len;
#else
    int16_t i, len;
#endif
    int16_t *pPtr_idx = NULL;

    for ( i = 0; i < nB; i++ )
@@ -2209,34 +2109,9 @@ static void ivas_fill_band_coeffs_idx(

        if ( coeff_type != DECX_COEFF )
        {
#ifndef FIX_280_PLANAR_CP
            if ( ( coeff_type == PRED_COEFF ) || !planarCP )
            {
#endif
                len = pCell_dims[i].dim1 * pCell_dims[i].dim2;
                mvs2s( pSymbol_re, pPtr_idx, len );
                pSymbol_re += len;
#ifndef FIX_280_PLANAR_CP
            }
            else
            {
                k = 0;
                len = ( pCell_dims[i].dim1 + IVAS_SPAR_HOA3_NP_CHS ) * pCell_dims[i].dim2;
                for ( j = 0; j < len; j++ )
                {
                    if ( keep_planar[(int16_t) floor( j / pCell_dims[i].dim2 )] )
                    {
                        pPtr_idx[j] = pSymbol_re[k];
                        k++;
                    }
                    else
                    {
                        pPtr_idx[j] = 0;
                    }
                }
                pSymbol_re += k;
            }
#endif
        }
    }

@@ -2256,10 +2131,6 @@ static void ivas_decode_huffman_bs(
    const uint16_t qsi,
    const int16_t nB,
    const int16_t bands_bw
#ifndef FIX_280_PLANAR_CP
    ,
    const int16_t planarCP
#endif
)
{
    int16_t i, j;
@@ -2301,34 +2172,12 @@ static void ivas_decode_huffman_bs(

        for ( j = 0; j < drct_dim; j++ )
        {
#ifndef FIX_280_PLANAR_CP
            if ( planarCP && !keep_planar[(int16_t) floor( j / ( ndm - 1 ) )] )
            {
                hMdDec->spar_md.band_coeffs_idx[i].drct_index_re[j] = 0;
            }
            else
            {
#endif
                ivas_huffman_decode( &hMdDec->huff_coeffs.drct_huff_re[qsi], st0, &hMdDec->spar_md.band_coeffs_idx[i].drct_index_re[j] );
#ifndef FIX_280_PLANAR_CP
            }
#endif
        }

        for ( j = 0; j < decd_dim; j++ )
        {
#ifndef FIX_280_PLANAR_CP
            if ( planarCP && !keep_planar[j] )
            {
                hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j] = 0;
            }
            else
            {
#endif
                ivas_huffman_decode( &hMdDec->huff_coeffs.decd_huff_re[qsi], st0, &hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j] );
#ifndef FIX_280_PLANAR_CP
            }
#endif
        }
    }

Loading