Commit 3d860400 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for SSNR deviation observed for one STV case

parent d762be63
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1251,6 +1251,7 @@ Word16 RCcontextMapping_encode2_estimate_no_mem_s17_LCS_fx(

#ifdef OPT_SBA_ENC_V2_BE
    Word16 round_bit_estimate_fx;
    Word32 target_Q15 = L_shl( target, Q15 ); // Q15
#endif

    WHILE( LT_16( k, nt / 2 ) )
@@ -1388,7 +1389,7 @@ Word16 RCcontextMapping_encode2_estimate_no_mem_s17_LCS_fx(
            bit_estimate_fx = W_add( bit_estimate_fx, ari_bit_estimate_s17_LC_fx[pki][symbol] );

#ifdef OPT_SBA_ENC_V2_BE
            IF( GT_64( bit_estimate_fx, W_shl( target, Q23 ) ) ) // Q23
            IF( GT_32( W_shl_sat_l( bit_estimate_fx, -Q8 ), target_Q15 ) ) // Q15
#else
            /* Should we truncate? */
            IF( GT_32( W_extract_l( W_shr( bit_estimate_fx, Q8 ) ), L_shl( target, Q15 ) ) )
@@ -1607,7 +1608,7 @@ Word16 RCcontextMapping_encode2_estimate_no_mem_s17_LCS_fx(

            /* Should we truncate? */
#ifdef OPT_SBA_ENC_V2_BE
            IF( GT_64( bit_estimate_fx, W_shl( target, Q23 ) ) ) // Q23
            IF( GT_32( W_shl_sat_l( bit_estimate_fx, -Q8 ), target_Q15 ) ) // Q15
#else
            IF( GT_32( W_extract_l( W_shr( bit_estimate_fx, Q8 ) ), L_shl( target, Q15 ) ) )
#endif