From 30a9cd68e49438d691be9a87b829160e2eb0ab85 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Sat, 10 Jan 2015 22:03:15 +0000 Subject: rendersub: fix small blending error The error is really small, but visible over some backgrounds. See https://forum.handbrake.fr/viewtopic.php?f=5&t=30942 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6726 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/rendersub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libhb/rendersub.c') diff --git a/libhb/rendersub.c b/libhb/rendersub.c index 6bf56f451..ac05f635a 100644 --- a/libhb/rendersub.c +++ b/libhb/rendersub.c @@ -136,7 +136,7 @@ static void blend( hb_buffer_t *dst, hb_buffer_t *src, int left, int top ) */ y_out[left + xx] = ( (uint16_t)y_out[left + xx] * ( 255 - alpha ) + - (uint16_t)y_in[xx] * alpha ) >> 8; + (uint16_t)y_in[xx] * alpha ) / 255; } } @@ -164,12 +164,12 @@ static void blend( hb_buffer_t *dst, hb_buffer_t *src, int left, int top ) // Blend averge U and alpha u_out[(left >> wshift) + xx] = ( (uint16_t)u_out[(left >> wshift) + xx] * ( 255 - alpha ) + - (uint16_t)u_in[xx] * alpha ) >> 8; + (uint16_t)u_in[xx] * alpha ) / 255; // Blend V and alpha v_out[(left >> wshift) + xx] = ( (uint16_t)v_out[(left >> wshift) + xx] * ( 255 - alpha ) + - (uint16_t)v_in[xx] * alpha ) >> 8; + (uint16_t)v_in[xx] * alpha ) / 255; } } } -- cgit v1.2.3