projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d35b6cd
)
yuv4mpeg: Correctly round chroma up for odd luma sizes
author
Ronald S. Bultje
<rsbultje@gmail.com>
Mon, 24 Jun 2013 23:13:58 +0000
(19:13 -0400)
committer
Martin Storsjö
<martin@martin.st>
Sun, 7 Jul 2013 10:30:22 +0000
(13:30 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/yuv4mpeg.c
patch
|
blob
|
history
diff --git
a/libavformat/yuv4mpeg.c
b/libavformat/yuv4mpeg.c
index
699a63a
..
c38d641
100644
(file)
--- a/
libavformat/yuv4mpeg.c
+++ b/
libavformat/yuv4mpeg.c
@@
-132,8
+132,9
@@
static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
// Adjust for smaller Cb and Cr planes
av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
&v_chroma_shift);
- width >>= h_chroma_shift;
- height >>= v_chroma_shift;
+ // Shift right, rounding up
+ width = -(-width >> h_chroma_shift);
+ height = -(-height >> v_chroma_shift);
ptr1 = picture->data[1];
ptr2 = picture->data[2];