Fix CLPF test to avoid looking outside the frame
Change-Id: Iee9bc41a19d754e234a083f4416b938950f719a5
This commit is contained in:
Родитель
e575977311
Коммит
1f89d0f880
|
@ -109,7 +109,7 @@ void test_clpf(int w, int h, int depth, int iterations,
|
|||
// 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 @@ void test_clpf(int w, int h, int depth, int iterations,
|
|||
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче