Comparison : 24bit/192KHz/stereo FLAC vs. APE, How can it be ? |
![]() ![]() |
Comparison : 24bit/192KHz/stereo FLAC vs. APE, How can it be ? |
Jul 25 2008, 16:55
Post
#1
|
|
|
troll / ban evasion Group: Banned Posts: 244 Joined: 22-April 08 Member No.: 52991 |
Hi everybody,
I've just made a small comparison between Monkey's Audio 3.99 (Extra High Compression) and FLAC 1.21 (Compression level 8 ), using 24bit/192KHz/stereo files (the files were generated from a vinyl rip). Of course I expected APE to perform slightly better than FLAC, like it usually does for 16bit/44KHz/stereo files (2-3%, maybe even 5%)... but I didn't really expect this ! ![]() Take a look at all the file sizes : we're talking about 20% difference here ! The total file size is 1,53 Go for APE vs. 1,88 Go for FLAC. So I don't understand. I'm a genuine FLAC enthusiast (all my files are FLAC), but... how can it be ? Is there something wrong here ? Can we do something to improve all the FLAC file sizes ? Thanks in advance for your explanation. |
|
|
|
Jul 26 2008, 00:47
Post
#2
|
|
|
Group: Members Posts: 40 Joined: 15-October 06 Member No.: 36375 |
MonkeyAudio do not support 192kHz! :confused:
Moderation: Removed unnecessary quote. This post has been edited by greynol: Jul 26 2008, 03:04 |
|
|
|
Jul 26 2008, 00:51
Post
#3
|
|
![]() Group: Members (Donating) Posts: 1983 Joined: 4-January 04 From: Austin, TX Member No.: 10933 |
My understanding is that the lowest 8-12 bits of a 24-bit recording are pretty much white noise (as LossyWAV has so handily illustrated). Every lossless codec handles pure white noise equally bad, but they handle low-level white noise considerably differently. APE's encoding tends to do considerably better.
|
|
|
|
Jul 26 2008, 02:38
Post
#4
|
|
|
Group: Members Posts: 103 Joined: 14-July 04 Member No.: 15437 |
MonkeyAudio do not support 192kHz! :confused: From the Monkey's Audio FAQ: Exactly what kind of files does MAC support? For now, the list goes like this: (but it'll hopefully grow as time goes on) Format: PCM WAVE (standard windows .wav file) Sample Rate: anything Bit depth: 8 or 16 or 24 Channels: 1 or 2 As a note, MAC has been tuned primarily for 44khz, 16-bit stereo music, since this is what today's CDs are. 192kHz fits into the "anything" category. |
|
|
|
Jul 27 2008, 04:48
Post
#5
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
Take a look at all the file sizes : we're talking about 20% difference here ! The total file size is 1,53 Go for APE vs. 1,88 Go for FLAC. Not really surprising for me... From earlier evaluations of some 44 Khz files i knew, that FLAC has some weaknesses when it has to deal with low passed files. Well, because 192 Khz audio recordings usually don't contain much frequencies above 20 Khz, they could also be considered as low passed. Therefore i expected to see FLAC perform worse on 192 KHz samples. Out of interest i unlocked TAK support for 192 KHz files (the last official release only supports up to 96 KHz). Since i don't have any 192 KHz recordings i upsampled the 13 files of my 24-bit/96 KHz test corpus (Cooledit with maximum quality settings). Results: CODE FLAC 1.2.1 -8 46.20 Monkey's Audio 3.99 High 38.09 Extra 35.52 Insane 35.76 OptimFrog 4.600ex --ExtraNew 29.98 TAK 1.0.4 (with 192 Khz support unlocked ) -p0 45.15 -p1 37.93 -p3m 34.91 TAK 2.0 (Developer version) -p3m 31.94 TTA 3.4 Default 39.41 WavPack 4.41 -hhx3 44.84 -hhx4 34.01 -hhx6 33.40 Quite similar to your findings... So I don't understand. I'm a genuine FLAC enthusiast (all my files are FLAC), but... how can it be ? Is there something wrong here ? Can we do something to improve all the FLAC file sizes ? I think the resolution/accuracy of FLAC's predictor coefficients isn't sufficient to deal with such files. I don't know, if it's possible to increase the accuracy without breaking the FLAC format. Thomas edit: Results for Monkey's Audio added. edit 2: Updated the results for TAK -p0 to -p2. Better compression because of a quick optimization of some parameter estimation in the encoder. edit 3: Results for WavPack -hhx3 added. edit 4: Results for WavPack -hhx4 and -hhx6 added. edit 5: Results for TAK 2.0 (Alpha, unreleased!) added. edit 6: Results for TTA added. edit 7: Results for OptimFrog added. Results for TAK 2.0 updated. This post has been edited by TBeck: Jul 31 2008, 12:57 |
|
|
|
Jul 27 2008, 16:38
Post
#6
|
|
|
troll / ban evasion Group: Banned Posts: 244 Joined: 22-April 08 Member No.: 52991 |
Thanks everyone for all your interesting answers.
Well, so it looks that FLAC isn't really well-suited at the moment for low-passed files, thus for 96 and 192 KHz files. Considering the results, I think it will be better for me to stick with FLAC for 16/44 files, but to switch to another format for 24/96 and 24/192 files. I don't like the idea of handling two different lossless formats in my collection, but the gap is huge, and I don't see any reason for losing almost 350 MB of disk space for a single album. I secretly hope Josh Coalson has some ideas in store for improving FLAC's handling of HD audio files. We'll see ! Oh, one last question : in your opinion, is this issue related only to the frequency (96, 192 KHz) or also to the bits per sample ? In other words, would FLAC perform much better with 24bit/48KHz files than it does with 24bit/192KHz files ? This post has been edited by foorious: Jul 27 2008, 16:41 |
|
|
|
Jul 27 2008, 17:22
Post
#7
|
|
![]() lossyWAV Developer Group: Developer Posts: 1722 Joined: 11-April 07 From: Wherever here is Member No.: 42400 |
My understanding is that the lowest 8-12 bits of a 24-bit recording are pretty much white noise (as LossyWAV has so handily illustrated). Every lossless codec handles pure white noise equally bad, but they handle low-level white noise considerably differently. APE's encoding tends to do considerably better. Using two of the freely available Nine Inch Nails - The Slip downloads, 16/44.1 and 24/96, it is interesting to note the following:24/96 lossless (FLAC -5) : 2954 kbit/s (926MiB); lossyWAV --standard|FLAC -5: 787 kbit/s (247MiB) 16/44.1 lossless (FLAC -5) : 637 kbit/s (200MiB); lossyWAV --standard|FLAC -5: 476 kbit/s (149MiB) This post has been edited by Nick.C: Jul 27 2008, 17:23 -------------------- lossyWAV -q X | FLAC -8 ~= 308kbps
SGS III (Rooted) + 64GB |
|
|
|
Jul 27 2008, 18:36
Post
#8
|
|
![]() Group: Members Posts: 736 Joined: 17-September 06 Member No.: 35307 |
Oh, one last question : in your opinion, is this issue related only to the frequency (96, 192 KHz) or also to the bits per sample ? In other words, would FLAC perform much better with 24bit/48KHz files than it does with 24bit/192KHz files ? In conjunction with NickC's results, perhaps resampling (fb2k/Resampler) to 44.1 kHz and/or 48 kHz in the Convert DSP while retaining 24-bit output would answer that, and offer comparison between 16/44.1 and 24/44.1 when processed through lossyWAV (though it isn't certain the 16/44.1 is the same as a straight downconversion from the 24/96 files) |
|
|
|
Jul 27 2008, 18:53
Post
#9
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
Oh, one last question : in your opinion, is this issue related only to the frequency (96, 192 KHz) or also to the bits per sample ? In other words, would FLAC perform much better with 24bit/48KHz files than it does with 24bit/192KHz files ? Yes, it does. The problem with the limted predictor coefficients accuracy is rarely an issue up to 96 KHz. |
|
|
|
Jul 27 2008, 20:30
Post
#10
|
|
![]() lossyWAV Developer Group: Developer Posts: 1722 Joined: 11-April 07 From: Wherever here is Member No.: 42400 |
In conjunction with NickC's results, perhaps resampling (fb2k/Resampler) to 44.1 kHz and/or 48 kHz in the Convert DSP while retaining 24-bit output would answer that, and offer comparison between 16/44.1 and 24/44.1 when processed through lossyWAV (though it isn't certain the 16/44.1 is the same as a straight downconversion from the 24/96 files) Taking onboard your comment regarding whether the 16/44.1 is a straight downconversion of the 24/96, I used the SSRC dsp plugin (ultra mode) in foobar2000 to resample the 24/96 version down to 48kHz and 44.1kHz and got the following:24/96 lossless FLAC -5: 2954 kbit/s (926MiB); lossyWAV --standard|FLAC -5: 787 kbit/s (246MiB); 24/48 lossless FLAC -5: 1598 kbit/s (501MiB); lossyWAV --standard|FLAC -5: 517 kbit/s (162MiB); 24/44.1 lossless FLAC -5: 1489 kbit/s (466MiB); lossyWAV --standard|FLAC -5: 498 kbit/s (156MiB); Also, I changed the bitdepth in foobar2000 and dithered the 24/96 version to 16/96 and got: 16/96 lossless FLAC -5: 1421 kbit/s (445MiB); lossyWAV --standard|FLAC -5: 776 kbit/s (243MiB); This post has been edited by Nick.C: Jul 27 2008, 20:40 -------------------- lossyWAV -q X | FLAC -8 ~= 308kbps
SGS III (Rooted) + 64GB |
|
|
|
Jul 28 2008, 09:17
Post
#11
|
|
|
Group: Members Posts: 914 Joined: 22-October 01 From: the Netherlands Member No.: 335 |
24/44.1 lossless FLAC -5: 1489 kbit/s (466MiB); lossyWAV --standard|FLAC -5: 498 kbit/s (156MiB); 16/96 lossless FLAC -5: 1421 kbit/s (445MiB); lossyWAV --standard|FLAC -5: 776 kbit/s (243MiB); Seems to me that FLAC has a "weakness" with compressing 24bit files (though I never have bothered with 192kHz). If you're looking for another codec (besides the mentioned Monkey or TAK), wavPack does better with 24bit files than FLAC too. This post has been edited by GeSomeone: Aug 11 2008, 22:15 |
|
|
|
Jul 28 2008, 11:42
Post
#12
|
|
![]() Group: Members (Donating) Posts: 665 Joined: 10-January 05 From: Italy Member No.: 18968 |
24/44.1 lossless FLAC -5: 1489 kbit/s (466MiB); lossyWAV --standard|FLAC -5: 498 kbit/s (156MiB); 16/96 lossless FLAC -5: 1421 kbit/s (445MiB); lossyWAV --standard|FLAC -5: 776 kbit/s (243MiB); Seems to me that FLAC has a "weakness" with compressing 24bit files (though I never have bothered with 192kHz). If you're looking for another codec (besides the mentioned Monkey or TAK), wavPack does better with 24bit files then FLAC too. QUOTE
-------------------- WavPack 4.60.1 -hx6b4cm/qaac 2.15 -V 100
|
|
|
|
Jul 28 2008, 15:25
Post
#13
|
|
![]() Group: Members Posts: 538 Joined: 20-December 05 From: Springfield, VA Member No.: 26522 |
From the Monkey's Audio FAQ: Sample Rate: anything This must be a lie. You can't have "anything" in a digital computer with finite memory. -------------------- Ceterum censeo, there should be an "%is_stop_after_current%".
|
|
|
|
Jul 28 2008, 15:34
Post
#14
|
|
|
Group: Members Posts: 207 Joined: 11-April 02 Member No.: 1749 |
I think "anything" here just means no particular restrictions.
|
|
|
|
Jul 28 2008, 16:23
Post
#15
|
|
|
Group: Members Posts: 3083 Joined: 1-September 05 From: SE Pennsylvania Member No.: 24233 |
If you treat the data as simply a series of values and compress them accordingly then it makes no difference at what sample rate you play them back. It only matters that the desired platback sample rate can be expressed to the playing device. I assume the limitation here is how this value is encoded in a WAV file.
|
|
|
|
Jul 28 2008, 18:04
Post
#16
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
If you're looking for another codec (besides the mentioned Monkey or TAK), wavPack does better with 24bit files then FLAC too. Well, i have added the result for WavPack -hhx3 to my comparison above. It too seems to be less efficient with 192 KHz/ 24 Bit, only slightly better than FLAC. At least with my sample set. This post has been edited by TBeck: Jul 28 2008, 18:04 |
|
|
|
Jul 28 2008, 18:36
Post
#17
|
|
![]() Group: Developer Posts: 1317 Joined: 20-March 04 From: Göttingen (DE) Member No.: 12875 |
This is in response to the original question.
FLAC's problem (not the format's but the current reference encoder's problem) might be the suboptimal quantization of LP coefficients. In case of such high sampling rates and signals where there's almost nothing above 20 kHz the optimal LP filter's magnitude response is pretty far from being flat which implies that simple per-sample quantization of the LP coefficients may lead to large spectral distortions (= large discrepancy between calculated and quantized filter). Whether choosing a better quantization method really makes a big difference needs to be tested. If anyone is willing to try here's what needs to be done:
![]() (image taken from this paper, the hexagonal lattice is just an example for the lattice defined by the matrix L.) Also, it might be a good idea to check whether the current heuristic for choosing the LP coefficient accuracy (scale) could be improved for the case "24 bit + high sampling rate". In this regard I'd like to mention that the Levinson-Durbin algorithm has the advantage that it estimates the sum of squared prediction errors. LP coefficient quantization simply adds ||1/scale*L^T*x-b||^2 to this estimate which could help choosing the right scale factor for the LP coefficients. Cheers, SG edit: fixed bug in above paragraphs (I mixed up L and L^T) This post has been edited by SebastianG: Jul 30 2008, 10:54 |
|
|
|
Jul 28 2008, 19:46
Post
#18
|
|
![]() Group: Members Posts: 736 Joined: 17-September 06 Member No.: 35307 |
Seems to me that FLAC has a "weakness" with compressing 24bit files (though I never have bothered with 192kHz). If you're looking for another codec (besides the mentioned Monkey or TAK), wavPack does better with 24bit files then FLAC too. I happened to have conducted some tests yesterday, as yet unpublished, with reference to lossyWAV and clipping. Here's a preview of some tests of a fairly loudly mastered 2005 album, Keane's Hopes And Fears (Album Gain -9.87 dB) with all metadata stripped away (encoded with wavpack -hm or the recommended -hm --block-size 512 --merge-blocks in the case of lossyWAV processed files) Duration: 50:37.120 (133936992 samples) Filesize Filename 361,738,994 16bitlossless.wv (952kbps) 361,756,956 24bitpadded.wv (952kbps) which shows Wavpack handles the same 16-bit data marginally better when padded with zeroes to 24-bit, surprisingly, but essentially the same overall bitrate. 180,156,448 16bitStd.lossy.wv (474kbps) 179,583,978 24bitStd.lossy.wv (473kbps) 179,472,308 24bitStdScale0.5.lossy.wv (472kbps) This shows the same with lossyWAV -standard processing, and the --scale 0.5 version eliminates any potential clipping without losing any original data (because when scaled it originally occupied only bits 7 to 22, with bit 23 as headroom), thus allowing lossyWAV to reduce bit-depth unimpeded by clipping prevention. -------------------- Dynamic – the artist formerly known as DickD
|
|
|
|
Jul 29 2008, 17:17
Post
#19
|
|
![]() WavPack Developer Group: Developer (Donating) Posts: 1220 Joined: 3-January 02 From: San Francisco CA Member No.: 900 |
If you're looking for another codec (besides the mentioned Monkey or TAK), wavPack does better with 24bit files then FLAC too. Well, i have added the result for WavPack -hhx3 to my comparison above. It too seems to be less efficient with 192 KHz/ 24 Bit, only slightly better than FLAC. At least with my sample set. Thanks for trying out WavPack! Since we're talking about non-standard files here, I think that -hhx4 (or higher) would be a much better choice (even though it's much slower). The -x values from 1-3 use pre-calculated filters while values from 4-6 generate custom filters. |
|
|
|
Jul 29 2008, 20:01
Post
#20
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
Thanks for trying out WavPack! Since we're talking about non-standard files here, I think that -hhx4 (or higher) would be a much better choice (even though it's much slower). The -x values from 1-3 use pre-calculated filters while values from 4-6 generate custom filters. I have added the results for -hhx4 and -hhx6 to my comparison above. And the winner is... WavPack! Seems as if i have to tune TAK still a bit more for 192 Khz. This post has been edited by TBeck: Jul 29 2008, 20:02 |
|
|
|
Jul 29 2008, 21:49
Post
#21
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
|
|
|
|
Jul 30 2008, 05:33
Post
#22
|
|
![]() WavPack Developer Group: Developer (Donating) Posts: 1220 Joined: 3-January 02 From: San Francisco CA Member No.: 900 |
Thanks for trying out WavPack! Since we're talking about non-standard files here, I think that -hhx4 (or higher) would be a much better choice (even though it's much slower). The -x values from 1-3 use pre-calculated filters while values from 4-6 generate custom filters. I have added the results for -hhx4 and -hhx6 to my comparison above. And the winner is... WavPack! Seems as if i have to tune TAK still a bit more for 192 Khz. Wow! I expected an improvement, but I sure didn't expect over 10%! So, for almost 2 hours WavPack beat TAK ... hehe, that's cool. |
|
|
|
Jul 30 2008, 18:39
Post
#23
|
|
![]() Group: Members Posts: 99 Joined: 13-April 08 Member No.: 52748 |
Could you test TTA too?
It's very quick but gives usually better results than FLAC -8 (at least with 44.1 and 48 kHz material). -------------------- WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0
|
|
|
|
Jul 30 2008, 19:28
Post
#24
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
Could you test TTA too? It's very quick but gives usually better results than FLAC -8 (at least with 44.1 and 48 kHz material). Done. But please, i don't want to make this look like an exhaustive or representative codec comparison. I would need more and especially real 192 KHz files for this purpose. |
|
|
|
Jul 31 2008, 13:01
Post
#25
|
|
|
TAK Developer Group: Developer Posts: 1043 Joined: 1-April 06 Member No.: 29051 |
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 26th May 2013 - 09:33 |