[FFmpeg-devel] [PATCH 6/7] postproc/tests/blocktest: initialize qp array randomly to for testing

Michael Niedermayer michael at niedermayer.cc
Fri May 2 01:27:34 EEST 2025


Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libpostproc/tests/blocktest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libpostproc/tests/blocktest.c b/libpostproc/tests/blocktest.c
index c91ccd8f5be..d40e00495aa 100644
--- a/libpostproc/tests/blocktest.c
+++ b/libpostproc/tests/blocktest.c
@@ -60,6 +60,8 @@ static int64_t test(int width, int height, int blocksize, int flags, int pict_ty
     pp_context *context = pp_get_context(width, height, flags);
     pp_mode *mode = pp_get_mode_by_name_and_quality("be,de", quality);
     int64_t ret;
+#define  QP_STRIDE (352/16)
+    int8_t qp[QP_STRIDE * 352/16];
 
     if (!in || !out || !context || !mode) {
         ret = AVERROR(ENOMEM);
@@ -80,9 +82,12 @@ static int64_t test(int width, int height, int blocksize, int flags, int pict_ty
 
     blocks(in, blocksize, 11);
 
+    for(int i= 0; i<sizeof(qp); i++)
+        qp[i] = i % 31;
+
     pp_postprocess( (cuint8[]){in->data[0], in->data[1], in->data[2]}, in->linesize,
                    out->data, out->linesize,
-                   width, height, NULL, 0,
+                   width, height, qp, QP_STRIDE,
                    mode, context, pict_type);
 
     ret = chksum(out);
-- 
2.49.0



More information about the ffmpeg-devel mailing list