VP10: some changes to palette mode

Account for rounding in distortion calculation in k-means;
carry out rounding before duplicates removal of base colors;
replace numbers with macros;
use prefix increment.

Slight coding gain (<0.1%) on screen_content testset.

Change-Id: Ie8bd241266da6b82c7b2874befc3a0c72b4fcd8c
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index c9ad945..76e41ef 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -821,7 +821,8 @@
       vp10_k_means(data, centroids, indices, pre_indices, rows * cols,
                    n, 1, max_itr);
       vp10_insertion_sort(centroids, n);
-
+      for (i = 0; i < n; ++i)
+        centroids[i] = round(centroids[i]);
       // remove duplicates
       i = 1;
       k = n;