lavfi/idet: fix chroma subsampling with odd sizes.
authorClément Bœsch <ubitux@gmail.com>
Thu, 16 May 2013 17:02:19 +0000 (19:02 +0200)
committerClément Bœsch <ubitux@gmail.com>
Thu, 16 May 2013 21:20:00 +0000 (23:20 +0200)
libavfilter/vf_idet.c

index cd8bbe3..70aae92 100644 (file)
@@ -118,8 +118,8 @@ static void filter(AVFilterContext *ctx)
         int refs = idet->cur->linesize[i];
 
         if (i && i<3) {
-            w >>= idet->csp->log2_chroma_w;
-            h >>= idet->csp->log2_chroma_h;
+            w = FF_CEIL_RSHIFT(w, idet->csp->log2_chroma_w);
+            h = FF_CEIL_RSHIFT(h, idet->csp->log2_chroma_h);
         }
 
         for (y = 2; y < h - 2; y++) {