fix CLIP_S16

Change-Id: Iec059e0f2790e07243d9890232459c52869836cd
diff --git a/common/armv8/impeg2_platform_macros.h b/common/armv8/impeg2_platform_macros.h
index ff31034..be1f8d8 100644
--- a/common/armv8/impeg2_platform_macros.h
+++ b/common/armv8/impeg2_platform_macros.h
@@ -41,7 +41,7 @@
 #define CLIP_S12(x) ((x) > 2047) ? (2047) : (((x) < -2048) ? (-2048) : (x))
 
 #define CLIP_U16(x) ((x) > 65535) ? (65535) : (((x) < 0) ? (0) : (x))
-#define CLIP_S16(x) ((x) > 65535) ? (65535) : (((x) < -65536) ? (-65536) : (x))
+#define CLIP_S16(x) ((x) > 32767) ? (32767) : (((x) < -32768) ? (-32768) : (x))
 
 #define INLINE
 #define PLD(x) __pld(x)
diff --git a/common/mips/impeg2_platform_macros.h b/common/mips/impeg2_platform_macros.h
index 05ff6da..183f1fa 100644
--- a/common/mips/impeg2_platform_macros.h
+++ b/common/mips/impeg2_platform_macros.h
@@ -41,7 +41,7 @@
 #define CLIP_S12(x) ((x) > 2047) ? (2047) : (((x) < -2048) ? (-2048) : (x))
 
 #define CLIP_U16(x) ((x) > 65535) ? (65535) : (((x) < 0) ? (0) : (x))
-#define CLIP_S16(x) ((x) > 65535) ? (65535) : (((x) < -65536) ? (-65536) : (x))
+#define CLIP_S16(x) ((x) > 32767) ? (32767) : (((x) < -32768) ? (-32768) : (x))
 #define PLD(x)
 
 #define INLINE
diff --git a/common/x86/impeg2_platform_macros.h b/common/x86/impeg2_platform_macros.h
index 05ff6da..183f1fa 100644
--- a/common/x86/impeg2_platform_macros.h
+++ b/common/x86/impeg2_platform_macros.h
@@ -41,7 +41,7 @@
 #define CLIP_S12(x) ((x) > 2047) ? (2047) : (((x) < -2048) ? (-2048) : (x))
 
 #define CLIP_U16(x) ((x) > 65535) ? (65535) : (((x) < 0) ? (0) : (x))
-#define CLIP_S16(x) ((x) > 65535) ? (65535) : (((x) < -65536) ? (-65536) : (x))
+#define CLIP_S16(x) ((x) > 32767) ? (32767) : (((x) < -32768) ? (-32768) : (x))
 #define PLD(x)
 
 #define INLINE