rcuja fix: update 2d distance calculation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 30 May 2013 02:41:26 +0000 (22:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 30 May 2013 02:41:26 +0000 (22:41 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rcuja/rcuja.c

index b9c8a6377f07ee97a70b3587ea35ba24d922d678..1eeb6552e8380ccbae9863a28b65b074bee21ea2 100644 (file)
@@ -1136,10 +1136,10 @@ void ja_node_sum_distribution_2d(enum ja_recompact mode,
                for (bit_j = 0; bit_j < bit_i; bit_j++) {
                        unsigned int distance_to_best[4];
 
-                       distance_to_best[0] = nr_2d_11[bit_i][bit_j];
-                       distance_to_best[1] = nr_2d_10[bit_i][bit_j];
-                       distance_to_best[2] = nr_2d_01[bit_i][bit_j];
-                       distance_to_best[3] = nr_2d_00[bit_i][bit_j];
+                       distance_to_best[0] = abs_int((nr_2d_11[bit_i][bit_j] << 2U) - distrib_nr_child);
+                       distance_to_best[1] = abs_int((nr_2d_10[bit_i][bit_j] << 2U) - distrib_nr_child);
+                       distance_to_best[2] = abs_int((nr_2d_01[bit_i][bit_j] << 2U) - distrib_nr_child);
+                       distance_to_best[3] = abs_int((nr_2d_00[bit_i][bit_j] << 2U) - distrib_nr_child);
 
                        /* Consider worse distance to best */
                        if (distance_to_best[1] > distance_to_best[0])
This page took 0.026333 seconds and 4 git commands to generate.