[FFmpeg-cvslog] yuv4mpegenc: Use AV_CEIL_RSHIFT where needed
Vittorio Giovara
git at videolan.org
Tue Feb 16 17:57:50 CET 2016
ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Thu Jan 21 17:47:03 2016 -0500| [e80307140f736f593ee643affa015333d7c5e27f] | committer: Vittorio Giovara
yuv4mpegenc: Use AV_CEIL_RSHIFT where needed
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e80307140f736f593ee643affa015333d7c5e27f
---
libavformat/yuv4mpegenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index ef1e775..83f79d2 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -129,8 +129,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
&v_chroma_shift);
// Shift right, rounding up
- width = -(-width >> h_chroma_shift);
- height = -(-height >> v_chroma_shift);
+ width = AV_CEIL_RSHIFT(width, h_chroma_shift);
+ height = AV_CEIL_RSHIFT(height, v_chroma_shift);
ptr1 = frame->data[1];
ptr2 = frame->data[2];
More information about the ffmpeg-cvslog
mailing list