Commit 86e5752f authored by multrus's avatar multrus
Browse files

[cleanup] remove inactive switch /*#define LBR_SBA_PLANAR*/ ...

[cleanup] remove inactive switch /*#define LBR_SBA_PLANAR*/                              /* Converting low bitrate SBA modes to Planar */
parent 454268e4
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -890,19 +890,11 @@ const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] =
#ifdef LBR_SBA
 /* preferred tuning (3.2/4.9kbps) with/out TDD */
	{ 13200, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0,
#ifdef LBR_SBA_PLANAR
	{ { 11000, 9600, 13150 } },
#else
	{ { 10000, 8300, 13150 } },
#endif
    { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 },
	{ 16400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0,
#ifdef LBR_SBA_PLANAR
	{ { 14200, 12800, 16350 } },
#else
	{ { 13200, 11500, 16350 } },
#endif
    { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } },	0, 0, 0 },
#endif
    { 24400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0,{ { 16400, 14850, 24350 } },
+0 −1
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@
#ifdef LBR_SBA_DM_COV_FIX
#define LBR_SBA_EXTRA_COV_SMOOTH						/* Extra covariance smoothing for low bitrate SBA */
#endif
/*#define LBR_SBA_PLANAR*/                              /* Converting low bitrate SBA modes to Planar */
#define LBR_ADAP_SMOOTHING
#endif
#define FIX_391_SBA                                     /* Dlb: Fix for issue 391 for SBA */
+0 −48
Original line number Diff line number Diff line
@@ -79,10 +79,6 @@ static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_Stat
);

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
#ifdef LBR_SBA_PLANAR
                                    ,
                                    const int32_t ivas_total_brate
#endif
);

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 );
@@ -1917,10 +1913,6 @@ static void ivas_spar_dec_parse_md_bs(
    else
    {
        ivas_decode_huffman_bs( hMdDec, st0, qsi, *nB, *bands_bw, planarCP
#ifdef LBR_SBA_PLANAR
                                ,
                                ivas_total_brate
#endif
        );
    }

@@ -2119,13 +2111,6 @@ static void ivas_decode_arith_bs(
            decd_cell_dims[i].dim2 = 1;
            decx_cell_dims[i].dim1 = ( ndec * ( ndec - 1 ) ) >> 1;
            decx_cell_dims[i].dim2 = 1;
#ifdef LBR_SBA_PLANAR
            if ( ivas_total_brate < IVAS_24k4 )
            {
                pred_cell_dims[i].dim1 -= 1;
                decd_cell_dims[i].dim1 -= 1;
            }
#endif
#ifdef LBR_SBA
        }
#endif
@@ -2237,20 +2222,6 @@ static void ivas_decode_arith_bs(
        ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_r.q_levels, 1, nB, DECD_COEFF );
        ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_c.q_levels, 0, nB, DECX_COEFF );
    }
#ifdef LBR_SBA_PLANAR
    if ( ivas_total_brate < IVAS_24k4 )
    {
        for ( i = 0; i < nB; i++ ) /* restore X PR index, force Z PR, P indices to be zero.*/
        {
            if ( ( strat < 3 ) || ( ( strat > 3 ) && ( ( ( i % 2 == 0 ) && ( strat % 2 == 0 ) ) || ( ( i % 2 == 1 ) && ( strat % 2 == 1 ) ) ) ) )
            {
                hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[2] = hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[1];
                hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[1] = 0;
            }
            hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[2] = 0; /* shouldn't be needed */
        }
    }
#endif
    return;
}

@@ -2430,10 +2401,6 @@ static void ivas_decode_huffman_bs(
    const int16_t nB,
    const int16_t bands_bw,
    const int16_t planarCP
#ifdef LBR_SBA_PLANAR
    ,
    const int32_t ivas_total_brate
#endif
)
{
    int16_t i, j;
@@ -2459,19 +2426,8 @@ static void ivas_decode_huffman_bs(

        for ( j = pred_offset; j < pred_dim; j++ )
        {
#ifdef LBR_SBA_PLANAR
            if ( ( j == 1 ) && ( ivas_total_brate < IVAS_24k4 ) )
            {
                hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[j] = 0;
            }
            else
            {
#endif
                ivas_huffman_decode( &hMdDec->huff_coeffs.pred_huff_re[qsi], st0,
                                     &hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[j] );
#ifdef LBR_SBA_PLANAR
            }
#endif
        }

        if ( hMdDec->spar_hoa_md_flag )
@@ -2487,11 +2443,7 @@ static void ivas_decode_huffman_bs(

        for ( j = 0; j < drct_dim; j++ )
        {
#ifdef LBR_SBA_PLANAR
            if ( ( planarCP && !keep_planar[(int16_t) floor( j / ( ndm - 1 ) )] ) || ( ( j == 2 ) && ( ivas_total_brate < IVAS_24k4 ) ) )
#else
            if ( planarCP && !keep_planar[(int16_t) floor( j / ( ndm - 1 ) )] )
#endif
            {
                hMdDec->spar_md.band_coeffs_idx[i].drct_index_re[j] = 0;
            }
+0 −11
Original line number Diff line number Diff line
@@ -520,17 +520,6 @@ static ivas_error ivas_spar_enc_process(
        {
            /* WB 4TC mode bit  : disable for now*/
            push_next_indice( hMetaData, 0, 1 );
#ifdef LBR_SBA_PLANAR
            /* force planar for LBR SPAR+DirAC, then encode parameters */
            if ( hQMetaData->useLowerRes )
            {
                for ( i = hQMetaData->q_direction[0].cfg.start_band; i < hQMetaData->q_direction[0].cfg.nbands; i++ )
                {
                    /* Make sure elevation is really zero */
                    set_zero( hQMetaData->q_direction[0].band_data[i].elevation, hQMetaData->q_direction[0].cfg.nblocks );
                }
            }
#endif
            ivas_qmetadata_enc_encode( hMetaData, hQMetaData );
        }
        else
+0 −58
Original line number Diff line number Diff line
@@ -775,32 +775,14 @@ ivas_error ivas_spar_md_enc_process(
                        fprintf(stderr, "\n\n"); */
#endif
                    }
#ifdef LBR_SBA_PLANAR
                    if ( active_w_vlbr ) /* SPAR PLANAR */
                    {
                        pState->spar_md.band_coeffs[b].P_re[2] = 0.0f;
                    }
#endif
                    ivas_quant_p_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], num_ch );
                }
#ifdef LBR_SBA_PLANAR
                if ( active_w_vlbr ) /* SPAR PLANAR */
                {
                    pState->spar_md.band_coeffs[b].pred_re[1] = 0.0f;
                }
#endif
                ivas_quant_pred_coeffs_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], num_ch );
