changeset 9995:62d643bc53e2

optimization -- lots of conditional jumps in inner loops are bad
author rfelker
date Sat, 26 Apr 2003 18:31:08 +0000
parents 275766100443
children d3c784482170
files libmpcodecs/vf_ivtc.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_ivtc.c	Sat Apr 26 16:56:21 2003 +0000
+++ b/libmpcodecs/vf_ivtc.c	Sat Apr 26 18:31:08 2003 +0000
@@ -238,7 +238,8 @@
 #endif
 
 //#define MAG(a) ((a)*(a))
-#define MAG(a) (abs(a))
+//#define MAG(a) (abs(a))
+#define MAG(a) (((a)^((a)>>31))-((a)>>31))
 
 //#define LOWPASS(s) (((s)[-2] + 4*(s)[-1] + 6*(s)[0] + 4*(s)[1] + (s)[2])>>4)
 //#define LOWPASS(s) (((s)[-1] + 2*(s)[0] + (s)[1])>>2)