diff options
author | van <[email protected]> | 2008-11-08 06:50:15 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-11-08 06:50:15 +0000 |
commit | fa63e466c782f2d803cd800148fdfd266d26bfe7 (patch) | |
tree | 52bbc3e91f3ed43ee536c46ca54660a04aedb086 /libhb/decavcodec.c | |
parent | 89eef8d080649cc44a1abc7ed0a0248c6976951d (diff) |
Correct chroma size for raw video frames - width & height need to be rounded up if they're odd before dividing by 2.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1905 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index e215aef9f..81ea4996b 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -426,7 +426,7 @@ static hb_buffer_t *copy_frame( hb_work_private_t *pv, AVFrame *frame ) w = pv->job->title->width; h = pv->job->title->height; } - hb_buffer_t *buf = hb_buffer_init( w * h * 3 / 2 ); + hb_buffer_t *buf = hb_video_buffer_init( w, h ); uint8_t *dst = buf->data; if ( context->pix_fmt != PIX_FMT_YUV420P || w != context->width || @@ -449,7 +449,7 @@ static hb_buffer_t *copy_frame( hb_work_private_t *pv, AVFrame *frame ) else { dst = copy_plane( dst, frame->data[0], w, frame->linesize[0], h ); - w >>= 1; h >>= 1; + w = (w + 1) >> 1; h = (h + 1) >> 1; dst = copy_plane( dst, frame->data[1], w, frame->linesize[1], h ); dst = copy_plane( dst, frame->data[2], w, frame->linesize[2], h ); } |