Refactor the greedy histogram merge.
Refactor the greedy histogram merge.

This is preparatory work for an upcoming commit.
No impact on speed or compression.

Change-Id: I62488ae6d2dbb5398f1604068c212ab8e26e82bc

PKRoma/libwebp,PKRoma/libwebp,webmproject/libwebp,PKRoma/libwebp,PKRoma/libwebp,PKRoma/libwebp,webmproject/libwebp,PKRoma/libwebp,webmproject/libwebp,webmproject/libwebp,webmproject/libwebp