Handle centroid rounding inside palette.c itself.

Mostly refactoring, but a very tiny functional change:
Do all rounding in calc_centroids() itself, instead of rounding in two
places inside palette.c

This gives a slight performance improvement for screen content:
0.078% on average.

Change-Id: I7a0e007d30ebf4e59839483a167123f31a222dd4
3 files changed