CopyFrameTest: reduce max size for 32-bit targets

avoids potential OOM when allocating 3 buffers for 16383x16383; 3840 is
used as a replacement
this test was missed in:
215bddf32 vpx_scale_test: reduce max size for 32-bit targets

Change-Id: I515adf5999c6ef1724394ccd62d677134bd35e6d
This commit is contained in:
James Zern 2018-03-16 17:47:56 -07:00
parent 215bddf324
commit 0f9521f0a8

View File

@ -20,6 +20,15 @@
#include "vpx_scale/yv12config.h" #include "vpx_scale/yv12config.h"
namespace libvpx_test { namespace libvpx_test {
namespace {
#if ARCH_ARM || (ARCH_MIPS && !HAVE_MIPS64) || ARCH_X86
// Avoid OOM failures on 32-bit platforms.
const int kNumSizesToTest = 7;
#else
const int kNumSizesToTest = 8;
#endif
const int kSizesToTest[] = { 1, 15, 33, 145, 512, 1025, 3840, 16383 };
typedef void (*ExtendFrameBorderFunc)(YV12_BUFFER_CONFIG *ybf); typedef void (*ExtendFrameBorderFunc)(YV12_BUFFER_CONFIG *ybf);
typedef void (*CopyFrameFunc)(const YV12_BUFFER_CONFIG *src_ybf, typedef void (*CopyFrameFunc)(const YV12_BUFFER_CONFIG *src_ybf,
@ -37,15 +46,6 @@ class ExtendBorderTest
void ExtendBorder() { ASM_REGISTER_STATE_CHECK(extend_fn_(&img_)); } void ExtendBorder() { ASM_REGISTER_STATE_CHECK(extend_fn_(&img_)); }
void RunTest() { void RunTest() {
#if ARCH_ARM || (ARCH_MIPS && !HAVE_MIPS64) || ARCH_X86
// Avoid OOM failures on 32-bit platforms.
static const int kNumSizesToTest = 7;
#else
static const int kNumSizesToTest = 8;
#endif
static const int kSizesToTest[] = {
1, 15, 33, 145, 512, 1025, 3840, 16383
};
for (int h = 0; h < kNumSizesToTest; ++h) { for (int h = 0; h < kNumSizesToTest; ++h) {
for (int w = 0; w < kNumSizesToTest; ++w) { for (int w = 0; w < kNumSizesToTest; ++w) {
ASSERT_NO_FATAL_FAILURE(ResetImages(kSizesToTest[w], kSizesToTest[h])); ASSERT_NO_FATAL_FAILURE(ResetImages(kSizesToTest[w], kSizesToTest[h]));
@ -78,13 +78,6 @@ class CopyFrameTest : public VpxScaleBase,
} }
void RunTest() { void RunTest() {
#if ARCH_ARM
// Some arm devices OOM when trying to allocate the largest buffers.
static const int kNumSizesToTest = 6;
#else
static const int kNumSizesToTest = 7;
#endif
static const int kSizesToTest[] = { 1, 15, 33, 145, 512, 1025, 16383 };
for (int h = 0; h < kNumSizesToTest; ++h) { for (int h = 0; h < kNumSizesToTest; ++h) {
for (int w = 0; w < kNumSizesToTest; ++w) { for (int w = 0; w < kNumSizesToTest; ++w) {
ASSERT_NO_FATAL_FAILURE(ResetImages(kSizesToTest[w], kSizesToTest[h])); ASSERT_NO_FATAL_FAILURE(ResetImages(kSizesToTest[w], kSizesToTest[h]));
@ -104,4 +97,5 @@ TEST_P(CopyFrameTest, CopyFrame) { ASSERT_NO_FATAL_FAILURE(RunTest()); }
INSTANTIATE_TEST_CASE_P(C, CopyFrameTest, INSTANTIATE_TEST_CASE_P(C, CopyFrameTest,
::testing::Values(vp8_yv12_copy_frame_c)); ::testing::Values(vp8_yv12_copy_frame_c));
} // namespace
} // namespace libvpx_test } // namespace libvpx_test