Commit 6b6895a1 authored by vaclav's avatar vaclav
Browse files

simplifications within HARMONIZE_TBE3

parent 9580ea64
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -5265,11 +5265,7 @@ void swb_tbe_dec_ivas_fx(
    move16();

    test();
#ifdef HARMONIZE_TBE3
    IF( st->element_mode > EVS_MONO && ( EQ_32( st->extl_brate, SWB_TBE_1k10 ) || EQ_32( st->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st->extl_brate, SWB_TBE_1k10 ) || EQ_32( st->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        Word32 vind_temp = Mpy_32_32( L_shl( L_add( L_deposit_l( mixFactors_fx ), 1 ), 15 ), ( ( ( 1 << NUM_BITS_SHB_VF ) - 1 ) << 16 ) ); // check addition of 1
        vind = extract_l( L_shr( vind_temp, 15 ) ); /* 3 for mpy by 8.0f, -15 to bring it to Q0 */                                         /*mixFactors*7*/
@@ -5463,12 +5459,7 @@ void swb_tbe_dec_ivas_fx(
    }

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st->element_mode == EVS_MONO || ( NE_32( st->extl_brate, SWB_TBE_1k10 ) && NE_32( st->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( NE_32( st->extl_brate, SWB_TBE_1k10 ) && NE_32( st->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        FOR( i = 0; i < L_FRAME16k; i += L_SUBFR16k )
        {
@@ -5982,12 +5973,7 @@ void swb_tbe_dec_ivas_fx(

    /* Gain shape smoothing after quantization */
    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st->element_mode != EVS_MONO && ( EQ_32( st->extl_brate, SWB_TBE_1k10 ) || EQ_32( st->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st->extl_brate, SWB_TBE_1k10 ) || EQ_32( st->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        FOR( i = 0; i < NUM_SHB_SUBGAINS; i++ )
        {
+0 −67
Original line number Diff line number Diff line
@@ -2783,9 +2783,6 @@ void swb_tbe_enc_ivas_fx(
    shb_ener_sf_Q31 = 0;
    move16();
    test();
#ifdef HARMONIZE_TBE3
    test();
#endif
    IF( GE_32( st_fx->extl_brate, SWB_TBE_2k8 ) )
    {
        /* ---------- SHB LSP interpolation ---------- */
@@ -2862,11 +2859,7 @@ void swb_tbe_enc_ivas_fx(

        Quant_shb_res_gshape_fx( st_fx, shb_res_gshape_fx );
    }
#ifdef HARMONIZE_TBE3
    ELSE IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    ELSE IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        FOR( j = 0; j < 4; j++ )
        {
@@ -2902,12 +2895,7 @@ void swb_tbe_enc_ivas_fx(
    move16();

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        /* calculate the TD envelope of the SHB residual signal */
        Scale_sig( hBWE_TD->mem_shb_res_fx, MAX_LEN_MA_FILTER, sub( hBWE_TD->prev_Q_shb, Q_shb ) ); /* Q(hBWE_TD->prev_Q_shb) -> Q(Q_shb) */
@@ -3258,12 +3246,7 @@ void swb_tbe_enc_ivas_fx(
    }

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode == EVS_MONO || ( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        FOR( i = 0; i < L_FRAME16k; i += L_SUBFR16k )
        {
@@ -3423,12 +3406,7 @@ void swb_tbe_enc_ivas_fx(
#endif

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        /* Gain shape attenuation in case of big error in envelope modelling */
        FOR( i = 0; i < NUM_SHB_SUBGAINS; i++ )
@@ -3445,12 +3423,7 @@ void swb_tbe_enc_ivas_fx(
    }

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode == EVS_MONO || ( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        /* Gain shape BWS/high band low energy fix */
        IF( LT_16( hBWE_TD->cldfbHBLT, 8192 /*1.0f Q13*/ ) ) /* cldfbHBLT in Q13 */
@@ -3466,12 +3439,7 @@ void swb_tbe_enc_ivas_fx(

    /* high-band gain control in case of BWS */
    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#else
    IF( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        IF( st_fx->bwidth_sw_cnt > 0 )
        {
@@ -3615,12 +3583,7 @@ void swb_tbe_enc_ivas_fx(
    }

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        test();
        test();
@@ -3674,12 +3637,7 @@ void swb_tbe_enc_ivas_fx(
    }

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        /* Re-normalize gain shape before quantization */
        tmp = 0;
@@ -3729,12 +3687,7 @@ void swb_tbe_enc_ivas_fx(
    }

    /* Gain shape smoothing after quantization */
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        FOR( i = 0; i < NUM_SHB_SUBGAINS; i++ )
        {
@@ -3800,12 +3753,7 @@ void swb_tbe_enc_ivas_fx(
    }

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        test();
        test();
@@ -3885,12 +3833,7 @@ void swb_tbe_enc_ivas_fx(
    tmp = mult_r( 25600 /*400 Q6*/, sd_uq_q_fx ); /* Q6 * Q15 => Q6 */

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( EQ_32( st_fx->extl_brate, SWB_TBE_1k10 ) || EQ_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        tmp1 = mult_r( 22938 /*0.7f Q15*/, tmp );       /* Q15, Q6  => Q6 */
        L_tmp = L_msu( 8192l /*1.0f Q13*/, tmp1, tmp ); /* Q13 */
@@ -3914,12 +3857,7 @@ void swb_tbe_enc_ivas_fx(
    /* keep the L_tmp; dont overwrite */

    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode == EVS_MONO || ( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        /* pitBufAvg =  0.0025f * sum_f(pitch_buf, 4); */
        /* pitch_buf: Q6 */
@@ -3980,12 +3918,7 @@ void swb_tbe_enc_ivas_fx(

    /* high-band gain control in case of BWS */
    test();
#ifdef HARMONIZE_TBE3
    test();
    IF( st_fx->element_mode != EVS_MONO && ( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) ) )
#else
    IF( NE_32( st_fx->extl_brate, SWB_TBE_1k10 ) && NE_32( st_fx->extl_brate, SWB_TBE_1k75 ) )
#endif
    {
        IF( st_fx->bwidth_sw_cnt > 0 )
        {