[MPlayer-dev-eng] [PATCH] deobfuscate vf_scale

Oded Shimon ods15 at ods15.dyndns.org
Sat Dec 17 20:36:33 CET 2005


Just found this old patch I made, this code is completely unnecessarily 
obfuscated, small patch here makes it much more readable and keeps same 
behavior.
The actual behavior preserved here, to all the 0, -1, -2, and -3 options in 
vf_scale, you can add -8 (so, -8, -9, -10 and -11) to get rounding.

Is anyone against this?.. Compiled and tested, works fine.

- ods15
-------------- next part --------------
Index: libmpcodecs/vf_scale.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v
retrieving revision 1.58
diff -u -r1.58 vf_scale.c
--- libmpcodecs/vf_scale.c	6 Mar 2005 21:15:24 -0000	1.58
+++ libmpcodecs/vf_scale.c	7 Mar 2005 11:48:55 -0000
@@ -144,12 +144,12 @@
 	}
     }
 
-    if (vf->priv->w < 0 && (-vf->priv->w & 8)) {
-      vf->priv->w = -(-vf->priv->w & ~8);
+    if (vf->priv->w <= -8) {
+      vf->priv->w += 8;
       round_w = 1;
     }
-    if (vf->priv->h < 0 && (-vf->priv->h & 8)) {
-      vf->priv->h = -(-vf->priv->h & ~8);
+    if (vf->priv->h <= -8) {
+      vf->priv->h += 8;
       round_h = 1;
     }
 


More information about the MPlayer-dev-eng mailing list