Skip to main content


Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Compressed files are larger than uncompressed (Read 1297 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Compressed files are larger than uncompressed

It is a test signal but I think I should report my findings anyway. Apart from "Extra High", all compressed files are larger than uncompressed.

Re: Compressed files are larger than uncompressed

Reply #1
Lossless compression of floating point isn't particularly easy, and requires the additional processing feature turned on to produce a smaller file. At least WavPack supports floating point, unlike most lossless codecs.

Re: Compressed files are larger than uncompressed

Reply #2
Thanks for the sample; I will add it to my test corpus!

There are a few things going on with this sample. The first is that because the right channel is silent, the default mode of joint stereo really hurts the compression, so just adding -j0 improves things a lot (and with no slower performance). And, of course, since any -x mode does a joint-stereo check, that also fixes the problem (although it hurts performance some).

The right channel is a pure 3 kHz sine and the compression there is greatly helped with the higher -x modes (4-6).

More generally, I decided early on to not have a special case check for inflation (negative compression) where I would switch to a “verbatim” mode with minimal overhead. With integer PCM the maximum inflation is only a few percent and it just didn't seem worth the extra complexity. In hindsight it would have been nice for 32-bit float data because the maximum inflation is higher (as you see here, and I have seen over 20% for pathological cases).

BTW, I also noticed that the maximum inflation can be high with DSD audio, and so I did implement a “verbatim” mode for that.

Re: Compressed files are larger than uncompressed

Reply #3
Thanks! I specifically used a floating point sample is also because Wavpack supports it so I can't just use something else like flac.

Re: Compressed files are larger than uncompressed

Reply #4
During my sojourn into float16 audio I seem to remember that there was a "store floats as integers" option, possibly undocumented, in WavPack - again from memory it worked well with fp16.

I may need to revisit this now that bfloat16 is coming - effectively a "shortened" float32, losing 16 mantissa bits.

lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848| FLAC -5 -e -p -b 512 -P=4096 -S-

SimplePortal 1.0.0 RC1 © 2008-2021