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

Git pushed a commit to branch master
in repository ffmpeg.

commit 34cf7790ef75204316c73515a87c8684fc4a0706
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Tue Feb 24 18:33:44 2026 +0100
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Wed Feb 25 12:41:13 2026 +0100

    tests/checkasm/h264chroma: Fix initialization, range of values
    
    This commit fixes four related bugs:
    1. The >8bpp codepath only initializes half the buffer.
    The remaining half used leftover samples from the 8bpp codepath
    which initialized the complete buffer.
    2. The 8bpp codepath tests only 2 bit inputs (&3). This means
    that the second half of the buffer only uses 10 bits (in fact,
    only values of the form 000000xx000000xxb) when treated as uint16_t
    in the >8bpp test. Due to 1., using more bits in the 8bpp test
    would make the >8bpp tests fail (the intermediates would no longer
    fit into 16bits).
    3. For the >8bpp tests, the first half of the buffer would
    only be tested with 8bpp input.
    4. The 8bpp codepath initializes the whole buffer, but only
    uses half of it.
    
    Reviewed-by: Lynne <[email protected]>
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 tests/checkasm/h264chroma.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/checkasm/h264chroma.c b/tests/checkasm/h264chroma.c
index 52aa220152..b5b8d64855 100644
--- a/tests/checkasm/h264chroma.c
+++ b/tests/checkasm/h264chroma.c
@@ -30,11 +30,12 @@
 #define randomize_buffers(bit_depth)             \
     do {                                         \
         if (bit_depth == 8) {                    \
-            for (int i = 0; i < 16*18*2; i++)    \
-                src[i] = rnd() & 0x3;            \
+            for (int i = 0; i < 16*18; i++)      \
+                src[i] = rnd();                  \
         } else {                                 \
-            for (int i = 0; i < 16*18; i += 2)   \
-                AV_WN16(&src[i], rnd() & 0xFF);  \
+            unsigned mask = (1 << bit_depth) - 1;\
+            for (int i = 0; i < 16*18*2; i += 2) \
+                AV_WN16A(&src[i], rnd() & mask); \
         }                                        \
     } while (0)
 

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

Reply via email to