[FFmpeg-cvslog] postproc/tests/blocktest: initialize qp array randomly to for testing

Michael Niedermayer git at videolan.org
Sat May 3 19:52:29 EEST 2025


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri May  2 00:12:03 2025 +0200| [fc3035e3c4da57b4fa0a89ee87e85c2778f53fe9] | committer: Michael Niedermayer

postproc/tests/blocktest: initialize qp array randomly to for testing

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc3035e3c4da57b4fa0a89ee87e85c2778f53fe9
---

 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 c91ccd8f5b..d40e00495a 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);



More information about the ffmpeg-cvslog mailing list