diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c
index 1c9dbcb2272cd35d153b32f7f9dbd4e8d99e9956..1bb4680083384e4f72829a5ebefb3f70d40e62db 100644
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -343,9 +343,9 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
       {
          int id;
 #ifdef FIXED_POINT
-         id = IMAX(0,IMIN(127,MULT16_32_Q15(tmp[i],norm))); /* Do not round to nearest */
+         id = MAX32(0,MIN32(127,MULT16_32_Q15(tmp[i]+EPSILON,norm))); /* Do not round to nearest */
 #else
-         id = IMAX(0,IMIN(127,(int)floor(64*norm*tmp[i]))); /* Do not round to nearest */
+         id = (int)MAX32(0,MIN32(127,floor(64*norm*(tmp[i]+EPSILON)))); /* Do not round to nearest */
 #endif
          unmask += inv_table[id];
       }