(This is about vector quantization/lossy compression so I figured it was considered off-topic for the main forum
I'm writing a low-resource video codec using a simple vector quantization scheme that generates a new 256-entry codebook on every scene change. I've found that in very long scenes, there will eventually be a few codebook "holes" (vectors that nothing clusters to). I have two thoughts on how to deal with this:
- If there are one or more codebook entries that are not used once the frame's data is clustered, "force" a "scene change" which will generate a new codebook at that point in the stream. Wasteful, but solves the problem.
- For every unused entry, find the most popular entry and split it, then re-iterate just the split entries via the common generalized Lloyd's algorithm (GLA).
I'm leaning towards the second idea, but can't help thinking there is a better way. Does anyone know of any research papers or techniques that cover this? Google searches for "incremental codebook generation" lead to the wrong things (mostly low-complexity initial codebook generation methods).