Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Jun Zhao via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Jun Zhao <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] backport8.0:  fix typo in checkasm/hevc_pel (PR #21638)
Date: Tue, 03 Feb 2026 15:02:59 -0000
Message-ID: <177013097999.25.4446378559649556687@4457048688e7> (raw)

PR #21638 opened by Jun Zhao (mypopydev)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21638
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21638.patch

 fix typo in checkasm/hevc_pel


>From 450bbb7960e0e7807c9ea6fee43a839b2acc8a3d Mon Sep 17 00:00:00 2001
From: Jun Zhao <barryjzhao@tencent.com>
Date: Sat, 31 Jan 2026 00:09:17 +0800
Subject: [PATCH 1/2] checkasm/hevc_pel: fix typo size[sizes] -> sizes[size]

Commit 4d4b301e4a introduced a typo where `size[sizes]` was used
instead of `sizes[size]` in 10 places within checkasm_check_pixel_padded
calls.

Since `sizes` is an array and `size` is the loop index, `size[sizes]`
interprets the array pointer as an index, resulting in undefined behavior
and causing AddressSanitizer to detect buffer overflows during testing.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 tests/checkasm/hevc_pel.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/checkasm/hevc_pel.c b/tests/checkasm/hevc_pel.c
index 9a83613915..7139a5fc3b 100644
--- a/tests/checkasm/hevc_pel.c
+++ b/tests/checkasm/hevc_pel.c
@@ -110,7 +110,7 @@ static void checkasm_check_hevc_qpel(void)
                         call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
                         checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
                                                 dstw1, MAX_PB_SIZE * sizeof(int16_t),
-                                                size[sizes], size[sizes], "dst");
+                                                sizes[size], sizes[size], "dst");
                         bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
                     }
                 }
@@ -159,7 +159,7 @@ static void checkasm_check_hevc_qpel_uni(void)
                                  sizes[size], i, j, sizes[size]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    size[sizes], size[sizes], "dst");
+                                                    sizes[size], sizes[size], "dst");
                         bench_new(dst1, dst1_stride,
                                   src1, sizes[size] * SIZEOF_PIXEL,
                                   sizes[size], i, j, sizes[size]);
@@ -214,7 +214,7 @@ static void checkasm_check_hevc_qpel_uni_w(void)
                                              sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                size[sizes], size[sizes], "dst");
+                                                                sizes[size], sizes[size], "dst");
                                     bench_new(dst1, dst1_stride,
                                               src1, sizes[size] * SIZEOF_PIXEL,
                                               sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
@@ -271,7 +271,7 @@ static void checkasm_check_hevc_qpel_bi(void)
                                  ref1, sizes[size], i, j, sizes[size]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    size[sizes], size[sizes], "dst");
+                                                    sizes[size], sizes[size], "dst");
                         bench_new(dst1, dst1_stride,
                                   src1, sizes[size] * SIZEOF_PIXEL,
                                   ref1, sizes[size], i, j, sizes[size]);
@@ -330,7 +330,7 @@ static void checkasm_check_hevc_qpel_bi_w(void)
                                              ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                size[sizes], size[sizes], "dst");
+                                                                sizes[size], sizes[size], "dst");
                                     bench_new(dst1, dst1_stride,
                                               src1, sizes[size] * SIZEOF_PIXEL,
                                               ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
@@ -383,7 +383,7 @@ static void checkasm_check_hevc_epel(void)
                         call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
                         checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
                                                 dstw1, MAX_PB_SIZE * sizeof(int16_t),
-                                                size[sizes], size[sizes], "dst");
+                                                sizes[size], sizes[size], "dst");
                         bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
                     }
                 }
@@ -432,7 +432,7 @@ static void checkasm_check_hevc_epel_uni(void)
                                  sizes[size], i, j, sizes[size]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    size[sizes], size[sizes], "dst");
+                                                    sizes[size], sizes[size], "dst");
                         bench_new(dst1, dst1_stride,
                                   src1, sizes[size] * SIZEOF_PIXEL,
                                   sizes[size], i, j, sizes[size]);
@@ -487,7 +487,7 @@ static void checkasm_check_hevc_epel_uni_w(void)
                                              sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                size[sizes], size[sizes], "dst");
