From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 86A214E796 for ; Sat, 31 Jan 2026 02:13:47 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'PyiHLDrMTIehIdKwXHpvla3BLvjoz/I3MO7ziBm5FnI=', expected b'afZEq2U0a1CSFiL+cKEZWT0DOtB5cUFoFXeNtkKT7Ss=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1769825610; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=PyiHLDrMTIehIdKwXHpvla3BLvjoz/I3MO7ziBm5FnI=; b=lzLDkt4tckZFU/h/QSOW1SYWcapsl7iVVhobtCWkNIhTkidrox8+OMhQCWuAPlYk2evKI 4FtHWike6i6bTrqANmpR5i7XCmx0l79/ebcpm3BOYTyK4x5tr0oRKM+rrGes0w884FGXLQk 3+lcpXaErvKvnB1Jycren8g6FL/AjVb30ho8St2Wxm2KpLcLDu3W9NUCCbVEPBprZTsl/KS mgEBVLph9B9PwDSDagJ4im0hwyvRkcumR0m3kFE8xWHGPHBMCUAeyvnF0oSvjhGRYoJhaFB 1329MvtZu+0tOmuOIldxVU9N2LuiU840loCZkRrJ6Do01uX6OtZRU7ET0gmA== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 3E456690FE7; Sat, 31 Jan 2026 04:13:30 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1769825594; b=f5ofUwWEPmvNbk9sBfVO/Apkd7oQEV377qcsoOXRr+gjW4U8opodaWKzbVnGsGrCxv8O+ KGN4Jtbw6wZCTfUaPnENHW7B5TOFASVl/9iOgyQ5y8JeZZEOv4sG7HG6tvkY6yrWw8OY/I2 a9n/hS7YjsPT1GpAwOzHUk0k1n0Les306PSmbLUlJ7usTxReQAvad3dWbFG1mkLfDrryoBI Sr8XM/TrAoRCs7lYKTsmvX7ZM1ZJHfa9pehrbmYAQCuUy5++iUO8T/8uvtv2w2uJjPgaGO7 oyzdS+1jwxlwfZ6jKKRezAOoECIITEZS2wflFX8I62mZ8L+H12rWuzFb495w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1769825594; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=o9j/oHMuyGkhRC4UKRA7Kmho4+jlH+wM4NJ5/9K8E1I=; b=GrFZwvqrdln88aDuOBXU/Hog4MXXj+eYvKZyqfhRcVOs+7wWRvUbMV+gLH8P/f37WDan0 7frCVjXBwL1w6tZ7WtNxz4+xiyT7DHyRYZcXjIqRqjbtWJlje3fGIakT0eBO+uAjL8emZYV pTAjyi/0PR7TLJ64N/SxfqQyHfV8NxtFZFjEvbmDdduqVKQx217VW9oFFK62akwVJ8SOGWE nM+k0d4+mv08NGxmIS+9L0BlU1w+L99tRdRRDSb0KEzw2sCdv9HjWvpHXZeifeDoitnGUnw guUYl/WdT8lqpY8gwxVonEg7CQK+a5Ti7u2EH9kc8gKaB13yxG9J7ViN61cA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1769825586; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=afZEq2U0a1CSFiL+cKEZWT0DOtB5cUFoFXeNtkKT7Ss=; b=gKSWlTPkKL/Nr671ZE+FrpL+AYIYgZ1mKH+ZMDPg3S/sfmX3YXOIJ3qA95yLkDuliFUOR YomnSAa/GyB/vQToGgU/u/qR6cc+EERyZ+tf0FAGZgQoCizAz37Iu8FZiFSe4fCD47g9tDE ZOo+IN/1/+4KmQjhG92KDDF0zDAhRruCOFmmC/djt8Io5F1jFMBPyJIfY5/3lIsU7O43KU8 UrqrYMNSbwlUxNjsowp4OJSDLXkZF1i9/z5r9SU+wGflmt95yQy0VV6FTJI6Z3N3xlhQCMI OQwpXwMhe5/e4F18RKhqT2RwnogmyGT5I2xciFHoyHRUE97yacCz2R9i7S2Q== Received: from c8d966988b92 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 25654690F58 for ; Sat, 31 Jan 2026 04:13:06 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Sat, 31 Jan 2026 02:13:05 -0000 Message-ID: <176982558633.25.3025666302730246215@4457048688e7> Message-ID-Hash: 5W3IP7CHGKHQA56PU4HVSUS5KNKTTYPI X-Message-ID-Hash: 5W3IP7CHGKHQA56PU4HVSUS5KNKTTYPI X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] fix_typo (PR #21616) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jun Zhao via ffmpeg-devel Cc: Jun Zhao Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21616 opened by Jun Zhao (mypopydev) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21616 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21616.patch Fixed a segmentation fault caused by size with index by sizes typo, then renamed variable size to idx to prevent future confusion. >>From 0bd278cb4656a6b29f7596bfd09f1bd2eba3a1a9 Mon Sep 17 00:00:00 2001 From: Jun Zhao 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 --- 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 d09f0e328f455e9323031aa50736610164497f4c Mon Sep 17 00:00:00 2001 From: Jun Zhao 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 --- 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