Fix CLPF test to avoid looking outside the frame
Change-Id: Iee9bc41a19d754e234a083f4416b938950f719a5
diff --git a/test/clpf_test.cc b/test/clpf_test.cc
index 2847b0a..fcdd061 100644
--- a/test/clpf_test.cc
+++ b/test/clpf_test.cc
@@ -109,7 +109,7 @@
// Test every combination of:
// * Input with up to <depth> bits of noise
// * Noise level around every value from 0 to (1<<depth)-1
- // * Blocks anywhere in the frame (along all egdes and also fully inside)
+ // * Blocks anywhere in the frame (but not on the edge)
// * All strengths
// If clpf and ref_clpf are the same, we're just testing speed
for (count = 0; count < iterations; count++) {
@@ -119,8 +119,8 @@
s[i] = clamp((rnd.Rand16() & ((1 << bits) - 1)) + level, 0,
(1 << depth) - 1);
- for (ypos = 0; ypos < size && !error; ypos += h * !error) {
- for (xpos = 0; xpos < size && !error; xpos += w * !error) {
+ for (ypos = 2; ypos < size - h - 2 && !error; ypos += h * !error) {
+ for (xpos = 2; xpos < size - w - 2 && !error; xpos += w * !error) {
for (strength = depth - 8; strength < depth - 5 && !error;
strength += !error) {
ref_clpf(s, ref_d, size, size, xpos, ypos, w, h, 1 << strength,