summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-07-18 18:45:05 +0000
committerjstebbins <[email protected]>2012-07-18 18:45:05 +0000
commita5fcca4c60638eb25f497a60067b39b6cea400e4 (patch)
tree2c20d9c0be9e42f0edd1f48aa902b98e6041396b /libhb/hb.c
parent334edb802327776d74cbb546507c3f214ba8a784 (diff)
libhb: fix deinterlace fast green stripe
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4865 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index ef3f15edf..4c9ca4a1c 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -820,19 +820,19 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
if( job->deinterlace )
{
+ int width = (in_buf->plane[0].width + 3) & ~0x3;
+ int height = (in_buf->plane[0].height + 3) & ~0x3;
+
// Deinterlace and crop
- // avpicture_deinterlace requires width & height that are 8 byte
- // alligned. This means the left and bottom edges of the preview
- // will not get deinterlaced or transfered into the output buffer
- // by avpicture_deinterlace. So copy the original frame into
- // the deinterlace buffer so we don't see uninitialized data in
- // the resulting image.
+ // avpicture_deinterlace requires 4 pixel aligned width and height
+ // we have aligned all buffers to 16 byte width and height strides
+ // so there is room in the buffers to accomodate a litte
+ // overscan.
deint_buf = hb_frame_buffer_init( PIX_FMT_YUV420P,
title->width, title->height );
hb_avpicture_fill( &pic_deint, deint_buf );
-
avpicture_deinterlace( &pic_deint, &pic_in, PIX_FMT_YUV420P,
- in_buf->plane[0].stride, in_buf->plane[0].height_stride );
+ width, height );
av_picture_crop( &pic_crop, &pic_deint, PIX_FMT_YUV420P,
job->crop[0], job->crop[2] );