mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-28 18:07:12 +08:00
- TransposeWx16_AVX512BW and TransposeUVWx16_AVX512BW - tail masking instead of 'Any' to odd source width I420Rotate90_Opt (LIBYUV_WIDTH=1279 LIBYUV_HEIGHT=719 LIBYUV_REPEAT=1000): CPU Before After Speedup Intel Emerald Rapids 249 ms 182 ms 1.37x Intel Ice Lake 311 ms 234 ms 1.33x Intel Granite Rapids 246 ms 186 ms 1.32x Intel Sapphire Rapids 274 ms 226 ms 1.21x NV12Rotate90_Opt (LIBYUV_WIDTH=1279 LIBYUV_HEIGHT=719 LIBYUV_REPEAT=1000): CPU Before After Speedup Intel Granite Rapids 263 ms 181 ms 1.45x Intel Emerald Rapids 257 ms 180 ms 1.43x Intel Ice Lake 311 ms 233 ms 1.33x Intel Sapphire Rapids 282 ms 222 ms 1.27x Bug: None Change-Id: Ibe0df79275099dc06bf4218484a24732cd7fb9b5 TAG=agy CONV=bea53b37-b2bf-46fa-9e44-a708b438fabc Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8497726 Reviewed-by: richard winterton <rrwinterton@gmail.com>
79 lines
3.2 KiB
C++
79 lines
3.2 KiB
C++
/*
|
|
* Copyright 2015 The LibYuv Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "libyuv/rotate.h"
|
|
#include "libyuv/rotate_row.h"
|
|
|
|
#ifdef __cplusplus
|
|
namespace libyuv {
|
|
extern "C" {
|
|
#endif
|
|
|
|
#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); \
|
|
} \
|
|
ptrdiff_t np = n; \
|
|
TPOS_C(src + np, src_stride, dst + np * dst_stride, dst_stride, r); \
|
|
}
|
|
|
|
#ifdef HAS_TRANSPOSEWX8_NEON
|
|
TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, TransposeWx8_C, 7)
|
|
#endif
|
|
#ifdef HAS_TRANSPOSEWX16_NEON
|
|
TANY(TransposeWx16_Any_NEON, TransposeWx16_NEON, TransposeWx16_C, 15)
|
|
#endif
|
|
#ifdef HAS_TRANSPOSEWX8_SSSE3
|
|
#if defined(__x86_64__)
|
|
TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, TransposeWx8_C, 15)
|
|
#else
|
|
TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, TransposeWx8_C, 7)
|
|
#endif
|
|
#endif
|
|
#ifdef HAS_TRANSPOSEWX16_LSX
|
|
TANY(TransposeWx16_Any_LSX, TransposeWx16_LSX, TransposeWx16_C, 15)
|
|
#endif
|
|
#undef TANY
|
|
|
|
#define TUVANY(NAMEANY, TPOS_SIMD, MASK) \
|
|
void NAMEANY(const uint8_t* src, int src_stride, uint8_t* dst_a, \
|
|
int dst_stride_a, uint8_t* dst_b, int dst_stride_b, \
|
|
int width) { \
|
|
int r = width & MASK; \
|
|
int n = width - r; \
|
|
if (n > 0) { \
|
|
TPOS_SIMD(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, n); \
|
|
} \
|
|
ptrdiff_t np = n; \
|
|
TransposeUVWx8_C(src + np * 2, src_stride, dst_a + np * dst_stride_a, \
|
|
dst_stride_a, dst_b + np * dst_stride_b, dst_stride_b, \
|
|
r); \
|
|
}
|
|
|
|
#ifdef HAS_TRANSPOSEUVWX8_NEON
|
|
TUVANY(TransposeUVWx8_Any_NEON, TransposeUVWx8_NEON, 7)
|
|
#endif
|
|
#ifdef HAS_TRANSPOSEUVWX8_SSE2
|
|
TUVANY(TransposeUVWx8_Any_SSE2, TransposeUVWx8_SSE2, 7)
|
|
#endif
|
|
#ifdef HAS_TRANSPOSEUVWX16_LSX
|
|
TUVANY(TransposeUVWx16_Any_LSX, TransposeUVWx16_LSX, 7)
|
|
#endif
|
|
#undef TUVANY
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
} // namespace libyuv
|
|
#endif
|