Commit d9195677 authored by multrus's avatar multrus
Browse files

[cleanup] accept OPT_SBA_DEC_PATH

parent 4d402204
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1125,10 +1125,6 @@ void apply_MCT_dec_fx(
    MCT_DEC_HANDLE hMCT,                /* i/o: MCT decoder structure                   */
    Decoder_State **sts,                /* i/o: decoder state structure                 */
    Word32 *x[MCT_MAX_CHANNELS][NB_DIV] /* i/o: decoded and dequan. spect. input to MCT */
#ifndef OPT_SBA_DEC_PATH
    ,
    Word16 q_x[MCT_MAX_CHANNELS]
#endif /* OPT_SBA_DEC_PATH */
);

void mctStereoIGF_dec_fx(
@@ -1164,11 +1160,6 @@ void stereo_decoder_tcx_fx(
    const Word16 last_core_l,          /* i  : last core for left channel              */
    const Word16 last_core_r,          /* i  : last core for right channel             */
    const Word16 tmp_plc_upmix         /* i  : indicates temp upmix for PLC decision   */
#ifndef OPT_SBA_DEC_PATH
    ,
    Word16 *q_x_ch2,
    Word16 *q_x_ch1
#endif /* OPT_SBA_DEC_PATH */
);

void v_multc_acc_32_16(
+0 −1
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@
/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
#define OPT_MCT_ENC_V3_BE
#define OPT_BIN_REND_V2_NBE
#define OPT_SBA_DEC_PATH                    /* Optimization made in SBA decoding path */
#define OPT_IVAS_FILTER_ROM                    /* Optimization made in IVAS filter table */
/* Both following 2 macros (IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST*) are independent from each other, they refer to different code blocks */
//#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version. Obsoleted by MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE. */
+0 −31
Original line number Diff line number Diff line
@@ -1779,67 +1779,36 @@ void ivas_qmetadata_to_dirac_fx(
                        }
                        ELSE
                        {
#ifndef OPT_SBA_DEC_PATH
                            Word16 tmp1, tmp4;
#endif /* OPT_SBA_DEC_PATH */
                            Word16 a, b_tmp;

                            Word16 exp_factor = 0;
                            move16();
                            a = rand_triangular_signed_fx( seed_ptr, &exp_factor ); // q = exp_factor

#ifndef OPT_SBA_DEC_PATH
                            tmp1 = mult( a, dirac_dithering_azi_scale_fx[diff_idx] ); // exp_factor + 5

                            Word32 tmp1_32 = L_deposit_h( tmp1 );
#else  /* OPT_SBA_DEC_PATH */
                            Word32 tmp1_32 = L_mult( a, dirac_dithering_azi_scale_fx[diff_idx] ); // exp_factor + 5
#endif /* OPT_SBA_DEC_PATH */
                            Word16 final_1_exp;
                            Word32 final_1_32;
#ifndef OPT_SBA_DEC_PATH
                            final_1_32 = BASOP_Util_Add_Mant32Exp( azimuth_fx, 9, tmp1_32, add( exp_factor, 5 ), &final_1_exp );
#else /* OPT_SBA_DEC_PATH */
                            Word16 norm_op1 = norm_l( azimuth_fx );
                            Word16 norm_op2 = norm_l( tmp1_32 );
                            Word16 op2_e = add( exp_factor, 5 );
                            final_1_exp = add( s_max( s_max( sub( 9, norm_op1 ), sub( op2_e, norm_op2 ) ), 0 ), 2 ); // 2 for headroom
                            final_1_32 = L_add( L_shr( azimuth_fx, sub( final_1_exp, 9 ) ), L_shr( tmp1_32, sub( final_1_exp, op2_e ) ) );

#endif                                                                                  /* OPT_SBA_DEC_PATH */
                            b_tmp = rand_triangular_signed_fx( seed_ptr, &exp_factor ); // q = exp_factor
#ifndef OPT_SBA_DEC_PATH
                            tmp4 = mult( b_tmp, dirac_dithering_ele_scale_fx[diff_idx] ); // exp_factor + 4

                            Word32 tmp4_32 = L_deposit_h( tmp4 );
#else  /* OPT_SBA_DEC_PATH */
                            Word32 tmp4_32 = L_mult( b_tmp, dirac_dithering_ele_scale_fx[diff_idx] ); // exp_factor + 4
#endif /* OPT_SBA_DEC_PATH */

                            Word16 final_2_exp;
                            Word32 final_2_32;
#ifndef OPT_SBA_DEC_PATH
                            final_2_32 = BASOP_Util_Add_Mant32Exp( elevation_fx, 9, tmp4_32, add( exp_factor, 4 ), &final_2_exp );
#else  /* OPT_SBA_DEC_PATH */
                            norm_op1 = norm_l( elevation_fx );
                            norm_op2 = norm_l( tmp4_32 );
                            op2_e = add( exp_factor, 4 );
                            final_2_exp = add( s_max( s_max( sub( 9, norm_op1 ), sub( op2_e, norm_op2 ) ), 0 ), 2 ); // 2 for headroom
                            final_2_32 = L_add( L_shr( elevation_fx, sub( final_2_exp, 9 ) ), L_shr( tmp4_32, sub( final_2_exp, op2_e ) ) );
#endif /* OPT_SBA_DEC_PATH */

#ifndef OPT_SBA_DEC_PATH
                            final_1_32 = BASOP_Util_Add_Mant32Exp( final_1_32, final_1_exp, ONE_IN_Q30, 0, &final_1_exp ); /*0.5 in q31*/
                            final_2_32 = BASOP_Util_Add_Mant32Exp( final_2_32, final_2_exp, ONE_IN_Q30, 0, &final_2_exp );

                            azi = extract_h( L_shr( final_1_32, sub( sub( 31, final_1_exp ), 16 ) ) );
                            ele = extract_h( L_shr( final_2_32, sub( sub( 31, final_2_exp ), 16 ) ) );
#else  /* OPT_SBA_DEC_PATH */
                            final_1_32 = L_add( final_1_32, L_shl( 1, sub( 30, final_1_exp ) ) ); /*0.5 in q31*/
                            final_2_32 = L_add( final_2_32, L_shl( 1, sub( 30, final_2_exp ) ) );
                            azi = extract_h( L_shr( final_1_32, sub( 15, final_1_exp ) ) );
                            ele = extract_h( L_shr( final_2_32, sub( 15, final_2_exp ) ) );
#endif /* OPT_SBA_DEC_PATH */


                            /*addition of one to compensate precision loss*/
+0 −65
Original line number Diff line number Diff line
@@ -199,9 +199,6 @@ void ivas_mct_core_dec(
    Word16 tcx_offsetFB;
    Word16 left_rect;
    Word16 L_spec;
#ifndef OPT_SBA_DEC_PATH
    Word16 scale, tmp1, tmp2;
#endif /* OPT_SBA_DEC_PATH */
#ifdef DEBUG_MCT
    float nrg[MCT_MAX_CHANNELS];
#endif
@@ -221,18 +218,10 @@ void ivas_mct_core_dec(
    move16();
    FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ )
    {
#ifndef OPT_SBA_DEC_PATH
        FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
        {
            sts[i] = hCPE[cpe_id]->hCoreCoder[ch];
            i = add( i, 1 );
        }
#else  /* OPT_SBA_DEC_PATH */
        FOR( ch = 0; ch < CPE_CHANNELS; ( ch++, i++ ) )
        {
            sts[i] = hCPE[cpe_id]->hCoreCoder[ch];
        }
#endif /* OPT_SBA_DEC_PATH */
    }

    i = 0;
@@ -278,7 +267,6 @@ void ivas_mct_core_dec(
                {
                    CONTINUE;
                }
#ifdef OPT_SBA_DEC_PATH
                IF( EQ_16( st->core, TCX_10_CORE ) )
                {
                    Word16 L_frame_2 = shr( st->L_frame, 1 );
@@ -332,43 +320,6 @@ void ivas_mct_core_dec(
                        move16();
                    }
                }
#else /* OPT_SBA_DEC_PATH */
                IF( EQ_16( st->core, TCX_10_CORE ) )
                {
                    nSubframes = NB_DIV;
                }
                ELSE
                {
                    nSubframes = 1;
                }
                move16();

                FOR( k = 0; k < nSubframes; k++ )
                {
                    L_spec = BASOP_Util_Divide1616_Scale( st->hTcxCfg->tcx_coded_lines, nSubframes, &scale );
                    L_spec = shr( L_spec, sub( 15, scale ) );

                    tmp1 = BASOP_Util_Divide1616_Scale( st->L_frame, nSubframes, &scale );
                    tmp1 = shr( tmp1, sub( 15, scale ) );
                    tmp2 = BASOP_Util_Divide1616_Scale( st->hTcxDec->L_frameTCX, nSubframes, &scale );
                    tmp2 = shr( tmp1, sub( 15, scale ) );
                    init_tcx_info_fx( st, tmp1, tmp2, k, bfi, &tcx_offset, &tcx_offsetFB, &L_frame, &L_frameTCX, &left_rect, &L_spec );

                    Word16 x_e, x_len;
                    /* mono or dual mono IGF decoding */
                    x_e = sub( 31, q_x[ch] );
                    decoder_tcx_IGF_mono_fx( st, x_fx[ch][k], &x_e, &x_len, L_frame, left_rect, bfi, k );
                    q_x[ch] = sub( 31, x_e );
                    move16();
                    FOR( i = 0; i < x_len; i++ )
                    {
                        x_fx[ch][k][i] = L_shr( x_fx[ch][k][i], sub( q_x[ch], Q11 ) );
                        move32();
                    }
                    q_x[ch] = Q11;
                    move16();
                }
#endif /* OPT_SBA_DEC_PATH */
            }
        }
        ELSE
@@ -383,23 +334,7 @@ void ivas_mct_core_dec(
         * MCT processing
         *--------------------------------------------------------------------------------*/

#ifdef OPT_SBA_DEC_PATH
        apply_MCT_dec_fx( hMCT, sts, x_fx );
#else /* OPT_SBA_DEC_PATH */
        apply_MCT_dec_fx( hMCT, sts, x_fx, q_x );
        FOR( ch = 0; ch < nChannels; ch++ )
        {
            FOR( i = 0; i < L_FRAME48k / 2; i++ )
            {
                x_fx[ch][0][i] = L_shr( x_fx[ch][0][i], sub( q_x[ch], Q11 ) );
                x_fx[ch][1][i] = L_shr( x_fx[ch][1][i], sub( q_x[ch], Q11 ) );
                move32();
                move32();
            }
            q_x[ch] = Q11;
            move16();
        }
#endif /* OPT_SBA_DEC_PATH */
    }

    pop_wmops();
+0 −22
Original line number Diff line number Diff line
@@ -166,10 +166,6 @@ static void applyGlobalILD_fx(
    Decoder_State **sts,
    MCT_DEC_HANDLE hMCT,
    Word32 *x[MCT_MAX_CHANNELS][NB_DIV]
#ifndef OPT_SBA_DEC_PATH
    ,
    Word16 q_x[MCT_MAX_CHANNELS]
#endif /* OPT_SBA_DEC_PATH */
)
{
    Word16 ch, k;
@@ -211,14 +207,8 @@ static void applyGlobalILD_fx(
            FOR( k = 0; k < nSubframes; k++ )
            {
                v_multc_fixed( x[ch][k], qratio, x[ch][k], L_subframeTCX ); // Qx - 5 + q_qratio
#ifdef OPT_SBA_DEC_PATH
                scale_sig32( x[ch][k], L_subframeTCX, sub( 5, q_qratio ) );
#endif /* OPT_SBA_DEC_PATH */
            }
#ifndef OPT_SBA_DEC_PATH
            q_x[ch] = add( sub( q_x[ch], 5 ), q_qratio );
            move16();
#endif /* OPT_SBA_DEC_PATH */
        }
        ELSE
        {
@@ -240,10 +230,6 @@ void apply_MCT_dec_fx(
    MCT_DEC_HANDLE hMCT,                /* i/o: MCT decoder structure                   */
    Decoder_State **sts,                /* i/o: decoder state structure                 */
    Word32 *x[MCT_MAX_CHANNELS][NB_DIV] /* i/o: decoded and dequan. spect. input to MCT */
#ifndef OPT_SBA_DEC_PATH
    ,
    Word16 q_x[MCT_MAX_CHANNELS]
#endif /* OPT_SBA_DEC_PATH */
)
{
    Word16 pair;
@@ -253,18 +239,10 @@ void apply_MCT_dec_fx(
    {
        hBlock = hMCT->hBlockData[pair];

#ifndef OPT_SBA_DEC_PATH
        stereo_decoder_tcx_fx( hBlock->hStereoMdct, hBlock->mask, &x[hBlock->ch2][0], &x[hBlock->ch1][0], &x[hBlock->ch2][0], hBlock->hStereoMdct->mdct_stereo_mode, sts[hBlock->ch1]->core, sts[hBlock->ch2]->core, sts[0]->igf, sts[0]->hTcxDec->L_frameTCX, sts[1]->hTcxDec->L_frameTCX, 1, TCX_20_CORE, TCX_20_CORE, 0, &q_x[hBlock->ch2], &q_x[hBlock->ch1] );
#else  /* OPT_SBA_DEC_PATH */
        stereo_decoder_tcx_fx( hBlock->hStereoMdct, hBlock->mask, &x[hBlock->ch2][0], &x[hBlock->ch1][0], &x[hBlock->ch2][0], hBlock->hStereoMdct->mdct_stereo_mode, sts[hBlock->ch1]->core, sts[hBlock->ch2]->core, sts[0]->igf, sts[0]->hTcxDec->L_frameTCX, sts[1]->hTcxDec->L_frameTCX, 1, TCX_20_CORE, TCX_20_CORE, 0 );
#endif /* OPT_SBA_DEC_PATH */
    }

#ifndef OPT_SBA_DEC_PATH
    applyGlobalILD_fx( sts, hMCT, x, q_x );
#else  /* OPT_SBA_DEC_PATH */
    applyGlobalILD_fx( sts, hMCT, x );
#endif /* OPT_SBA_DEC_PATH */

    return;
}
Loading