Commit 96cd8550 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 1870-basop-PortFlpMr1860

parents f8bf262f 8528dc65
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -271,7 +271,11 @@ void tcx_arith_scale_envelope(

    tmp2 = BASOP_Util_Add_MantExp( negate( b ), b_e, tmp, tmp2, &scale ); /* exp(scale) */
    scale = BASOP_Util_Divide1616_Scale( scale, round_fx( a ), &tmp );
#ifdef ISSUE_1796_replace_shl_o
    scale = shl_sat( scale, sub( sub( add( tmp, tmp2 ), a_e ), 1 ) ); /* Q15 */
#else
    scale = shl_o( scale, sub( sub( add( tmp, tmp2 ), a_e ), 1 ), &Overflow ); /* Q15 */
#endif

    /* iscale = 1.0f / scale; */
    iscale_e = 0;
+7 −1
Original line number Diff line number Diff line
@@ -245,9 +245,11 @@ Word16 BitAllocF_fx(
    Word16 tmp, exp1, exp2;
    Word32 Rsubband_w32_fx[NB_SFM]; /* Q15  */
    Word16 B_w16_fx;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif

    set32_fx( Rsubband_w32_fx, 0, NB_SFM );
@@ -442,7 +444,11 @@ Word16 BitAllocF_fx(
            exp1 = sub( norm_l( L_tmp2 ), 1 );
            exp2 = norm_s( n );
            tmp = div_s( extract_h( L_shl( L_tmp2, exp1 ) ), shl( n, exp2 ) ); /*15 + 15 + exp1 - 16 - exp2*/
#ifdef ISSUE_1796_replace_shl_o
            m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/
#else
            m_fx = shl_o( tmp, sub( exp2, exp1 ), &Overflow ); /*Q14*/
#endif
            if ( L_tmp1 < 0 )
            {
                m_fx = negate( m_fx );
+8 −0
Original line number Diff line number Diff line
@@ -1329,7 +1329,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead)
        {
            FOR( j = 20; j < numberBandsM; j++ )
            {
#ifdef ISSUE_1799_replace_L_shr_o
                nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
                nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
            }
        }

@@ -1352,7 +1356,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead)
        {
            FOR( j = 20; j < numberBandsM; j++ )
            {
#ifdef ISSUE_1799_replace_L_shr_o
                nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
                nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
            }
        }

+8 −0
Original line number Diff line number Diff line
@@ -1590,7 +1590,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e
        {
            FOR( j = 20; j < numberBandsM; j++ )
            {
#ifdef ISSUE_1799_replace_L_shr_o
                nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
                nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
            }
        }

@@ -1613,7 +1617,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e
        {
            FOR( j = 20; j < numberBandsM; j++ )
            {
#ifdef ISSUE_1799_replace_L_shr_o
                nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
                nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
            }
        }

+32 −4
Original line number Diff line number Diff line
@@ -904,7 +904,11 @@ void cng_params_upd_fx(
            tmpv = shl( *pt_exc2, scale );
            L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
            pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
            L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#else
            L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow );                                         /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#endif
        }
    }
    ELSE /* L_FRAME16k */
@@ -917,10 +921,18 @@ void cng_params_upd_fx(
            tmpv = shl( *pt_exc2, scale );
            L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
            pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
            L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#else
            L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#endif
        }
    }
#ifdef ISSUE_1799_replace_L_shr_o
    L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#else
    L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow );                                        /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#endif

    /* update the circular buffer of old energies */
    ho_ener_circ[*ho_circ_ptr] = L_ener;
@@ -1082,7 +1094,11 @@ void cng_params_upd_ivas_fx(
            tmpv = shl( *pt_exc2, scale );
            L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
            pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
            L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#else
            L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow );                                         /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#endif
        }
    }
    ELSE /* L_FRAME16k */
@@ -1095,10 +1111,18 @@ void cng_params_upd_ivas_fx(
            tmpv = shl( *pt_exc2, scale );
            L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
            pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
            L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#else
            L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#endif
        }
    }
#ifdef ISSUE_1799_replace_L_shr_o
    L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#else
    L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow );                                        /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#endif

    /* update the circular buffer of old energies */
    ho_ener_circ[*ho_circ_ptr] = L_ener;
@@ -1137,7 +1161,11 @@ void cng_params_upd_ivas_fx(
            L_tmp = L_add_o( L_tmp, L_tmp, &Overflow );                             /* 2*Q_exc+1 */
            L_tmp = Mult_32_16( L_tmp, 128 );                                       /* 2*Q_exc+1 */
            tmp = add( add( Q_exc, Q_exc ), 1 );
#ifdef ISSUE_1799_replace_L_shr_o
            sp[i] = L_shr_sat( L_tmp, sub( tmp, 6 ) );
#else
            sp[i] = L_shr_o( L_tmp, sub( tmp, 6 ), &Overflow );
#endif
            move32(); /* Q6 */
            ptR++;
            ptI--;
Loading