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/enctheora.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/enctheora.c')
-rw-r--r-- | libhb/enctheora.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |