[FFmpeg-devel] [PATCH 2/5] lavfi/mptestsrc: fix chroma subsampling with odd sizes.

Clément Bœsch ubitux at gmail.com
Thu May 16 19:15:14 CEST 2013


This makes no difference in practice since w & h are hardcoded to 512.
---
 libavfilter/vsrc_mptestsrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vsrc_mptestsrc.c b/libavfilter/vsrc_mptestsrc.c
index e931c76..fe07140 100644
--- a/libavfilter/vsrc_mptestsrc.c
+++ b/libavfilter/vsrc_mptestsrc.c
@@ -301,7 +301,8 @@ static int request_frame(AVFilterLink *outlink)
 {
     MPTestContext *test = outlink->src->priv;
     AVFrame *picref;
-    int w = WIDTH, h = HEIGHT, cw = w>>test->hsub, ch = h>>test->vsub;
+    int w = WIDTH, h = HEIGHT,
+        cw = FF_CEIL_RSHIFT(w, test->hsub), ch = FF_CEIL_RSHIFT(h, test->vsub);
     unsigned int frame = test->frame_nb;
     enum test_type tt = test->test;
     int i;
-- 
1.8.2.3



More information about the ffmpeg-devel mailing list