summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1enc.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2016-01-08 16:16:10 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2016-01-11 15:32:56 -0500
commite8bc642202c10beda1ea4e93ec8492b1e39805e5 (patch)
treefa974fb54c3d1b8bfb244f7ac0bce6e95e2ccdd6 /libavcodec/ffv1enc.c
parent7570c9e04f010c9b3bfdeb4338d330f2cdd25278 (diff)
downloadffmpeg-e8bc642202c10beda1ea4e93ec8492b1e39805e5.tar.gz
lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r--libavcodec/ffv1enc.c4
1 files changed, 2 insertions, 2 deletions
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;