diff options
author | jstebbins <[email protected]> | 2012-06-25 07:56:49 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-06-25 07:56:49 +0000 |
commit | efbf9c29a90a8590080c98a53a67cb5e98cddb02 (patch) | |
tree | 2e2e1748ea3ce9ad24fe7ba8413b43ada2ec764b /libhb/fifo.c | |
parent | 7e1d3dc3448805803138cb4fe4ad1e1c8d6f1c85 (diff) |
libhb: fix deinterlace fast problem with sources that have <mod8 alignment
avpicture_deinterlace requires that both width and height of the input
be 8 pixel aligned. Video buffers already have padding to align horizontally
to 16 pixels, but they were not padded vertically. This adds vertical
padding.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4776 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/fifo.c')
-rw-r--r-- | libhb/fifo.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c index 4859c990a..13f361260 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -389,7 +389,7 @@ hb_buffer_t * hb_buffer_copy( const hb_buffer_t * src ) static void hb_buffer_init_planes_internal( hb_buffer_t * b, uint8_t * has_plane ) { uint8_t * plane = b->data; - int p; + int p, tot = 0; for( p = 0; p < 4; p++ ) { @@ -397,11 +397,12 @@ static void hb_buffer_init_planes_internal( hb_buffer_t * b, uint8_t * has_plane { b->plane[p].data = plane; b->plane[p].stride = hb_image_stride( b->f.fmt, b->f.width, p ); - b->plane[p].height = hb_image_height( b->f.fmt, b->f.height, p ); + b->plane[p].height_stride = hb_image_height_stride( b->f.fmt, b->f.height, p ); b->plane[p].width = hb_image_width( b->f.fmt, b->f.width, p ); - b->plane[p].size = hb_image_stride( b->f.fmt, b->f.width, p ) * - hb_image_height( b->f.fmt, b->f.height, p ); + b->plane[p].height = hb_image_height( b->f.fmt, b->f.height, p ); + b->plane[p].size = b->plane[p].stride * b->plane[p].height_stride; plane += b->plane[p].size; + tot += b->plane[p].size; } } } @@ -440,7 +441,7 @@ hb_buffer_t * hb_frame_buffer_init( int pix_fmt, int width, int height ) if ( has_plane[p] ) { size += hb_image_stride( pix_fmt, width, p ) * - hb_image_height( pix_fmt, height, p ); + hb_image_height_stride( pix_fmt, height, p ); } } @@ -476,7 +477,7 @@ void hb_video_buffer_realloc( hb_buffer_t * buf, int width, int height ) if ( has_plane[p] ) { size += hb_image_stride( buf->f.fmt, width, p ) * - hb_image_height( buf->f.fmt, height, p ); + hb_image_height_stride( buf->f.fmt, height, p ); } } |