Skip to main content

Notice

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: 24-bit ALAC - much larger filesize than FLAC? (Read 13430 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

24-bit ALAC - much larger filesize than FLAC?

Hi all,

I've just noticed that 24-bit FLAC files converted to ALAC are significantly larger than the original FLAC files, and not much smaller than WAV.
Regular 16-bit files have negligible difference.

Is this normal? Is it the same for you?

Eg:

Original FLAC - 34.1 MB

FLAC to ALAC using XLD - 64.5 MB

FLAC to WAV using XLD - 77.3 MB
WAV to ALAC using iTunes - 64.5 MB

ALAC to FLAC using XLD - 38.9 MB
WAV to FLAC using XLD - 38.9 MB

Cheers

24-bit ALAC - much larger filesize than FLAC?

Reply #1
I'm guessing ALAC is just not really good for encoding 24 bit audio.

24-bit ALAC - much larger filesize than FLAC?

Reply #2
This might be true, but not necessarily. An ALAC file has a parameter that sets the maximum value for the rice coding parameters.  I believe most 16-bit files have this limited to 14, and it could be that Apple's encoder does not increase that for 24-bit.  I have not tried this out though.  FFmpeg's ALAC encoder does not yet support 24-bit, but I believe the one in dBPoweramp does, and it might do a better job with 24-bit than the Apple encoder.

24-bit ALAC - much larger filesize than FLAC?

Reply #3
I think that dBpowerAMP's ALAC encoder/decoder still supports only 16/44.1 operation.  I have a 24-bit ALAC file (generated with iTunes) and dBpowerAMP still refuses to properly convert it to anything (the resulting file is 30k in size).

I believe that this is normal behavior for ALAC as I conducted a small test using my 24-bit ALAC file.  I first converted it to WAV and then back to FLAC.  The FLAC file was almost half the size of the ALAC file.  I don't know what ALAC is doing here as the song really isn't that complex.  It is basically a cover of a rap song (by a non-rap artist) with simple beats.  However, I think that a 12.8MB difference is significant when comparing your ALAC and WAV test (my tests yielded slightly better results).  12.8MB represents a ~17% decrease in file size.

24-bit ALAC - much larger filesize than FLAC?

Reply #4
Is there an update on this issue?

I have a CD with a lot of high frequency noise, so I ran an AIFF rip of it through
sox -b 24 sinc -t 200 -15400
This produced 24-bit files with no content above roughly 15600 Hz.  Since I use iTunes/iPod Touch, my usual archival format is ALAC.  But the ALAC files were much larger than the ALAC from the original 16-bit file:  track 1, which is 3:14 in duration (stereo of course) became 26.6 Mb.  The relevant version of Quicktime is 7.6.6 (1674) on a MacBook Pro.
I made another copy dithered to 18 bits, by applying
sox vol 0.015625 dither
and then
sox -D vol 64
to the result, so that I have 24-bit files with zeroes in the 6 LSB's.
The ALAC of the 18-bit files were almost exactly the same size (e.g. 26.6 Mb for track 1).  A good lossless codec should be able to take advantage of the properties of signals that do not use the full bandwidth and bitdepth of their container formats.  When I did FLAC on the same track, the 24-bit version became 9.9 Mb, and the 18-bit version became 14 Mb.

Would future versions of Quicktime or other ALAC coders be able to do a good job on this kind of file?  If I'm going to be able to make claims about the audibility of this kind of filtering, I'll want it to be convenient to keep and play multiple copies  of my music.  I don't think I even have a media player that can handle FLAC files and output 24-bit audio.

24-bit ALAC - much larger filesize than FLAC?

Reply #5
Would future versions of Quicktime or other ALAC coders be able to do a good job on this kind of file?


Probably, but you'd have to ask Apple or ffmpeg.

If I'm going to be able to make claims about the audibility of this kind of filtering, I'll want it to be convenient to keep and play multiple copies  of my music.  I don't think I even have a media player that can handle FLAC files and output 24-bit audio.


AFAIK your ipod is just truncating to 16 bit (probably without dither) so you might as well just keep the 16 bit version on your player, and the store the 24 bit one as FLAC.


24-bit ALAC - much larger filesize than FLAC?

Reply #7
Given a 24-bit stream, ALAC stores the lower 8 bits completely uncompressed while applying the compression to the high 16 bits.  The "wasted bits" bit in the frame header indicates whether that uncompressed block of lower 8 bits is present or not, but it is generally the opposite of FLAC's use of the same term.

24-bit ALAC - much larger filesize than FLAC?

Reply #8
Given a 24-bit stream, ALAC stores the lower 8 bits completely uncompressed while applying the compression to the high 16 bits.  The "wasted bits" bit in the frame header indicates whether that uncompressed block of lower 8 bits is present or not, but it is generally the opposite of FLAC's use of the same term.



I take it this means that it will be impossible for future encoders to make efficient 24-bit ALAC while maintaining compatibility with current decoders?

24-bit ALAC - much larger filesize than FLAC?

Reply #9
AFAIK your ipod is just truncating to 16 bit (probably without dither) so you might as well just keep the 16 bit version on your player, and the store the 24 bit one as FLAC.


I'm pretty sure that iTunes and Quicktime Player on my computer send 24-bit streams to audio output, and that many other computer media players truncate to 16 bits.  The Apple players do not like FLAC.  I bought the iPod largely for the apps, and I don't really care whether I can store a lot of music on it.  I usually don't bother to make compact versions of my music files for the iPod.  I posted here more because I was surprised by the magnitude of the file size differences than because disc space is a pressing matter.

Do the ALAC format and Quicktime library support storing just two extra bits uncompressed at the end of each sample?  If so, it might be desirable for XLD to add a feature "truncate to n bits before encoding", so that it could know to call the encoder with the right settings.

24-bit ALAC - much larger filesize than FLAC?

Reply #10
The more obvious solution is to dither to 16 bits. The two extra bits should make no audible difference anyway.

24-bit ALAC - much larger filesize than FLAC?

Reply #11
Do the ALAC format and Quicktime library support storing just two extra bits uncompressed at the end of each sample?  If so, it might be desirable for XLD to add a feature "truncate to n bits before encoding", so that it could know to call the encoder with the right settings.

The number of uncompressed low bits is always a multiple of 8.  Perhaps Apple's engineers decided to treat that data like noise in the case of 24bps input, but it doesn't leave a lot of flexibility.

24-bit ALAC - much larger filesize than FLAC?

Reply #12
To me it seems a work in progress, ie they (Apple) will fix the 24 bit support better when they actually have a need to.