summaryrefslogtreecommitdiff
path: root/libavfilter
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 /libavfilter
parent7570c9e04f010c9b3bfdeb4338d330f2cdd25278 (diff)
lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_framepack.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/vf_framepack.c b/libavfilter/vf_framepack.c
index f3bb6b36ae..fd0c1897d5 100644
--- a/libavfilter/vf_framepack.c
+++ b/libavfilter/vf_framepack.c
@@ -25,6 +25,7 @@
#include <string.h>
+#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
@@ -158,8 +159,8 @@ static void horizontal_frame_pack(AVFilterLink *outlink,
for (plane = 0; plane < s->pix_desc->nb_components; plane++) {
if (plane == 1 || plane == 2) {
- length = -(-(out->width / 2) >> s->pix_desc->log2_chroma_w);
- lines = -(-(out->height) >> s->pix_desc->log2_chroma_h);
+ length = AV_CEIL_RSHIFT(out->width / 2, s->pix_desc->log2_chroma_w);
+ lines = AV_CEIL_RSHIFT(out->height, s->pix_desc->log2_chroma_h);
}
for (i = 0; i < lines; i++) {
int j;