This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit fad2e0bc504d0619453151cdb2a88a744dee34bc
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Tue Jun 30 15:37:56 2026 +0200
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Fri Jul 3 16:09:57 2026 +0200

    tests/checkasm/motion: Improve randomizing buffers
    
    Randomize four bytes at a time and only do it if needed.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 tests/checkasm/motion.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/checkasm/motion.c b/tests/checkasm/motion.c
index e3d5acc5df..bbe61998ad 100644
--- a/tests/checkasm/motion.c
+++ b/tests/checkasm/motion.c
@@ -27,12 +27,12 @@
 
 #include "checkasm.h"
 
-static void fill_random(uint8_t *tab, int size)
+static void fill_random(uint8_t *tab, size_t size)
 {
-    int i;
-    for (i = 0; i < size; i++) {
-        tab[i] = rnd() % 256;
-    }
+    for (size_t i = 0; i < (size & ~3); i += 4)
+        AV_WN32A(tab + i, rnd());
+    for (size_t i = size & ~3; i < size; ++i)
+        tab[i] = rnd();
 }
 
 static void test_motion(const char *name, me_cmp_func test_func)
@@ -61,10 +61,10 @@ static void test_motion(const char *name, me_cmp_func 
test_func)
     }
 
     /* test correctness */
-    fill_random(img1, WIDTH * HEIGHT);
-    fill_random(img2, WIDTH * HEIGHT);
-
     if (check_func(test_func, "%s", name)) {
+        fill_random(img1, WIDTH * HEIGHT);
+        fill_random(img2, WIDTH * HEIGHT);
+
         for (i = 0; i < ITERATIONS; i++) {
             x = rnd() % (WIDTH - look_ahead);
             y = rnd() % (HEIGHT - look_ahead);

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to