| Index: source/libvpx/test/convolve_test.cc
|
| ===================================================================
|
| --- source/libvpx/test/convolve_test.cc (revision 223100)
|
| +++ source/libvpx/test/convolve_test.cc (working copy)
|
| @@ -8,6 +8,7 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| +#include <string.h>
|
| #include "test/acm_random.h"
|
| #include "test/register_state_check.h"
|
| #include "test/util.h"
|
| @@ -187,7 +188,7 @@
|
|
|
| protected:
|
| static const int kDataAlignment = 16;
|
| - static const int kOuterBlockSize = 128;
|
| + static const int kOuterBlockSize = 256;
|
| static const int kInputStride = kOuterBlockSize;
|
| static const int kOutputStride = kOuterBlockSize;
|
| static const int kMaxDimension = 64;
|
| @@ -224,6 +225,10 @@
|
| input_[i] = prng.Rand8Extremes();
|
| }
|
|
|
| + void SetConstantInput(int value) {
|
| + memset(input_, value, kInputBufferSize);
|
| + }
|
| +
|
| void CheckGuardBlocks() {
|
| for (int i = 0; i < kOutputBufferSize; ++i) {
|
| if (IsIndexInBorder(i))
|
| @@ -543,6 +548,35 @@
|
| }
|
| }
|
|
|
| +/* This test exercises that enough rows and columns are filtered with every
|
| + possible initial fractional positions and scaling steps. */
|
| +TEST_P(ConvolveTest, CheckScalingFiltering) {
|
| + uint8_t* const in = input();
|
| + uint8_t* const out = output();
|
| +
|
| + SetConstantInput(127);
|
| +
|
| + for (int frac = 0; frac < 16; ++frac) {
|
| + for (int step = 1; step <= 32; ++step) {
|
| + /* Test the horizontal and vertical filters in combination. */
|
| + REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride,
|
| + vp9_sub_pel_filters_8[frac], step,
|
| + vp9_sub_pel_filters_8[frac], step,
|
| + Width(), Height()));
|
| +
|
| + CheckGuardBlocks();
|
| +
|
| + for (int y = 0; y < Height(); ++y) {
|
| + for (int x = 0; x < Width(); ++x) {
|
| + ASSERT_EQ(in[y * kInputStride + x], out[y * kOutputStride + x])
|
| + << "x == " << x << ", y == " << y
|
| + << ", frac == " << frac << ", step == " << step;
|
| + }
|
| + }
|
| + }
|
| + }
|
| +}
|
| +
|
| using std::tr1::make_tuple;
|
|
|
| const ConvolveFunctions convolve8_c(
|
|
|