From fa63e466c782f2d803cd800148fdfd266d26bfe7 Mon Sep 17 00:00:00 2001 From: van Date: Sat, 8 Nov 2008 06:50:15 +0000 Subject: 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 --- libhb/enctheora.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libhb/enctheora.c') diff --git a/libhb/enctheora.c b/libhb/enctheora.c index 274887f9f..c2df9d9a6 100644 --- a/libhb/enctheora.c +++ b/libhb/enctheora.c @@ -142,13 +142,13 @@ int enctheoraWork( hb_work_object_t * w, hb_buffer_t ** buf_in, yuv.y_height = job->height; yuv.y_stride = job->width; - yuv.uv_width = job->width / 2; - yuv.uv_height = job->height / 2; - yuv.uv_stride = job->width / 2; + yuv.uv_width = (job->width + 1) / 2; + yuv.uv_height = (job->height + 1) / 2; + yuv.uv_stride = yuv.uv_width; yuv.y = in->data; yuv.u = in->data + job->width * job->height; - yuv.v = in->data + job->width * job->height * 5/4; + yuv.v = in->data + yuv.uv_width * yuv.uv_height; theora_encode_YUVin(&pv->theora, &yuv); -- cgit v1.2.3