vp9_scale_test: parameterize filter type
this allows the test to be sharded more efficiently and speeds up the run when built with slower configs, e.g., asan. Change-Id: If6d863b76871e3934704a1079bbf17f4886932c7
This commit is contained in:
parent
cb16652598
commit
14b21b84e3
@ -47,7 +47,7 @@ class ScaleTest : public VpxScaleBase,
|
|||||||
scale_fn_(&img_, &dst_img_, filter_type, phase_scaler));
|
scale_fn_(&img_, &dst_img_, filter_type, phase_scaler));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunTest() {
|
void RunTest(INTERP_FILTER filter_type) {
|
||||||
static const int kNumSizesToTest = 20;
|
static const int kNumSizesToTest = 20;
|
||||||
static const int kNumScaleFactorsToTest = 4;
|
static const int kNumScaleFactorsToTest = 4;
|
||||||
static const int kSizesToTest[] = {
|
static const int kSizesToTest[] = {
|
||||||
@ -55,7 +55,6 @@ class ScaleTest : public VpxScaleBase,
|
|||||||
22, 24, 26, 28, 30, 32, 34, 68, 128, 134
|
22, 24, 26, 28, 30, 32, 34, 68, 128, 134
|
||||||
};
|
};
|
||||||
static const int kScaleFactors[] = { 1, 2, 3, 4 };
|
static const int kScaleFactors[] = { 1, 2, 3, 4 };
|
||||||
for (INTERP_FILTER filter_type = 0; filter_type < 4; ++filter_type) {
|
|
||||||
for (int phase_scaler = 0; phase_scaler < 16; ++phase_scaler) {
|
for (int phase_scaler = 0; phase_scaler < 16; ++phase_scaler) {
|
||||||
for (int h = 0; h < kNumSizesToTest; ++h) {
|
for (int h = 0; h < kNumSizesToTest; ++h) {
|
||||||
const int src_height = kSizesToTest[h];
|
const int src_height = kSizesToTest[h];
|
||||||
@ -82,8 +81,8 @@ class ScaleTest : public VpxScaleBase,
|
|||||||
if (src_width > 4 * dst_width || src_height > 4 * dst_height) {
|
if (src_width > 4 * dst_width || src_height > 4 * dst_height) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ASSERT_NO_FATAL_FAILURE(ResetScaleImages(
|
ASSERT_NO_FATAL_FAILURE(ResetScaleImages(src_width, src_height,
|
||||||
src_width, src_height, dst_width, dst_height));
|
dst_width, dst_height));
|
||||||
ReferenceScaleFrame(filter_type, phase_scaler);
|
ReferenceScaleFrame(filter_type, phase_scaler);
|
||||||
ScaleFrame(filter_type, phase_scaler);
|
ScaleFrame(filter_type, phase_scaler);
|
||||||
if (memcmp(dst_img_.buffer_alloc, ref_img_.buffer_alloc,
|
if (memcmp(dst_img_.buffer_alloc, ref_img_.buffer_alloc,
|
||||||
@ -92,8 +91,8 @@ class ScaleTest : public VpxScaleBase,
|
|||||||
"filter_type = %d, phase_scaler = %d, src_width = %4d, "
|
"filter_type = %d, phase_scaler = %d, src_width = %4d, "
|
||||||
"src_height = %4d, dst_width = %4d, dst_height = %4d, "
|
"src_height = %4d, dst_width = %4d, dst_height = %4d, "
|
||||||
"scale factor = %d:%d\n",
|
"scale factor = %d:%d\n",
|
||||||
filter_type, phase_scaler, src_width, src_height,
|
filter_type, phase_scaler, src_width, src_height, dst_width,
|
||||||
dst_width, dst_height, sf_down, sf_up);
|
dst_height, sf_down, sf_up);
|
||||||
PrintDiff();
|
PrintDiff();
|
||||||
}
|
}
|
||||||
CompareImages(dst_img_);
|
CompareImages(dst_img_);
|
||||||
@ -104,7 +103,6 @@ class ScaleTest : public VpxScaleBase,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void PrintDiffComponent(const uint8_t *const ref, const uint8_t *const opt,
|
void PrintDiffComponent(const uint8_t *const ref, const uint8_t *const opt,
|
||||||
const int stride, const int width, const int height,
|
const int stride, const int width, const int height,
|
||||||
@ -145,7 +143,10 @@ class ScaleTest : public VpxScaleBase,
|
|||||||
ScaleFrameFunc scale_fn_;
|
ScaleFrameFunc scale_fn_;
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_P(ScaleTest, ScaleFrame) { ASSERT_NO_FATAL_FAILURE(RunTest()); }
|
TEST_P(ScaleTest, ScaleFrame_EightTap) { RunTest(EIGHTTAP); }
|
||||||
|
TEST_P(ScaleTest, ScaleFrame_EightTapSmooth) { RunTest(EIGHTTAP_SMOOTH); }
|
||||||
|
TEST_P(ScaleTest, ScaleFrame_EightTapSharp) { RunTest(EIGHTTAP_SHARP); }
|
||||||
|
TEST_P(ScaleTest, ScaleFrame_Bilinear) { RunTest(BILINEAR); }
|
||||||
|
|
||||||
TEST_P(ScaleTest, DISABLED_Speed) {
|
TEST_P(ScaleTest, DISABLED_Speed) {
|
||||||
static const int kCountSpeedTestBlock = 100;
|
static const int kCountSpeedTestBlock = 100;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user