diff options
author | jstebbins <[email protected]> | 2012-04-10 18:27:33 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-04-10 18:27:33 +0000 |
commit | 07a54cd602c6a1c5bdc2f43478e22cd211a1d62b (patch) | |
tree | 6774bce87ef4d9d2f840b23d6e978950a84c7953 /libhb/rendersub.c | |
parent | 9b3008bfb0e1902e4ab01b680c7475d1630e9544 (diff) |
libhb: fix problem with rendering burned in subtitles
Remove unnecessary test of uninitialized alpha channel pointer. If the
uninitialized value was NULL, alpha wasn't factored into the blend.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4584 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/rendersub.c')
-rw-r--r-- | libhb/rendersub.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/libhb/rendersub.c b/libhb/rendersub.c index e10177fc9..1536e03c6 100644 --- a/libhb/rendersub.c +++ b/libhb/rendersub.c @@ -95,22 +95,10 @@ static void blend( hb_buffer_t *dst, hb_buffer_t *src, int left, int top ) { y_in = src->plane[0].data + yy * src->plane[0].stride; y_out = dst->plane[0].data + ( yy + top ) * dst->plane[0].stride; - if( a_in ) - { - a_in = src->plane[3].data + yy * src->plane[3].stride; - } + a_in = src->plane[3].data + yy * src->plane[3].stride; for( xx = x0; xx < ww; xx++ ) { - if( a_in ) - { - alpha = a_in[xx]; - } - else - { - // If source has no alpha channel, use 50% - alpha = 128; - } - + alpha = a_in[xx]; /* * Merge the luminance and alpha with the picture */ @@ -134,22 +122,11 @@ static void blend( hb_buffer_t *dst, hb_buffer_t *src, int left, int top ) u_out = dst->plane[1].data + ( yy + ( top >> hshift ) ) * dst->plane[1].stride; v_in = src->plane[2].data + yy * src->plane[2].stride; v_out = dst->plane[2].data + ( yy + ( top >> hshift ) ) * dst->plane[2].stride; - if( a_in ) - { - a_in = src->plane[3].data + ( yy << hshift ) * src->plane[3].stride; - } + a_in = src->plane[3].data + ( yy << hshift ) * src->plane[3].stride; for( xx = x0 >> wshift; xx < ww >> wshift; xx++ ) { - if( a_in ) - { - alpha = a_in[xx << wshift]; - } - else - { - // If source has no alpha channel, use 50% - alpha = 128; - } + alpha = a_in[xx << wshift]; // Blend averge U and alpha u_out[(left >> wshift) + xx] = @@ -404,7 +381,7 @@ static void ApplySSASubs( hb_filter_private_t * pv, hb_buffer_t * buf ) buf->s.start / 90, NULL ); if ( !frameList ) return; - + ASS_Image *frame; for (frame = frameList; frame; frame = frame->next) { sub = RenderSSAFrame( frame ); |