From e1a93c79fc89ff8e274a588f26f1726c88c2aa64 Mon Sep 17 00:00:00 2001 From: George Steed Date: Fri, 12 Jul 2024 18:18:44 +0100 Subject: [PATCH] [AArch64] Fix rotate by odd sizes The existing disabled gtest rotate tests fail because the existing "any" kernels always assume we are processing height=8 rows at a time. This was recently changed to 16 on AArch64 which triggered this bug. To fix this, amend the TANY macro to explicitly specify the fallback kernel, such that we can use the height=16 kernel to match the SIMD optimized version where necessary. Also change other architecture versions to match. Bug: b/352351302 Change-Id: I8080fa8f44c7c67fa970a78fb426f2f801a9a00e Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5703585 Reviewed-by: Frank Barchard --- source/rotate_any.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source/rotate_any.cc b/source/rotate_any.cc index 949a7f7a1..ac94253fd 100644 --- a/source/rotate_any.cc +++ b/source/rotate_any.cc @@ -18,34 +18,34 @@ namespace libyuv { extern "C" { #endif -#define TANY(NAMEANY, TPOS_SIMD, MASK) \ - void NAMEANY(const uint8_t* src, int src_stride, uint8_t* dst, \ - int dst_stride, int width) { \ - int r = width & MASK; \ - int n = width - r; \ - if (n > 0) { \ - TPOS_SIMD(src, src_stride, dst, dst_stride, n); \ - } \ - TransposeWx8_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r); \ +#define TANY(NAMEANY, TPOS_SIMD, TPOS_C, MASK) \ + void NAMEANY(const uint8_t* src, int src_stride, uint8_t* dst, \ + int dst_stride, int width) { \ + int r = width & MASK; \ + int n = width - r; \ + if (n > 0) { \ + TPOS_SIMD(src, src_stride, dst, dst_stride, n); \ + } \ + TPOS_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r); \ } #ifdef HAS_TRANSPOSEWX8_NEON -TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, 7) +TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, TransposeWx8_C, 7) #endif #ifdef HAS_TRANSPOSEWX16_NEON -TANY(TransposeWx16_Any_NEON, TransposeWx16_NEON, 15) +TANY(TransposeWx16_Any_NEON, TransposeWx16_NEON, TransposeWx16_C, 15) #endif #ifdef HAS_TRANSPOSEWX8_SSSE3 -TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, 7) +TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, TransposeWx8_C, 7) #endif #ifdef HAS_TRANSPOSEWX8_FAST_SSSE3 -TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, 15) +TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, TransposeWx8_C, 15) #endif #ifdef HAS_TRANSPOSEWX16_MSA -TANY(TransposeWx16_Any_MSA, TransposeWx16_MSA, 15) +TANY(TransposeWx16_Any_MSA, TransposeWx16_MSA, TransposeWx16_C, 15) #endif #ifdef HAS_TRANSPOSEWX16_LSX -TANY(TransposeWx16_Any_LSX, TransposeWx16_LSX, 15) +TANY(TransposeWx16_Any_LSX, TransposeWx16_LSX, TransposeWx16_C, 15) #endif #undef TANY