aomedia /
avm /
5fb95f7d0296734021713569e0d12e0b34732b77 Palette: Handle case of too few unique centroids.
Even though number of unique colors in a block may be at least
PALETTE_MIN_SIZE, sometimes the K-means can generate fewer than
PALETTE_MIN_SIZE unique centroids due to integer rounding.
This was resulting in "k - PALETTE_MIN_SIZE" being negative and using
that as an index into palette_y_size_cost array was causing a UBSan
error.
BUG=aomedia:515
Change-Id: Ia00b4bb2efebbe43d1fec7b619ebb837b1ae961c
1 file changed