+                                                                sizes[size], sizes[size], "dst");
                                     bench_new(dst1, dst1_stride,
                                               src1, sizes[size] * SIZEOF_PIXEL,
                                               sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
@@ -544,7 +544,7 @@ static void checkasm_check_hevc_epel_bi(void)
                                  ref1, sizes[size], i, j, sizes[size]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    size[sizes], size[sizes], "dst");
+                                                    sizes[size], sizes[size], "dst");
                         bench_new(dst1, dst1_stride,
                                   src1, sizes[size] * SIZEOF_PIXEL,
                                   ref1, sizes[size], i, j, sizes[size]);
@@ -603,7 +603,7 @@ static void checkasm_check_hevc_epel_bi_w(void)
                                              ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                size[sizes], size[sizes], "dst");
+                                                                sizes[size], sizes[size], "dst");
                                     bench_new(dst1, dst1_stride,
                                               src1, sizes[size] * SIZEOF_PIXEL,
                                               ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
-- 
2.52.0


>From eef9672b02760f9e5da9a30701630775a4181271 Mon Sep 17 00:00:00 2001
From: Jun Zhao <barryjzhao@tencent.com>
Date: Sat, 31 Jan 2026 09:55:36 +0800
Subject: [PATCH 2/2] checkasm/hevc_pel: rename loop variable 'size' to 'idx'
 to avoid confusion

The variable 'size' is used as a loop index for the 'sizes' array.
This naming similarity is error-prone and recently led to a typo where
'size[sizes]' was written instead of 'sizes[size]'.

Rename the loop index variable from 'size' to 'idx' across all 10 test
functions to make the code more readable and prevent similar typos.

Additionally, replace the hardcoded loop upper bound '10' with
'FF_ARRAY_ELEMS(sizes)' for better maintainability.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 tests/checkasm/hevc_pel.c | 208 +++++++++++++++++++-------------------
 1 file changed, 104 insertions(+), 104 deletions(-)

diff --git a/tests/checkasm/hevc_pel.c b/tests/checkasm/hevc_pel.c
index 7139a5fc3b..e89facb1dc 100644
--- a/tests/checkasm/hevc_pel.c
+++ b/tests/checkasm/hevc_pel.c
@@ -83,7 +83,7 @@ static void checkasm_check_hevc_qpel(void)
     LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
                  int height, intptr_t mx, intptr_t my, int width);
 
@@ -92,7 +92,7 @@ static void checkasm_check_hevc_qpel(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_pixels"; break; // 0 0
@@ -101,17 +101,17 @@ static void checkasm_check_hevc_qpel(void)
                     case 3: type = "qpel_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_qpel[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_qpel[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
                         randomize_buffers();
                         randomize_buffers_dst();
-                        call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
-                        call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
+                        call_ref(dstw0, src0, sizes[idx] * SIZEOF_PIXEL, sizes[idx], i, j, sizes[idx]);
+                        call_new(dstw1, src1, sizes[idx] * SIZEOF_PIXEL, sizes[idx], i, j, sizes[idx]);
                         checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
                                                 dstw1, MAX_PB_SIZE * sizeof(int16_t),
-                                                sizes[size], sizes[size], "dst");
-                        bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
+                                                sizes[idx], sizes[idx], "dst");
+                        bench_new(dstw1, src1, sizes[idx] * SIZEOF_PIXEL, sizes[idx], i, j, sizes[idx]);
                     }
                 }
             }
@@ -128,7 +128,7 @@ static void checkasm_check_hevc_qpel_uni(void)
     PIXEL_RECT(dst1, 64, 64);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  int height, intptr_t mx, intptr_t my, int width);
 
