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/ffv1enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/ffv1enc.c') diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 0158605b91..061e90829f 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -897,8 +897,8 @@ static int encode_slice(AVCodecContext *c, void *arg) } if (f->colorspace == 0) { - const int chroma_width = -((-width) >> f->chroma_h_shift); - const int chroma_height = -((-height) >> f->chroma_v_shift); + const int chroma_width = AV_CEIL_RSHIFT(width, f->chroma_h_shift); + const int chroma_height = AV_CEIL_RSHIFT(height, f->chroma_v_shift); const int cx = x >> f->chroma_h_shift; const int cy = y >> f->chroma_v_shift; -- cgit v1.2.3