[MPlayer-cvslog] r28835 - trunk/libass/ass_render.c

greg subversion at mplayerhq.hu
Fri Mar 6 02:26:47 CET 2009


Author: greg
Date: Fri Mar  6 02:26:44 2009
New Revision: 28835

Log:
Replace magic numbers (for subpixel accuracy masking) with a define.

Modified:
   trunk/libass/ass_render.c

Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c	Fri Mar  6 02:17:05 2009	(r28834)
+++ trunk/libass/ass_render.c	Fri Mar  6 02:26:44 2009	(r28835)
@@ -45,6 +45,7 @@
 #define MAX_LINES 300
 #define BLUR_MAX_RADIUS 50.0
 #define ROUND(x) ((int) ((x) + .5))
+#define SUBPIXEL_MASK 56	// d6 bitmask for subpixel accuracy adjustment
 
 static int last_render_id = 0;
 
@@ -1964,12 +1965,12 @@ static int ass_render_event(ass_event_t*
 			pen.y += delta.y * render_context.scale_y;
 		}
 
-		shift.x = pen.x & 56;
-		shift.y = pen.y & 56;
+		shift.x = pen.x & SUBPIXEL_MASK;
+		shift.y = pen.y & SUBPIXEL_MASK;
 
 		if (render_context.evt_type == EVENT_POSITIONED) {
-			shift.x += double_to_d6(x2scr_pos(render_context.pos_x)) & 56;
-			shift.y -= double_to_d6(y2scr_pos(render_context.pos_y)) & 56;
+			shift.x += double_to_d6(x2scr_pos(render_context.pos_x)) & SUBPIXEL_MASK;
+			shift.y -= double_to_d6(y2scr_pos(render_context.pos_y)) & SUBPIXEL_MASK;
 		}
 
 		ass_font_set_transform(render_context.font,



More information about the MPlayer-cvslog mailing list