View Single Post
Old 13 March 2024, 10:59   #6
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,347
Quote:
Originally Posted by Hemiyoda View Post
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.

Last edited by Karlos; 13 March 2024 at 12:31.
Karlos is offline  
 
Page generated in 0.05827 seconds with 11 queries