summaryrefslogtreecommitdiffstats
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
parent334edb802327776d74cbb546507c3f214ba8a784 (diff)
libhb: fix deinterlace fast green stripe
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4865 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/deinterlace.c11
-rw-r--r--libhb/hb.c16
2 files changed, 15 insertions, 12 deletions
diff --git a/libhb/deinterlace.c b/libhb/deinterlace.c
index ee410a1cf..095693ab1 100644
--- a/libhb/deinterlace.c
+++ b/libhb/deinterlace.c
@@ -534,14 +534,17 @@ static int hb_deinterlace_work( hb_filter_object_t * filter,
/* Use libavcodec deinterlace if yadif_mode < 0 */
if( !( pv->yadif_mode & MODE_YADIF_ENABLE ) )
{
+ int width = (pv->buf_out[0]->plane[0].width + 3) & ~0x3;
+ int height = (pv->buf_out[0]->plane[0].height + 3) & ~0x3;
+
hb_avpicture_fill( &pic_out, pv->buf_out[0] );
- // avpicture_deinterlace requires 8 byte aligned width and height
+ // avpicture_deinterlace requires 4 pixel aligned width and height
// we have aligned all buffers to 16 byte width and height strides
- // so use the image stride when deinterlacing
+ // so there is room in the buffers to accomodate a litte
+ // overscan.
avpicture_deinterlace( &pic_out, &pic_in, pv->buf_out[0]->f.fmt,
- pv->buf_out[0]->plane[0].stride,
- pv->buf_out[0]->plane[0].height_stride );
+ width, height );
pv->buf_out[0]->s = in->s;
hb_buffer_move_subs( pv->buf_out[0], in );
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] );