Quote:
Originally Posted by Hemiyoda
I want to clarify that the intended usage of my compressor is to reduce storage space. Not reducing runtime memory usage.
(although decoding would absolutely be fast enough because it's only shifts/masking,lut lookup & addition)
|
Do you use a predictor? One of the mistakes of my old code was that it only really looked at the difference between the currently reconstructed sample (while encoding) versus the next real input and tried to find the delta value from the set that, when added to the current value, would always be closest to the next input sample value. That works but it's not the best. You can use a predictor function that first estimates the next sample based on the previous N values and then you only need the difference between the predicted value and the actual value and to encode that, which typically results in less data to encode for the same amount of bits. There are lots of potential functions you can use (and documentation) some of which are not too expensive.
TLDR - the differences between predicted next sample and actual next sample are usually smaller than the differences between adjacent samples.