Commit 3a826f1d authored by clang-format's avatar clang-format Committed by James Zern

test/: apply clang-format

Change-Id: I1138fbeff5f63beb5c0de2c357793da12502d453
parent 712e66da
......@@ -23,9 +23,7 @@ class ACMRandom {
explicit ACMRandom(int seed) : random_(seed) {}
void Reset(int seed) {
random_.Reseed(seed);
}
void Reset(int seed) { random_.Reseed(seed); }
uint16_t Rand16(void) {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
......@@ -52,17 +50,11 @@ class ACMRandom {
return r < 128 ? r << 4 : r >> 4;
}
int PseudoUniform(int range) {
return random_.Generate(range);
}
int PseudoUniform(int range) { return random_.Generate(range); }
int operator()(int n) {
return PseudoUniform(n);
}
int operator()(int n) { return PseudoUniform(n); }
static int DeterministicSeed(void) {
return 0xbaba;
}
static int DeterministicSeed(void) { return 0xbaba; }
private:
testing::internal::Random random_;
......
......@@ -17,8 +17,8 @@
namespace {
// Check if any pixel in a 16x16 macroblock varies between frames.
int CheckMb(const vpx_image_t &current, const vpx_image_t &previous,
int mb_r, int mb_c) {
int CheckMb(const vpx_image_t &current, const vpx_image_t &previous, int mb_r,
int mb_c) {
for (int plane = 0; plane < 3; plane++) {
int r = 16 * mb_r;
int c0 = 16 * mb_c;
......
......@@ -39,6 +39,7 @@ class ActiveMapTest
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
} else if (video->frame() == 3) {
vpx_active_map_t map = vpx_active_map_t();
/* clang-format off */
uint8_t active_map[9 * 13] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
......@@ -50,6 +51,7 @@ class ActiveMapTest
0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0,
};
/* clang-format on */
map.cols = (kWidth + 15) / 16;
map.rows = (kHeight + 15) / 16;
ASSERT_EQ(map.cols, 13u);
......@@ -82,15 +84,11 @@ class ActiveMapTest
int cpu_used_;
};
TEST_P(ActiveMapTest, Test) {
DoTest();
}
TEST_P(ActiveMapTest, Test) { DoTest(); }
class ActiveMapTestLarge : public ActiveMapTest {};
TEST_P(ActiveMapTestLarge, Test) {
DoTest();
}
TEST_P(ActiveMapTestLarge, Test) { DoTest(); }
VP10_INSTANTIATE_TEST_CASE(ActiveMapTestLarge,
::testing::Values(::libvpx_test::kRealTime),
......
......@@ -24,12 +24,9 @@ typedef void (*AddNoiseFunc)(unsigned char *start, char *noise,
char bothclamp[16], unsigned int width,
unsigned int height, int pitch);
class AddNoiseTest
: public ::testing::TestWithParam<AddNoiseFunc> {
class AddNoiseTest : public ::testing::TestWithParam<AddNoiseFunc> {
public:
virtual void TearDown() {
libvpx_test::ClearSystemState();
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
virtual ~AddNoiseTest() {}
};
......@@ -45,7 +42,7 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
DECLARE_ALIGNED(16, char, blackclamp[16]);
DECLARE_ALIGNED(16, char, whiteclamp[16]);
DECLARE_ALIGNED(16, char, bothclamp[16]);
const int width = 64;
const int width = 64;
const int height = 64;
const int image_size = width * height;
char noise[3072];
......@@ -105,7 +102,7 @@ TEST_P(AddNoiseTest, CheckCvsAssembly) {
DECLARE_ALIGNED(16, char, blackclamp[16]);
DECLARE_ALIGNED(16, char, whiteclamp[16]);
DECLARE_ALIGNED(16, char, bothclamp[16]);
const int width = 64;
const int width = 64;
const int height = 64;
const int image_size = width * height;
char noise[3072];
......@@ -128,9 +125,8 @@ TEST_P(AddNoiseTest, CheckCvsAssembly) {
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
bothclamp, width, height, width));
srand(0);
ASM_REGISTER_STATE_CHECK(vpx_plane_add_noise_c(d, noise, blackclamp,
whiteclamp, bothclamp,
width, height, width));
ASM_REGISTER_STATE_CHECK(vpx_plane_add_noise_c(
d, noise, blackclamp, whiteclamp, bothclamp, width, height, width));
for (int i = 0; i < image_size; ++i) {
EXPECT_EQ(static_cast<int>(s[i]), static_cast<int>(d[i])) << "i = " << i;
......
......@@ -19,11 +19,8 @@ class AltRefForcedKeyTestLarge
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
AltRefForcedKeyTestLarge()
: EncoderTest(GET_PARAM(0)),
encoding_mode_(GET_PARAM(1)),
cpu_used_(GET_PARAM(2)),
forced_kf_frame_num_(1),
frame_num_(0) {}
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
cpu_used_(GET_PARAM(2)), forced_kf_frame_num_(1), frame_num_(0) {}
virtual ~AltRefForcedKeyTestLarge() {}
virtual void SetUp() {
......@@ -38,8 +35,8 @@ class AltRefForcedKeyTestLarge
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
// override test default for tile columns if necessary.
#if CONFIG_VP10_ENCODER
// override test default for tile columns if necessary.
if (GET_PARAM(0) == &libvpx_test::kVP10) {
encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
}
......@@ -91,9 +88,8 @@ TEST_P(AltRefForcedKeyTestLarge, ForcedFrameIsKey) {
}
}
VP10_INSTANTIATE_TEST_CASE(
AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
VP10_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
} // namespace
......@@ -49,8 +49,8 @@ class AqSegmentTest
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_target_bitrate = 300;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv",
352, 288, 30, 1, 0, 15);
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
288, 30, 1, 0, 15);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
......@@ -60,36 +60,23 @@ class AqSegmentTest
// Validate that this AQ segmentation mode (AQ=1, variance_ap)
// encodes and decodes without a mismatch.
TEST_P(AqSegmentTest, TestNoMisMatchAQ1) {
DoTest(1);
}
TEST_P(AqSegmentTest, TestNoMisMatchAQ1) { DoTest(1); }
// Validate that this AQ segmentation mode (AQ=2, complexity_aq)
// encodes and decodes without a mismatch.
TEST_P(AqSegmentTest, TestNoMisMatchAQ2) {
DoTest(2);
}
TEST_P(AqSegmentTest, TestNoMisMatchAQ2) { DoTest(2); }
// Validate that this AQ segmentation mode (AQ=3, cyclic_refresh_aq)
// encodes and decodes without a mismatch.
TEST_P(AqSegmentTest, TestNoMisMatchAQ3) {
DoTest(3);
}
TEST_P(AqSegmentTest, TestNoMisMatchAQ3) { DoTest(3); }
class AqSegmentTestLarge : public AqSegmentTest {};
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ1) {
DoTest(1);
}
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ1) { DoTest(1); }
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ2) {
DoTest(2);
}
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ3) {
DoTest(3);
}
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ2) { DoTest(2); }
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ3) { DoTest(3); }
VP10_INSTANTIATE_TEST_CASE(AqSegmentTest,
::testing::Values(::libvpx_test::kRealTime,
......
......@@ -22,8 +22,8 @@ namespace {
const unsigned int kFrames = 100;
const int kBitrate = 500;
#define ARF_NOT_SEEN 1000001
#define ARF_SEEN_ONCE 1000000
#define ARF_NOT_SEEN 1000001
#define ARF_SEEN_ONCE 1000000
typedef struct {
const char *filename;
......@@ -44,24 +44,20 @@ typedef struct {
const TestVideoParam kTestVectors[] = {
// artificially increase framerate to trigger default check
{"hantro_collage_w352h288.yuv", 352, 288, 5000, 1,
8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
{"hantro_collage_w352h288.yuv", 352, 288, 30, 1,
8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
{"rush_hour_444.y4m", 352, 288, 30, 1,
8, VPX_IMG_FMT_I444, VPX_BITS_8, 1},
{ "hantro_collage_w352h288.yuv", 352, 288, 5000, 1, 8, VPX_IMG_FMT_I420,
VPX_BITS_8, 0 },
{ "hantro_collage_w352h288.yuv", 352, 288, 30, 1, 8, VPX_IMG_FMT_I420,
VPX_BITS_8, 0 },
{ "rush_hour_444.y4m", 352, 288, 30, 1, 8, VPX_IMG_FMT_I444, VPX_BITS_8, 1 },
#if CONFIG_VP9_HIGHBITDEPTH
// Add list of profile 2/3 test videos here ...
// Add list of profile 2/3 test videos here ...
#endif // CONFIG_VP9_HIGHBITDEPTH
};
const TestEncodeParam kEncodeVectors[] = {
{::libvpx_test::kOnePassGood, 2},
{::libvpx_test::kOnePassGood, 5},
{::libvpx_test::kTwoPassGood, 1},
{::libvpx_test::kTwoPassGood, 2},
{::libvpx_test::kTwoPassGood, 5},
{::libvpx_test::kRealTime, 5},
{ ::libvpx_test::kOnePassGood, 2 }, { ::libvpx_test::kOnePassGood, 5 },
{ ::libvpx_test::kTwoPassGood, 1 }, { ::libvpx_test::kTwoPassGood, 2 },
{ ::libvpx_test::kTwoPassGood, 5 }, { ::libvpx_test::kRealTime, 5 },
};
const int kMinArfVectors[] = {
......@@ -80,15 +76,12 @@ int is_extension_y4m(const char *filename) {
class ArfFreqTestLarge
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith3Params<TestVideoParam, \
public ::libvpx_test::CodecTestWith3Params<TestVideoParam,
TestEncodeParam, int> {
protected:
ArfFreqTestLarge()
: EncoderTest(GET_PARAM(0)),
test_video_param_(GET_PARAM(1)),
test_encode_param_(GET_PARAM(2)),
min_arf_requested_(GET_PARAM(3)) {
}
: EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(1)),
test_encode_param_(GET_PARAM(2)), min_arf_requested_(GET_PARAM(3)) {}
virtual ~ArfFreqTestLarge() {}
......@@ -114,17 +107,16 @@ class ArfFreqTestLarge
}
int GetNumFramesInPkt(const vpx_codec_cx_pkt_t *pkt) {
const uint8_t *buffer = reinterpret_cast<uint8_t*>(pkt->data.frame.buf);
const uint8_t *buffer = reinterpret_cast<uint8_t *>(pkt->data.frame.buf);
const uint8_t marker = buffer[pkt->data.frame.sz - 1];
const int mag = ((marker >> 3) & 3) + 1;
int frames = (marker & 0x7) + 1;
const unsigned int index_sz = 2 + mag * frames;
const unsigned int index_sz = 2 + mag * frames;
// Check for superframe or not.
// Assume superframe has only one visible frame, the rest being
// invisible. If superframe index is not found, then there is only
// one frame.
if (!((marker & 0xe0) == 0xc0 &&
pkt->data.frame.sz >= index_sz &&
if (!((marker & 0xe0) == 0xc0 && pkt->data.frame.sz >= index_sz &&
buffer[pkt->data.frame.sz - index_sz] == marker)) {
frames = 1;
}
......@@ -132,8 +124,7 @@ class ArfFreqTestLarge
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
return;
if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return;
const int frames = GetNumFramesInPkt(pkt);
if (frames == 1) {
run_of_visible_frames_++;
......@@ -167,9 +158,7 @@ class ArfFreqTestLarge
}
}
int GetMinVisibleRun() const {
return min_run_;
}
int GetMinVisibleRun() const { return min_run_; }
int GetMinArfDistanceRequested() const {
if (min_arf_requested_)
......@@ -178,7 +167,7 @@ class ArfFreqTestLarge
return vp10_rc_get_default_min_gf_interval(
test_video_param_.width, test_video_param_.height,
(double)test_video_param_.framerate_num /
test_video_param_.framerate_den);
test_video_param_.framerate_den);
}
TestVideoParam test_video_param_;
......@@ -197,21 +186,18 @@ TEST_P(ArfFreqTestLarge, MinArfFreqTest) {
cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
cfg_.g_bit_depth = test_video_param_.bit_depth;
init_flags_ = VPX_CODEC_USE_PSNR;
if (cfg_.g_bit_depth > 8)
init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
if (is_extension_y4m(test_video_param_.filename)) {
video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename,
0, kFrames));
video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0,
kFrames));
} else {
video.reset(new libvpx_test::YUVVideoSource(test_video_param_.filename,
test_video_param_.fmt,
test_video_param_.width,
test_video_param_.height,
test_video_param_.framerate_num,
test_video_param_.framerate_den,
0, kFrames));
video.reset(new libvpx_test::YUVVideoSource(
test_video_param_.filename, test_video_param_.fmt,
test_video_param_.width, test_video_param_.height,
test_video_param_.framerate_num, test_video_param_.framerate_den, 0,
kFrames));
}
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
......@@ -235,15 +221,12 @@ INSTANTIATE_TEST_CASE_P(
::testing::Combine(
::testing::Values(static_cast<const libvpx_test::CodecFactory *>(
&libvpx_test::kVP10)),
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kTestVectors), ::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors)));
#endif // CONFIG_VP10_ENCODER
#else
VP10_INSTANTIATE_TEST_CASE(
ArfFreqTestLarge,
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors));
VP10_INSTANTIATE_TEST_CASE(ArfFreqTestLarge, ::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors));
#endif // CONFIG_VP9_HIGHBITDEPTH || CONFIG_EXT_REFS
} // namespace
This diff is collapsed.
This diff is collapsed.
......@@ -31,7 +31,7 @@ using libvpx_test::FunctionEquivalenceTest;
namespace {
template<typename F, typename T>
template <typename F, typename T>
class BlendA64MaskTest : public FunctionEquivalenceTest<F> {
protected:
static const int kIterations = 10000;
......@@ -61,37 +61,36 @@ class BlendA64MaskTest : public FunctionEquivalenceTest<F> {
src1_offset_ = this->rng_(33);
src1_stride_ = this->rng_(kMaxWidth + 1 - w_) + w_;
mask_stride_ = this->rng_(kMaxWidth + 1 - w_ * (subx_ ? 2 : 1)) +
w_ * (subx_ ? 2 : 1);
mask_stride_ =
this->rng_(kMaxWidth + 1 - w_ * (subx_ ? 2 : 1)) + w_ * (subx_ ? 2 : 1);
T *p_src0;
T *p_src1;
switch (this->rng_(3)) {
case 0: // Separate sources
case 0: // Separate sources
p_src0 = src0_;
p_src1 = src1_;
break;
case 1: // src0 == dst
case 1: // src0 == dst
p_src0 = dst_tst_;
src0_stride_ = dst_stride_;
src0_offset_ = dst_offset_;
p_src1 = src1_;
break;
case 2: // src1 == dst
case 2: // src1 == dst
p_src0 = src0_;
p_src1 = dst_tst_;
src1_stride_ = dst_stride_;
src1_offset_ = dst_offset_;
break;
default:
FAIL();
default: FAIL();
}
Execute(p_src0, p_src1);
for (int r = 0 ; r < h_ ; ++r) {
for (int c = 0 ; c < w_ ; ++c) {
for (int r = 0; r < h_; ++r) {
for (int c = 0; c < w_; ++c) {
ASSERT_EQ(dst_ref_[dst_offset_ + r * dst_stride_ + c],
dst_tst_[dst_offset_ + r * dst_stride_ + c]);
}
......@@ -125,31 +124,28 @@ class BlendA64MaskTest : public FunctionEquivalenceTest<F> {
// 8 bit version
//////////////////////////////////////////////////////////////////////////////
typedef void (*F8B)(uint8_t *dst, uint32_t dst_stride,
const uint8_t *src0, uint32_t src0_stride,
const uint8_t *src1, uint32_t src1_stride,
const uint8_t *mask, uint32_t mask_stride,
int h, int w, int suby, int subx);
typedef void (*F8B)(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0,
uint32_t src0_stride, const uint8_t *src1,
uint32_t src1_stride, const uint8_t *mask,
uint32_t mask_stride, int h, int w, int suby, int subx);
typedef libvpx_test::FuncParam<F8B> TestFuncs;
class BlendA64MaskTest8B : public BlendA64MaskTest<F8B, uint8_t> {
protected:
void Execute(const uint8_t *p_src0, const uint8_t *p_src1) {
params_.ref_func(dst_ref_ + dst_offset_, dst_stride_,
p_src0 + src0_offset_, src0_stride_,
p_src1 + src1_offset_, src1_stride_,
mask_, kMaxMaskWidth, h_, w_, suby_, subx_);
ASM_REGISTER_STATE_CHECK(
params_.tst_func(dst_tst_ + dst_offset_, dst_stride_,
p_src0 + src0_offset_, src0_stride_,
p_src1 + src1_offset_, src1_stride_,
mask_, kMaxMaskWidth, h_, w_, suby_, subx_));
params_.ref_func(dst_ref_ + dst_offset_, dst_stride_, p_src0 + src0_offset_,
src0_stride_, p_src1 + src1_offset_, src1_stride_, mask_,
kMaxMaskWidth, h_, w_, suby_, subx_);
ASM_REGISTER_STATE_CHECK(params_.tst_func(
dst_tst_ + dst_offset_, dst_stride_, p_src0 + src0_offset_,
src0_stride_, p_src1 + src1_offset_, src1_stride_, mask_, kMaxMaskWidth,
h_, w_, suby_, subx_));
}
};
TEST_P(BlendA64MaskTest8B, RandomValues) {
for (int iter = 0 ; iter < kIterations && !HasFatalFailure(); ++iter) {
for (int i = 0 ; i < kBufSize ; ++i) {
for (int iter = 0; iter < kIterations && !HasFatalFailure(); ++iter) {
for (int i = 0; i < kBufSize; ++i) {
dst_ref_[i] = rng_.Rand8();
dst_tst_[i] = rng_.Rand8();
......@@ -157,7 +153,7 @@ TEST_P(BlendA64MaskTest8B, RandomValues) {
src1_[i] = rng_.Rand8();
}
for (int i = 0 ; i < kMaxMaskSize ; ++i)
for (int i = 0; i < kMaxMaskSize; ++i)
mask_[i] = rng_(VPX_BLEND_A64_MAX_ALPHA + 1);
Common();
......@@ -165,15 +161,15 @@ TEST_P(BlendA64MaskTest8B, RandomValues) {
}
TEST_P(BlendA64MaskTest8B, ExtremeValues) {
for (int iter = 0 ; iter < kIterations && !HasFatalFailure(); ++iter) {
for (int i = 0 ; i < kBufSize ; ++i) {
for (int iter = 0; iter < kIterations && !HasFatalFailure(); ++iter) {
for (int i = 0; i < kBufSize; ++i) {
dst_ref_[i] = rng_(2) + 254;
dst_tst_[i] = rng_(2) + 254;
src0_[i] = rng_(2) + 254;
src1_[i] = rng_(2) + 254;
}
for (int i = 0 ; i < kMaxMaskSize ; ++i)
for (int i = 0; i < kMaxMaskSize; ++i)
mask_[i] = rng_(2) + VPX_BLEND_A64_MAX_ALPHA - 1;
Common();
......@@ -181,10 +177,9 @@ TEST_P(BlendA64MaskTest8B, ExtremeValues) {
}
#if HAVE_SSE4_1
INSTANTIATE_TEST_CASE_P(
SSE4_1_C_COMPARE, BlendA64MaskTest8B,
::testing::Values(
TestFuncs(vpx_blend_a64_mask_c, vpx_blend_a64_mask_sse4_1)));
INSTANTIATE_TEST_CASE_P(SSE4_1_C_COMPARE, BlendA64MaskTest8B,
::testing::Values(TestFuncs(
vpx_blend_a64_mask_c, vpx_blend_a64_mask_sse4_1)));
#endif // HAVE_SSE4_1
#if CONFIG_VP9_HIGHBITDEPTH
......@@ -192,11 +187,11 @@ INSTANTIATE_TEST_CASE_P(
// High bit-depth version
//////////////////////////////////////////////////////////////////////////////
typedef void (*FHBD)(uint8_t *dst, uint32_t dst_stride,
const uint8_t *src0, uint32_t src0_stride,
const uint8_t *src1, uint32_t src1_stride,
const uint8_t *mask, uint32_t mask_stride,
int h, int w, int suby, int subx, int bd);
typedef void (*FHBD)(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0,
uint32_t src0_stride, const uint8_t *src1,
uint32_t src1_stride, const uint8_t *mask,
uint32_t mask_stride, int h, int w, int suby, int subx,
int bd);
typedef libvpx_test::FuncParam<FHBD> TestFuncsHBD;
class BlendA64MaskTestHBD : public BlendA64MaskTest<FHBD, uint16_t> {
......@@ -209,37 +204,31 @@ class BlendA64MaskTestHBD : public BlendA64MaskTest<FHBD, uint16_t> {
ASM_REGISTER_STATE_CHECK(params_.tst_func(
CONVERT_TO_BYTEPTR(dst_tst_ + dst_offset_), dst_stride_,
CONVERT_TO_BYTEPTR(p_src0 + src0_offset_), src0_stride_,
CONVERT_TO_BYTEPTR(p_src1 + src1_offset_), src1_stride_,
mask_, kMaxMaskWidth, h_, w_, suby_, subx_, bit_depth_));
CONVERT_TO_BYTEPTR(p_src1 + src1_offset_), src1_stride_, mask_,
kMaxMaskWidth, h_, w_, suby_, subx_, bit_depth_));
}
int bit_depth_;
};
TEST_P(BlendA64MaskTestHBD, RandomValues) {
for (int iter = 0 ; iter < kIterations && !HasFatalFailure(); ++iter) {
for (int iter = 0; iter < kIterations && !HasFatalFailure(); ++iter) {
switch (rng_(3)) {
case 0:
bit_depth_ = 8;
break;
case 1:
bit_depth_ = 10;
break;
default:
bit_depth_ = 12;
break;
case 0: bit_depth_ = 8; break;
case 1: bit_depth_ = 10; break;
default: bit_depth_ = 12; break;
}
const int hi = 1 << bit_depth_;
for (int i = 0 ; i < kBufSize ; ++i) {
for (int i = 0; i < kBufSize; ++i) {
dst_ref_[i] = rng_(hi);
dst_tst_[i] = rng_(hi);
src0_[i] = rng_(hi);
src1_[i] = rng_(hi);
}
for (int i = 0 ; i < kMaxMaskSize ; ++i)
for (int i = 0; i < kMaxMaskSize; ++i)
mask_[i] = rng_(VPX_BLEND_A64_MAX_ALPHA + 1);
Common();
......@@ -247,30 +236,24 @@ TEST_P(BlendA64MaskTestHBD, RandomValues) {
}
TEST_P(BlendA64MaskTestHBD, ExtremeValues) {
for (int iter = 0 ; iter < 1000 && !HasFatalFailure(); ++iter) {
for (int iter = 0; iter < 1000 && !HasFatalFailure(); ++iter) {
switch (rng_(3)) {
case 0:
bit_depth_ = 8;
break;
case 1:
bit_depth_ = 10;
break;
default:
bit_depth_ = 12;
break;
case 0: bit_depth_ = 8; break;