Commit e2828fc0 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

arith_coder_fx.c : changed void tcx_arith_scale_envelope

parent ccd194e7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ 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
#ifdef ISSUE_1836_replace_overflow_libcom
    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 */
@@ -334,7 +334,11 @@ void tcx_arith_scale_envelope(
                L_tmp = L_add( L_tmp, L_shl( Mpy_32_16_1( env[k], mult_r( 1147 /*0.035f Q15*/, iscale ) ), iscale_e ) ); /* Q16 */

                tmp = norm_l( L_tmp );
#ifdef ISSUE_1836_replace_overflow_libcom
                statesi = mult_r( statesi, round_fx_sat( L_shl( L_tmp, tmp ) ) );
#else
                statesi = mult_r( statesi, round_fx_o( L_shl_o( L_tmp, tmp, &Overflow ), &Overflow ) );
#endif
                bits = add( bits, sub( 15, tmp ) );

                tmp = norm_s( statesi );