]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_framepack.c
lavu: add AV_CEIL_RSHIFT and use it in various places
[ffmpeg] / libavfilter / vf_framepack.c
index f3bb6b36ae279193bc326fd263e75affa915b60e..fd0c1897d55631f29af526b2c443a7dc8f56c168 100644 (file)
@@ -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;