[FFmpeg-devel] [PATCH] swscale/swscale-test: Code to test scaler with slices

Michael Niedermayer michael at niedermayer.cc
Sun Jun 5 14:27:33 CEST 2016


This currently does fail due to bugs in swscale (already reported to
author of commit causing them)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libswscale/swscale-test.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/libswscale/swscale-test.c b/libswscale/swscale-test.c
index 4d8d08b..bc02e6c 100644
--- a/libswscale/swscale-test.c
+++ b/libswscale/swscale-test.c
@@ -177,7 +177,22 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
            flags);
     fflush(stdout);
 
-    sws_scale(dstContext, (const uint8_t * const*)src, srcStride, 0, srcH, dst, dstStride);
+int STEP = 16;
+    for (i = 0; i < srcH; i+=STEP) {
+        uint8_t *src_tmp[4] = {src[0], src[1], src[2], src[3]};
+
+        src_tmp[0] += srcStride[0] * i * STEP;
+        if (src_tmp[2]) {
+            int step = STEP >> desc_src->log2_chroma_h;
+            src_tmp[1] += srcStride[1] * i * step;
+            src_tmp[2] += srcStride[2] * i * step;
+        }
+        if (src_tmp[3])
+            src_tmp[3] += srcStride[3] * i * STEP;
+
+        sws_scale(dstContext, (const uint8_t * const*)src_tmp, srcStride, i, FFMIN(srcH - i, STEP), dst, dstStride);
+    }
+
 
     for (i = 0; i < 4 && dstStride[i]; i++)
         crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), crc, dst[i],
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list