mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Make LibYUVConvertTest.TestI400LargeSize skip test on low end arm cpu
- detect lack of dot product instruction to infer the cpu is low end - only run the test on higher end arm Bug: 416842099 Change-Id: Idd2dd16a624bbba280cf531644440024b12f7ecf Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6804632 Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
This commit is contained in:
parent
dd9ced1c6d
commit
3ff31b2a5f
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: https://chromium.googlesource.com/libyuv/libyuv/
|
URL: https://chromium.googlesource.com/libyuv/libyuv/
|
||||||
Version: 1913
|
Version: 1914
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
Shipped: yes
|
Shipped: yes
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 1913
|
#define LIBYUV_VERSION 1914
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|||||||
@ -2808,13 +2808,41 @@ TEST_F(LibYUVConvertTest, TestI400LargeSize) {
|
|||||||
// variant of the conversion function.
|
// variant of the conversion function.
|
||||||
const int kWidth = 1073741823;
|
const int kWidth = 1073741823;
|
||||||
const int kHeight = 2;
|
const int kHeight = 2;
|
||||||
|
|
||||||
|
#if defined(__aarch64__)
|
||||||
|
// Infer malloc can accept a large size for cpu with dot product (a76/a55)
|
||||||
|
int has_large_malloc = TestCpuFlag(kCpuHasNeonDotProd);
|
||||||
|
#else
|
||||||
|
int has_large_malloc = 1;
|
||||||
|
#endif
|
||||||
|
if (!has_large_malloc) {
|
||||||
|
printf("WARNING: Skipped. Large allocation may assert for %ld\n", (size_t)kWidth * kHeight);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Allocate one extra column so that the coalesce optimizations do not trigger
|
// Allocate one extra column so that the coalesce optimizations do not trigger
|
||||||
// in convert_argb.cc (they are triggered only when stride is equal to width).
|
// in convert_argb.cc (they are triggered only when stride is equal to width).
|
||||||
const size_t kStride = kWidth + 1;
|
const size_t kStride = kWidth + 1;
|
||||||
|
|
||||||
|
printf("WARNING: attempting to allocate I400 image of %zd bytes\n", (size_t)kWidth * kHeight);
|
||||||
|
fflush(stdout);
|
||||||
align_buffer_page_end(orig_i400, (size_t)kWidth * kHeight);
|
align_buffer_page_end(orig_i400, (size_t)kWidth * kHeight);
|
||||||
ASSERT_NE(orig_i400, nullptr);
|
if (!orig_i400) {
|
||||||
|
printf("WARNING: unable to allocate I400 image of %zd bytes\n", (size_t)kWidth * kHeight);
|
||||||
|
fflush(stdout);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
printf("INFO: allocate I400 image returned %p\n", orig_i400);
|
||||||
|
fflush(stdout);
|
||||||
align_buffer_page_end(dest_argb, (size_t)kWidth * kHeight * 4);
|
align_buffer_page_end(dest_argb, (size_t)kWidth * kHeight * 4);
|
||||||
ASSERT_NE(dest_argb, nullptr);
|
if (!dest_argb) {
|
||||||
|
printf("WARNING: unable to allocate ARGB image of %zd bytes\n", (size_t)kWidth * kHeight * 4);
|
||||||
|
fflush(stdout);
|
||||||
|
free_aligned_buffer_page_end(orig_i400);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
printf("INFO: allocate ARGB image returned %p\n", dest_argb);
|
||||||
|
fflush(stdout);
|
||||||
for (int i = 0; i < kWidth * kHeight; ++i) {
|
for (int i = 0; i < kWidth * kHeight; ++i) {
|
||||||
orig_i400[i] = i % 256;
|
orig_i400[i] = i % 256;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user