@@ -137,7 +137,7 @@ static void checkasm_check_hevc_qpel_uni(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_uni_pixels"; break; // 0 0
@@ -146,23 +146,23 @@ static void checkasm_check_hevc_qpel_uni(void)
                     case 3: type = "qpel_uni_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_qpel_uni[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_qpel_uni[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         randomize_buffers();
                         CLEAR_PIXEL_RECT(dst0);
                         CLEAR_PIXEL_RECT(dst1);
                         call_ref(dst0, dst0_stride,
-                                 src0, sizes[size] * SIZEOF_PIXEL,
-                                 sizes[size], i, j, sizes[size]);
+                                 src0, sizes[idx] * SIZEOF_PIXEL,
+                                 sizes[idx], i, j, sizes[idx]);
                         call_new(dst1, dst1_stride,
-                                 src1, sizes[size] * SIZEOF_PIXEL,
-                                 sizes[size], i, j, sizes[size]);
+                                 src1, sizes[idx] * SIZEOF_PIXEL,
+                                 sizes[idx], i, j, sizes[idx]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    sizes[size], sizes[size], "dst");
+                                                    sizes[idx], sizes[idx], "dst");
                         bench_new(dst1, dst1_stride,
-                                  src1, sizes[size] * SIZEOF_PIXEL,
-                                  sizes[size], i, j, sizes[size]);
+                                  src1, sizes[idx] * SIZEOF_PIXEL,
+                                  sizes[idx], i, j, sizes[idx]);
                     }
                 }
             }
@@ -179,7 +179,7 @@ static void checkasm_check_hevc_qpel_uni_w(void)
     PIXEL_RECT(dst1, 64, 64);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     const int *denom, *wx, *ox;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
@@ -189,7 +189,7 @@ static void checkasm_check_hevc_qpel_uni_w(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_uni_w_pixels"; break; // 0 0
@@ -198,8 +198,8 @@ static void checkasm_check_hevc_qpel_uni_w(void)
                     case 3: type = "qpel_uni_w_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_qpel_uni_w[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_qpel_uni_w[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         for (denom = denoms; *denom >= 0; denom++) {
                             for (wx = weights; *wx >= 0; wx++) {
                                 for (ox = offsets; *ox >= 0; ox++) {
@@ -207,17 +207,17 @@ static void checkasm_check_hevc_qpel_uni_w(void)
                                     CLEAR_PIXEL_RECT(dst0);
                                     CLEAR_PIXEL_RECT(dst1);
                                     call_ref(dst0, dst0_stride,
-                                             src0, sizes[size] * SIZEOF_PIXEL,
-                                             sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
+                                             src0, sizes[idx] * SIZEOF_PIXEL,
+                                             sizes[idx], *denom, *wx, *ox, i, j, sizes[idx]);
                                     call_new(dst1, dst1_stride,
-                                             src1, sizes[size] * SIZEOF_PIXEL,
-                                             sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
+                                             src1, sizes[idx] * SIZEOF_PIXEL,
+                                             sizes[idx], *denom, *wx, *ox, i, j, sizes[idx]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                sizes[size], sizes[size], "dst");
+                                                                sizes[idx], sizes[idx], "dst");
                                     bench_new(dst1, dst1_stride,
-                                              src1, sizes[size] * SIZEOF_PIXEL,
-                                              sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
+                                              src1, sizes[idx] * SIZEOF_PIXEL,
+                                              sizes[idx], *denom, *wx, *ox, i, j, sizes[idx]);
                                 }
                             }
                         }
@@ -239,7 +239,7 @@ static void checkasm_check_hevc_qpel_bi(void)
     LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  const int16_t *src2,
                  int height, intptr_t mx, intptr_t my, int width);
@@ -249,7 +249,7 @@ static void checkasm_check_hevc_qpel_bi(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_bi_pixels"; break; // 0 0
@@ -258,23 +258,23 @@ static void checkasm_check_hevc_qpel_bi(void)
                     case 3: type = "qpel_bi_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_qpel_bi[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_qpel_bi[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         randomize_buffers_ref();
                         CLEAR_PIXEL_RECT(dst0);
                         CLEAR_PIXEL_RECT(dst1);
                         call_ref(dst0, dst0_stride,
-                                 src0, sizes[size] * SIZEOF_PIXEL,
-                                 ref0, sizes[size], i, j, sizes[size]);
+                                 src0, sizes[idx] * SIZEOF_PIXEL,
+                                 ref0, sizes[idx], i, j, sizes[idx]);
                         call_new(dst1, dst1_stride,
-                                 src1, sizes[size] * SIZEOF_PIXEL,
-                                 ref1, sizes[size], i, j, sizes[size]);
+                                 src1, sizes[idx] * SIZEOF_PIXEL,
+                                 ref1, sizes[idx], i, j, sizes[idx]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    sizes[size], sizes[size], "dst");
+                                                    sizes[idx], sizes[idx], "dst");
                         bench_new(dst1, dst1_stride,
-                                  src1, sizes[size] * SIZEOF_PIXEL,
-                                  ref1, sizes[size], i, j, sizes[size]);
+                                  src1, sizes[idx] * SIZEOF_PIXEL,
+                                  ref1, sizes[idx], i, j, sizes[idx]);
                     }
                 }
             }
