Commit e5442928 authored by Rupert Swarbrick's avatar Rupert Swarbrick Committed by Steinar Midtskogen
Browse files

Tiny cleanup in cdef_test.cc

This was triggered by a visual studio compile warning:

  cdef_test.cc(128):
  warning C4804: '>>': unsafe use of type 'bool' in operation

However the code is rather hard to parse for humans too: when I first
looked, I thought this was something to do with C++ templating...

The new version is equivalent but defines max_pos in an outer
loop (and a smaller indent).

Change-Id: I0c5cabeee44d0839a7956a4ab1cf4ec5abfcc9ee
parent 16efec40
......@@ -68,6 +68,7 @@ void test_cdef(int bsize, int iterations, cdef_filter_block_func cdef,
for (boundary = 0; boundary < 16; boundary++) {
for (depth = 8; depth <= 12; depth += 2) {
const unsigned int max_pos = size * size >> (depth == 8);
for (pridamping = 3 + depth - 8;
pridamping < 7 - 3 * !!boundary + depth - 8; pridamping++) {
for (secdamping = 3 + depth - 8;
......@@ -124,10 +125,7 @@ void test_cdef(int bsize, int iterations, cdef_filter_block_func cdef,
pristrength, secstrength, dir, pridamping,
secdamping, bsize, (1 << depth) - 1));
if (ref_cdef != cdef) {
for (pos = 0;
pos<sizeof(d) / sizeof(*d)>> (depth == 8) &&
!error;
pos++) {
for (pos = 0; pos < max_pos && !error; pos++) {
error = ref_d[pos] != d[pos];
errdepth = depth;
errpristrength = pristrength;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment