summaryrefslogtreecommitdiffstats
path: root/libavcodec
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
parent7570c9e04f010c9b3bfdeb4338d330f2cdd25278 (diff)
downloadffmpeg-streaming-e8bc642202c10beda1ea4e93ec8492b1e39805e5.zip
ffmpeg-streaming-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')
-rw-r--r--libavcodec/ffv1dec.c4
-rw-r--r--libavcodec/ffv1enc.c4
-rw-r--r--libavcodec/mimic.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index d32da60..467fd0d 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -375,8 +375,8 @@ static int decode_slice(AVCodecContext *c, void *arg)
av_assert1(width && height);
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;
decode_plane(fs, p->data[0] + ps * x + y * p->linesize[0], width,
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 0158605..061e908 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;
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index b8b3285..6f43723 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");
OpenPOWER on IntegriCloud