@@ -293,7 +293,7 @@ static void checkasm_check_hevc_qpel_bi_w(void)
     LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     const int *denom, *wx, *ox;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  const int16_t *src2,
@@ -305,7 +305,7 @@ static void checkasm_check_hevc_qpel_bi_w(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_bi_w_pixels"; break; // 0 0
@@ -314,8 +314,8 @@ static void checkasm_check_hevc_qpel_bi_w(void)
                     case 3: type = "qpel_bi_w_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_qpel_bi_w[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_qpel_bi_w[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         for (denom = denoms; *denom >= 0; denom++) {
                             for (wx = weights; *wx >= 0; wx++) {
                                 for (ox = offsets; *ox >= 0; ox++) {
@@ -323,17 +323,17 @@ static void checkasm_check_hevc_qpel_bi_w(void)
                                     CLEAR_PIXEL_RECT(dst0);
                                     CLEAR_PIXEL_RECT(dst1);
                                     call_ref(dst0, dst0_stride,
-                                             src0, sizes[size] * SIZEOF_PIXEL,
-                                             ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
+                                             src0, sizes[idx] * SIZEOF_PIXEL,
+                                             ref0, sizes[idx], *denom, *wx, *wx, *ox, *ox, i, j, sizes[idx]);
                                     call_new(dst1, dst1_stride,
-                                             src1, sizes[size] * SIZEOF_PIXEL,
-                                             ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
+                                             src1, sizes[idx] * SIZEOF_PIXEL,
+                                             ref1, sizes[idx], *denom, *wx, *wx, *ox, *ox, i, j, sizes[idx]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                sizes[size], sizes[size], "dst");
+                                                                sizes[idx], sizes[idx], "dst");
                                     bench_new(dst1, dst1_stride,
-                                              src1, sizes[size] * SIZEOF_PIXEL,
-                                              ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
+                                              src1, sizes[idx] * SIZEOF_PIXEL,
+                                              ref1, sizes[idx], *denom, *wx, *wx, *ox, *ox, i, j, sizes[idx]);
                                 }
                             }
                         }
@@ -356,7 +356,7 @@ static void checkasm_check_hevc_epel(void)
     LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
                  int height, intptr_t mx, intptr_t my, int width);
 
@@ -365,7 +365,7 @@ static void checkasm_check_hevc_epel(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_pixels"; break; // 0 0
@@ -374,17 +374,17 @@ static void checkasm_check_hevc_epel(void)
                     case 3: type = "epel_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_epel[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_epel[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
                         randomize_buffers();
                         randomize_buffers_dst();
-                        call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
-                        call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
+                        call_ref(dstw0, src0, sizes[idx] * SIZEOF_PIXEL, sizes[idx], i, j, sizes[idx]);
+                        call_new(dstw1, src1, sizes[idx] * SIZEOF_PIXEL, sizes[idx], i, j, sizes[idx]);
                         checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
                                                 dstw1, MAX_PB_SIZE * sizeof(int16_t),
-                                                sizes[size], sizes[size], "dst");
-                        bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
+                                                sizes[idx], sizes[idx], "dst");
+                        bench_new(dstw1, src1, sizes[idx] * SIZEOF_PIXEL, sizes[idx], i, j, sizes[idx]);
                     }
                 }
             }
@@ -401,7 +401,7 @@ static void checkasm_check_hevc_epel_uni(void)
     PIXEL_RECT(dst1, 64, 64);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  int height, intptr_t mx, intptr_t my, int width);
 
