FLAC is a streaming format. Each block of audio is compressed independently of the rest of the file.<p>Comparing it to any archival compression algorithm (PNG uses DEFLATE with some pre-filtering) is not an apples to apples comparison.<p>The utility of a streaming format is that, (a) your listeners can start the stream at any offset without having the preceding blocks, (b) the CPU overhead is generally stable and (c) decoding requires a minimal amount of memory and IO.
a single test case hardly means "beating" FLAC. indeed, if you just wanted to encode a sine wave at one frequency for 30 seconds, your encoder would encode this as a couple of bytes - for any general compression codec there will be a problem class for which it will not be optimal.<p>that said, this approach may obviously be applied more generally, but it remains to be seen if it will perform so well. self-similarity seems so obvious as a compression technique that i would be.. surprised if this sort of compression wasn't attempted before.
People forget one advantage of FLAC over other compression methods: it's directly playable. You don't need to decompress the whole thing before you can start playing it.<p>That's an essential feature for a media compression format.
Interesting approach, but:<p>> The sample audio I chose is one of the best case signals for this kind of compression, a single gradually decaying piano note.<p>Anyone know if this approach has any use in real-world scenarios?
Are there any lossless compression algorithms that use autocorrelation to reduce the bit depth on repeated cycles? For example a human voice sustaining a note may have similar cycles, but with enough low-level noise-like variations that traditional deflate-type compression does not help much. However if an algorithm could spot that the second cycle only has small differences to the first cycle, perhaps it could encode the second cycle as a diff to the first cycle. Since the second cycle differences are likely to be small, the bit depth could be reduced (e.g. to 2-3 bits). Then the third cycle could also be encoded as a diff of the second, so even a gradually changing volume can be encoded with a very low bit rate throughout while ending up significantly different from the first cycle.<p>Has that been tried before? Would be willing to spend a few evenings hacking on this myself.
To improve the calculation of the autocorrelation, first 'demean' the input sequence by subtracting its mean from it, like so: <a href="https://gist.github.com/anonymous/a293bdbfa9133a607dd1" rel="nofollow">https://gist.github.com/anonymous/a293bdbfa9133a607dd1</a><p>The reason being that autocorrelation (and convolution in general) is meaningful when the input signal is linear time invariant. Read more about that here: <a href="https://en.wikipedia.org/wiki/LTI_system_theory#Impulse_response_and_convolution_2" rel="nofollow">https://en.wikipedia.org/wiki/LTI_system_theory#Impulse_resp...</a>
Now while my intuition would certainly say that autocorrelation is a good candidate property to be used in (lossless) audio compression, I remain sceptical.<p>It is certainly not a recently discovered or difficult concept to grasp, so if it was that useful I would think that it was already included in things like FLAC...
Fun, but a good media compression format has other properties like: 1) low cost of decoding in terms of RAM/CPU etc. 2) ability to decompress an arbitrary amount of the audio from any starting point in the file, 3) ability to start decoding before the entire file is present.