#ifdef LBR_SBA
                if ( active_w_vlbr )
                {
                    for ( i = 0; i < 3; i++ )
                    {
#ifdef LBR_SBA_PLANAR
                        if ( i == 1 ) /* Z prediction coefficients */
                        {
                            continue;
                        }
#endif
                        int16_t i2;
                        i2 = 0;
                        switch ( i ) /* PRED (Y,Z,X) and DECD (Y,X,Z) coeffs are in different orders */
@@ -840,12 +822,6 @@ ivas_error ivas_spar_md_enc_process(
            {
                if ( ndm != num_ch )
                {
#ifdef LBR_SBA_PLANAR
                    if ( active_w_vlbr ) /* SPAR PLANAR */
                    {
                        hMdEnc->spar_md.band_coeffs[b].P_re[2] = 0.0f;
                    }
#endif
                    ivas_quant_p_per_band_dtx( hMdEnc->spar_md.band_coeffs[b].P_re, ndec, ndm, &hMdEnc->spar_md.band_coeffs_idx[b].decd_index_re[0], hMdEnc->spar_md.band_coeffs[b].P_quant_re, num_ch );
                }

@@ -853,12 +829,6 @@ ivas_error ivas_spar_md_enc_process(
                {
                    hMdEnc->spar_md.band_coeffs[b].pred_quant_re[i] = 0;
                }
#ifdef LBR_SBA_PLANAR
                if ( active_w_vlbr ) /* SPAR PLANAR */
                {
                    hMdEnc->spar_md.band_coeffs[b].pred_re[1] = 0.0f;
                }
#endif
                ivas_spar_quant_pred_coeffs_dtx( &hMdEnc->spar_md, hMdEnc->spar_md.band_coeffs[b].pred_re, ndm, hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re, num_ch - 1, hMdEnc->spar_md.band_coeffs[b].pred_quant_re );
            }
        }
@@ -1525,12 +1495,6 @@ static void ivas_get_huffman_coded_bs(
        {
            for ( j = pred_offset; j < pred_coeff_dim; j++ )
            {
#ifdef LBR_SBA_PLANAR
                if ( ( j == 1 ) && ( bands_bw == IVAS_RED_BAND_FACT ) )
                {
                    continue;
                }
#endif
                ivas_huffman_encode( &hMdEnc->huff_coeffs.pred_huff_re[qsi], hMdEnc->spar_md.band_coeffs_idx[i].pred_index_re[j], &code, &len );
                push_next_indice( hMetaData, code, len );
            }
@@ -1543,12 +1507,6 @@ static void ivas_get_huffman_coded_bs(

            for ( j = 0; j < ndec; j++ )
            {
#ifdef LBR_SBA_PLANAR
                if ( ( j == 2 ) && ( bands_bw == IVAS_RED_BAND_FACT ) )
                {
                    continue;
                }
#endif
                ivas_huffman_encode( &hMdEnc->huff_coeffs.decd_huff_re[qsi], hMdEnc->spar_md.band_coeffs_idx[i].decd_index_re[j], &code, &len );
                push_next_indice( hMetaData, code, len );
            }
@@ -1623,13 +1581,6 @@ static void ivas_get_arith_coded_bs(
            decd_cell_dims[i].dim2 = 1;
            decx_cell_dims[i].dim1 = ( ndec * ( ndec - 1 ) ) >> 1;
            decx_cell_dims[i].dim2 = 1;
#ifdef LBR_SBA_PLANAR
            if ( ivas_total_brate < IVAS_24k4 )
            {
                pred_cell_dims[i].dim1 -= 1;
                decd_cell_dims[i].dim1 -= 1;
            }
#endif
#ifdef LBR_SBA
        }
#endif
@@ -1664,15 +1615,6 @@ static void ivas_get_arith_coded_bs(
            }
        }
    }
#ifdef LBR_SBA_PLANAR
    if ( ivas_total_brate < IVAS_24k4 )
    {
        for ( int16_t b = 0; b < nB; b++ ) /* swap X and Z PR coefficients, then code fewer */
        {
            hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re[1] = hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re[2];
        }
    }
#endif
    ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF, planarCP );

    if ( any_diff == 1 )