@@ -410,7 +410,7 @@ static void checkasm_check_hevc_epel_uni(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_uni_pixels"; break; // 0 0
@@ -419,23 +419,23 @@ static void checkasm_check_hevc_epel_uni(void)
                     case 3: type = "epel_uni_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_epel_uni[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_epel_uni[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         randomize_buffers();
                         CLEAR_PIXEL_RECT(dst0);
                         CLEAR_PIXEL_RECT(dst1);
                         call_ref(dst0, dst0_stride,
-                                 src0, sizes[size] * SIZEOF_PIXEL,
-                                 sizes[size], i, j, sizes[size]);
+                                 src0, sizes[idx] * SIZEOF_PIXEL,
+                                 sizes[idx], i, j, sizes[idx]);
                         call_new(dst1, dst1_stride,
-                                 src1, sizes[size] * SIZEOF_PIXEL,
-                                 sizes[size], i, j, sizes[size]);
+                                 src1, sizes[idx] * SIZEOF_PIXEL,
+                                 sizes[idx], i, j, sizes[idx]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    sizes[size], sizes[size], "dst");
+                                                    sizes[idx], sizes[idx], "dst");
                         bench_new(dst1, dst1_stride,
-                                  src1, sizes[size] * SIZEOF_PIXEL,
-                                  sizes[size], i, j, sizes[size]);
+                                  src1, sizes[idx] * SIZEOF_PIXEL,
+                                  sizes[idx], i, j, sizes[idx]);
                     }
                 }
             }
@@ -452,7 +452,7 @@ static void checkasm_check_hevc_epel_uni_w(void)
     PIXEL_RECT(dst1, 64, 64);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     const int *denom, *wx, *ox;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
@@ -462,7 +462,7 @@ static void checkasm_check_hevc_epel_uni_w(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_uni_w_pixels"; break; // 0 0
@@ -471,8 +471,8 @@ static void checkasm_check_hevc_epel_uni_w(void)
                     case 3: type = "epel_uni_w_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_epel_uni_w[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_epel_uni_w[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         for (denom = denoms; *denom >= 0; denom++) {
                             for (wx = weights; *wx >= 0; wx++) {
                                 for (ox = offsets; *ox >= 0; ox++) {
@@ -480,17 +480,17 @@ static void checkasm_check_hevc_epel_uni_w(void)
                                     CLEAR_PIXEL_RECT(dst0);
                                     CLEAR_PIXEL_RECT(dst1);
                                     call_ref(dst0, dst0_stride,
-                                             src0, sizes[size] * SIZEOF_PIXEL,
-                                             sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
+                                             src0, sizes[idx] * SIZEOF_PIXEL,
+                                             sizes[idx], *denom, *wx, *ox, i, j, sizes[idx]);
                                     call_new(dst1, dst1_stride,
-                                             src1, sizes[size] * SIZEOF_PIXEL,
-                                             sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
+                                             src1, sizes[idx] * SIZEOF_PIXEL,
+                                             sizes[idx], *denom, *wx, *ox, i, j, sizes[idx]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                sizes[size], sizes[size], "dst");
+                                                                sizes[idx], sizes[idx], "dst");
                                     bench_new(dst1, dst1_stride,
-                                              src1, sizes[size] * SIZEOF_PIXEL,
-                                              sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
+                                              src1, sizes[idx] * SIZEOF_PIXEL,
+                                              sizes[idx], *denom, *wx, *ox, i, j, sizes[idx]);
                                 }
                             }
                         }
@@ -512,7 +512,7 @@ static void checkasm_check_hevc_epel_bi(void)
     LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  const int16_t *src2,
                  int height, intptr_t mx, intptr_t my, int width);
