From e8bc642202c10beda1ea4e93ec8492b1e39805e5 Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Fri, 8 Jan 2016 16:16:10 +0100 Subject: lavu: add AV_CEIL_RSHIFT and use it in various places Signed-off-by: Vittorio Giovara --- libavcodec/mimic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/mimic.c') diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index b8b3285050..6f43723ef6 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -392,8 +392,8 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, avctx->height = height; avctx->pix_fmt = AV_PIX_FMT_YUV420P; for (i = 0; i < 3; i++) { - ctx->num_vblocks[i] = -((-height) >> (3 + !!i)); - ctx->num_hblocks[i] = width >> (3 + !!i); + ctx->num_vblocks[i] = AV_CEIL_RSHIFT(height, 3 + !!i); + ctx->num_hblocks[i] = width >> (3 + !!i); } } else if (width != ctx->avctx->width || height != ctx->avctx->height) { avpriv_request_sample(avctx, "Resolution changing"); -- cgit v1.2.3