Commit ffbc6a4b authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Adjust motion vector unit test while AddressSanitizer is enabled

On the 32-bit system, if using 4k test clip, an "out of memory" error
occurred because of the AddressSanitizer instrumentation memory overhead.
In this patch, reduced the test clip's resolution while testing on 32-bit
system and AddressSanitizer is enabled.

BUG=aomedia:475

Change-Id: I4aa21b5d78e361e2ff68071064eef71b7314c1e3
parent 7fe9ce5d
......@@ -17,6 +17,12 @@
#include "test/yuv_video_source.h"
namespace {
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define BUILDING_WITH_ASAN
#endif
#endif
#define MAX_EXTREME_MV 1
#define MIN_EXTREME_MV 2
......@@ -76,14 +82,27 @@ class MotionVectorTestLarge
};
TEST_P(MotionVectorTestLarge, OverallTest) {
int width = 3840;
int height = 2160;
#ifdef BUILDING_WITH_ASAN
// On the 32-bit system, if using 4k test clip, an "out of memory" error
// occurs because of the AddressSanitizer instrumentation memory overhead.
// Here, reduce the test clip's resolution while testing on 32-bit system
// and AddressSanitizer is enabled.
if (sizeof(void *) == 4) {
width = 2048;
height = 1080;
}
#endif
cfg_.rc_target_bitrate = 24000;
cfg_.g_profile = 0;
init_flags_ = AOM_CODEC_USE_PSNR;
testing::internal::scoped_ptr<libaom_test::VideoSource> video;
video.reset(new libaom_test::YUVVideoSource(
"niklas_640_480_30.yuv", AOM_IMG_FMT_I420, 3840, 2160, // 2048, 1080,
30, 1, 0, 5));
"niklas_640_480_30.yuv", AOM_IMG_FMT_I420, width, height, 30, 1, 0, 5));
ASSERT_TRUE(video.get() != NULL);
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment