[flac-dev] FLAC compression experiment

Federico Miyara fmiyara at fceia.unr.edu.ar
Sun Aug 20 03:26:14 UTC 2017


I think a sine wave is not the best way to test a compression algorithm 
since the only uncorrelated component is the quantizing error, which is 
very small.

First of all, my test for a 100 % 440 Hz tone yields 24.10 % instead of 
30.66 % as yours.

Second, for 16 bit, 44100 Hz the slope is so large that if the first 
sample is 0 then the second sample is about 1854 (being 100% = 32767). 
This means that atenuating it to a 5 % and then multiplying by 20 
probably will recover the signal accurately.

But if instead of a full scale sine wave you generate a signal that 
starts being a sine wave of an amplitiude equal to

10 / 32767 = 0.00030518

(equivalent to an amplitude -70.3087 dB)

and then, after, say, 10 s, follows a full scale (100 % = 0 dB) sine 
wave, then you'll find that the decoded signal is different from the 
original one if you apply your method, since normalizing to a anythig 
but 100 % will render the first part severely and unrecoverably 
distorted. And normalizing to a 5 % actually will make the signal 
vanish, so no matter by how much you multiply it, it will keep being 0.

Federico Miyara

On 19/08/2017 18:37, z1x2c3v4z1x2c3v4 wrote:
> Hi FLAC team.
> I feel I have found a super high compression way of FLAC. I have 
> tested a 1 hour WAV file of 440HTZ with a 5,25,50,75,100 normalize 
> volume preset. This dramatically changes the compression size of the 
> end FLAC file even though the WAV file size is identical for all 5 WAV 
> files. Only the volume is different. When you renormalize the WAV to 
> its original volume the file is still 100% original.
> My tests are the following.
> source file WAV. 1 hour 440HTZ tone. 600MB.
> volume at 100. FLAC file size is  184MB.
> volume at 75. FLAC file size is  166MB.
> volume at 50. FLAC file size is  143MB.
> volume at 25. FLAC file size is  109MB.
> volume at 5. FLAC file size is  96MB.
> From184MB to 96MB.
> As you can see from the full 100 normalize volume to the 5 
> normalize volume it is half the file size.
> So to put it. I think that you should have your compression of FLAC to 
> also include a normalize volume shift to further compress the end 
> product. Either have a default setting or allow a user to input an 
> option in the command line arguments to add a normalize volume value. 
> Then to uncompress it back to a WAV file FLAC would read the volume 
> header in the FLAC file to apply the WAV original normalize volume and 
> expand it back to its original state.
> Then have the FLAC decoder for all the players out there to read the 
> volume header so to play the FLAC at the WAV original normalize volume.
> I hope I have helped to develop FLAC further.
> _______________________________________________
> flac-dev mailing list
> flac-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/flac-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170820/0c2902a8/attachment-0001.html>

More information about the flac-dev mailing list