Remove some computations in histogram clustering

- move the bin_id to the Histogram
- do not consider empty histograms

The speed-ups are negligible as linear algorithms in uint16_t are
removed, while the whole code is still O(N^2) in histograms.

Change-Id: Ie9c4831f0f3c64af9d9710a1dc2d817ba165389e
This commit is contained in:
Vincent Rabaud
2025-04-11 08:55:24 +02:00
parent 44f91b0ddd
commit 00338240c1
2 changed files with 25 additions and 104 deletions

View File

@@ -44,6 +44,7 @@ typedef struct {
uint64_t red_cost; // literal, red & blue.
uint64_t blue_cost;
uint8_t is_used[5]; // 5 for literal, red, blue, alpha, distance
uint16_t bin_id; // entropy bin index.
} VP8LHistogram;
// Collection of histograms with fixed capacity, allocated as one