slmdev / sac

state-of-the-art lossless audio compression
44 stars 4 forks source link

62.5% of encoded files are NOT lossless #3

Closed T-3B closed 1 year ago

T-3B commented 1 year ago

I'll leave this issue open, since SAC is no longer maintained (this issue is therefore a warning for incoming users).

I tested quite many lossless audio codecs, and while SAC provides the absolute best ratio (as the same time it can be the slowest), in many cases it is not lossless at all. And when I say that the compression was lossy, it is really really noticeable (and you better turn your volume down !!!): a big hissing sound in high frequencies.

I don't know if the problem came from compression or decompression, but still the problem is not negligible.

I made a huge Google Sheets document, comparing the several codecs and softwares: size and (de)compression speeds. Codecs: SAC, LA, OFR, ALAC, CMIX (for comparison only purpose), FLACCL, FLAC, FFmpeg's FLAC (all flac were tested with subset and non-subset modes). Link: https://docs.google.com/spreadsheets/d/1H_icYtkqV0C4L7yRMKIMdwE8dxGyi9wtkB_H2NL4J7o/edit?usp=sharing There is no license for that Sheet, but please when you reference/share it, add a link to this message. Look at the bottom of the Sheet to see the most beautiful and meaningful graph you've ever seen! I finally discovered several ways to decrease the size of FLAC files (further than what I used in that test), so don't hesitate to ask me some stuffs :) .

Here you can download the 40 sample files I used: http://listening-test.coresv.net/results.htm#list11

On this image you can see all the lossy SAC files in yellow: image

You want a little Easter Egg ? --optimize=insane is allowed - even if not printed with the help message - and provides even better compression ratio, but takes insane amount of time.

slmdev commented 1 year ago

@T-3B Thank you for your extensive testing and your feedback. I have to admit, i did not test SAC v0.6.2 in any way! The official v0.5.1 release works flawlessly for your examples, as far as i can tell.

I can reproduce your issues using v0.6.2 on my side but need some time for investigation.

slmdev commented 1 year ago

@T-3B The issue was a trivial error when applying mean correction. Instead of >0 it should have been != 0.

Because the mean correction might lead to unexpected behavior in the sparse-pcm model, i removed the mean correction for the time being.

I also fixed the wrong header-size calculation when using --listfull

Commit: 77d01e6

I will take care for non-standard wave-files later.

T-3B commented 1 year ago

@slmdev Thank you so much for this !

I really love it, and please forgive me for thinking the project was dead.

I'll try the new version soon.

If you ever have time, it would be nice to fix 2 very quick things (like an acquaintance of mine who did the fork here ):

Again, I appreciate greatly your work and program.

MartinEesmaa commented 1 year ago

@slmdev, @T-3B, waiting for my pull request: https://github.com/slmdev/sac/pull/4