Compare commits

..

3 Commits

Author SHA1 Message Date
Wan-Teh Chang
86b09b2450 Free dst_c, dst_opt buffers in TestHalfFloatPlane
Fix memory leaks introduced in commit 5951464:
https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6043392

Bug: 377693555
Change-Id: I20311bdc33e98c0b8e79679a2db42c7439ca89df
No-Try: True
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6093137
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: George Steed <george.steed@arm.com>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
2024-12-13 08:28:17 -08:00
George Steed
45c7107f95 [AArch64] Fix compilation when SME is not supported
The STREAMING_COMPATIBLE macro is designed to enable use of the
__arm_streaming_compatible attribute with the intent that this macro
expanded to empty if SME is not supported by the compiler or platform
being compiled for, however in reality this macro remained undefined
causing compilation to fail. Fix this by defining the macro to empty as
originally intended.

No-Try: True
Change-Id: I8f5a8a606289b7c045fa1cce609f5a6d644891ac
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6087913
Reviewed-by: Justin Green <greenjustin@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: Wan-Teh Chang <wtc@google.com>
2024-12-13 08:16:50 -08:00
George Steed
db5a71c528 [AArch64] Remove unused variables in HalfRow_{16To8,16}_SME
The HalfRow kernels assume that the fraction is exactly half, so there
is no need to calculate it.

No-Try: True
Change-Id: I2319d55ba99f202aa22c9693ec44c9891e7f72d5
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6087914
Reviewed-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Justin Green <greenjustin@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
2024-12-13 08:00:58 -08:00
3 changed files with 5 additions and 4 deletions

View File

@ -23,6 +23,9 @@ extern "C" {
#if !defined(LIBYUV_DISABLE_SME) && defined(CLANG_HAS_SME) && \
defined(__aarch64__)
#define STREAMING_COMPATIBLE __arm_streaming_compatible
#else // defined(LIBYUV_DISABLE_SME) || !defined(CLANG_HAS_SME) ||
// !defined(__aarch64__)
#define STREAMING_COMPATIBLE
#endif // !defined(LIBYUV_DISABLE_SME) && defined(CLANG_HAS_SME) &&
// defined(__aarch64__)

View File

@ -805,8 +805,6 @@ __arm_locally_streaming static void HalfRow_16_SME(uint16_t* dst_ptr,
const uint16_t* src_ptr,
ptrdiff_t src_stride,
int width) {
int y1_fraction = 128;
int y0_fraction = 256 - y1_fraction;
const uint16_t* src_ptr1 = src_ptr + src_stride;
int vl;
@ -933,8 +931,6 @@ __arm_locally_streaming static void HalfRow_16To8_SME(uint8_t* dst_ptr,
ptrdiff_t src_stride,
int scale,
int width) {
int y1_fraction = 128;
int y0_fraction = 256 - y1_fraction;
const uint16_t* src_ptr1 = src_ptr + src_stride;
// 15 - clz(scale), + 8 to shift result into the high half of the lane to

View File

@ -2523,6 +2523,8 @@ static int TestHalfFloatPlane(int benchmark_width,
}
free_aligned_buffer_page_end(orig_y);
free_aligned_buffer_page_end(dst_c);
free_aligned_buffer_page_end(dst_opt);
return max_diff;
}