summaryrefslogtreecommitdiffstats
path: root/libhb/rendersub.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-01-10 22:03:15 +0000
committerjstebbins <[email protected]>2015-01-10 22:03:15 +0000
commit30a9cd68e49438d691be9a87b829160e2eb0ab85 (patch)
tree8ee54af623768148074211221e7b24db42a4276c /libhb/rendersub.c
parente893c87e5ce55af2ceb2d9a0291f614ea312d0d1 (diff)
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
Diffstat (limited to 'libhb/rendersub.c')
-rw-r--r--libhb/rendersub.c6
1 files changed, 3 insertions, 3 deletions
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;
}
}
}