@@ -522,7 +522,7 @@ static void checkasm_check_hevc_epel_bi(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_bi_pixels"; break; // 0 0
@@ -531,23 +531,23 @@ static void checkasm_check_hevc_epel_bi(void)
                     case 3: type = "epel_bi_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_epel_bi[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_epel_bi[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         randomize_buffers_ref();
                         CLEAR_PIXEL_RECT(dst0);
                         CLEAR_PIXEL_RECT(dst1);
                         call_ref(dst0, dst0_stride,
-                                 src0, sizes[size] * SIZEOF_PIXEL,
-                                 ref0, sizes[size], i, j, sizes[size]);
+                                 src0, sizes[idx] * SIZEOF_PIXEL,
+                                 ref0, sizes[idx], i, j, sizes[idx]);
                         call_new(dst1, dst1_stride,
-                                 src1, sizes[size] * SIZEOF_PIXEL,
-                                 ref1, sizes[size], i, j, sizes[size]);
+                                 src1, sizes[idx] * SIZEOF_PIXEL,
+                                 ref1, sizes[idx], i, j, sizes[idx]);
                         checkasm_check_pixel_padded(dst0, dst0_stride,
                                                     dst1, dst1_stride,
-                                                    sizes[size], sizes[size], "dst");
+                                                    sizes[idx], sizes[idx], "dst");
                         bench_new(dst1, dst1_stride,
-                                  src1, sizes[size] * SIZEOF_PIXEL,
-                                  ref1, sizes[size], i, j, sizes[size]);
+                                  src1, sizes[idx] * SIZEOF_PIXEL,
+                                  ref1, sizes[idx], i, j, sizes[idx]);
                     }
                 }
             }
@@ -566,7 +566,7 @@ static void checkasm_check_hevc_epel_bi_w(void)
     LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
 
     HEVCDSPContext h;
-    int size, bit_depth, i, j;
+    int idx, bit_depth, i, j;
     const int *denom, *wx, *ox;
     declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
                  const int16_t *src2,
@@ -578,7 +578,7 @@ static void checkasm_check_hevc_epel_bi_w(void)
 
         for (i = 0; i < 2; i++) {
             for (j = 0; j < 2; j++) {
-                for (size = 1; size < 10; size++) {
+                for (idx = 1; idx < FF_ARRAY_ELEMS(sizes); idx++) {
                     const char *type;
                     switch ((j << 1) | i) {
                     case 0: type = "pel_bi_w_pixels"; break; // 0 0
@@ -587,8 +587,8 @@ static void checkasm_check_hevc_epel_bi_w(void)
                     case 3: type = "epel_bi_w_hv"; break; // 1 1
                     }
 
-                    if (check_func(h.put_hevc_epel_bi_w[size][j][i],
-                                   "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
+                    if (check_func(h.put_hevc_epel_bi_w[idx][j][i],
+                                   "put_hevc_%s%d_%d", type, sizes[idx], bit_depth)) {
                         for (denom = denoms; *denom >= 0; denom++) {
                             for (wx = weights; *wx >= 0; wx++) {
                                 for (ox = offsets; *ox >= 0; ox++) {
@@ -596,17 +596,17 @@ static void checkasm_check_hevc_epel_bi_w(void)
                                     CLEAR_PIXEL_RECT(dst0);
                                     CLEAR_PIXEL_RECT(dst1);
                                     call_ref(dst0, dst0_stride,
-                                             src0, sizes[size] * SIZEOF_PIXEL,
-                                             ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
+                                             src0, sizes[idx] * SIZEOF_PIXEL,
+                                             ref0, sizes[idx], *denom, *wx, *wx, *ox, *ox, i, j, sizes[idx]);
                                     call_new(dst1, dst1_stride,
-                                             src1, sizes[size] * SIZEOF_PIXEL,
-                                             ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
+                                             src1, sizes[idx] * SIZEOF_PIXEL,
+                                             ref1, sizes[idx], *denom, *wx, *wx, *ox, *ox, i, j, sizes[idx]);
                                     checkasm_check_pixel_padded(dst0, dst0_stride,
                                                                 dst1, dst1_stride,
-                                                                sizes[size], sizes[size], "dst");
+                                                                sizes[idx], sizes[idx], "dst");
                                     bench_new(dst1, dst1_stride,
-                                              src1, sizes[size] * SIZEOF_PIXEL,
-                                              ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
+                                              src1, sizes[idx] * SIZEOF_PIXEL,
+                                              ref1, sizes[idx], *denom, *wx, *wx, *ox, *ox, i, j, sizes[idx]);
                                 }
                             }
                         }
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2026-02-03 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=177013097999.25.4446378559649556687@4457048688e7 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git