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 smaller than 16 Bit (Read 4044 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

24 Bit smaller than 16 Bit

I converted a 2 channel DTS-MA file. It guess that it is a mono track with 2 identical channels.

I used eac3to. But this does not matter. I was surprised by the file size.

Is it theoretically possible that a 24 bit flac is smaller than the 16 bit one? (same source)
In my case 151 MB vs 234 MB

I can only imagine that 24 bit flac is handling a 2 channel mono better. Can anyone confirm this?

Re: 24 Bit smaller than 16 Bit

Reply #1
I can only imagine that 24 bit flac is handling a 2 channel mono better. Can anyone confirm this?
Well, it could be that in the 24-bit the two channels are 100% identical, and in the second dither is causing them to be non-identical, but that is usually not the cause for such a difference in size. It could be the 24-bit file is actually even less than 16-bit but with wasted bits, and dither is causing those wasted bits to become filled with noise, but this is unlikely.

Without more information, it is hard to draw any conclusions.
Music: sounds arranged such that they construct feelings.

Re: 24 Bit smaller than 16 Bit

Reply #2
To start with the dumbest explanation first: if you recompress both with flac.exe using the same preset (e.g. -8 for both) - does the difference prevail?


Re: 24 Bit smaller than 16 Bit

Reply #3
Usually the 16-bit file is about 2/3rds the size of the 24-bit file...  About the same proportion as uncompressed files.

Is the sample rate the same?    And what is the sample rate?

What's the playing time?   (It might be helpful to calculate the bit rate to see which one is "more normal").

Quote
It guess that it is a mono track with 2 identical channels.
That might be good to know too...  FLAC is normally "smart enough" not to waste space when both channels are identical.   (I believe it uses M/S and if there is no "side" or almost no "side" it will take-almost no space.)

Re: 24 Bit smaller than 16 Bit

Reply #4
If you took a a 16 bit file padded to 24 bits and dither to 16 bits there is a good chance the file size will be larger because you now have to compress the original file and the added dither. 

Re: 24 Bit smaller than 16 Bit

Reply #5
Is it theoretically possible that a 24 bit flac is smaller than the 16 bit one? (same source)
In my case 151 MB vs 234 MB

Share a 10-20 second sample which exhibits a similar phenomenon, so that we can examine it and determine what's happening. Otherwise it's just guesswork.

Re: 24 Bit smaller than 16 Bit

Reply #6
Well, also:
DTS-MA can be converted losslessly using ffmpeg -i infile outfile.flac

(ffmpeg to .wav will default to 16 bits ... does ffmpeg truncate or dither?)

Re: 24 Bit smaller than 16 Bit

Reply #7
(ffmpeg to .wav will default to 16 bits ... does ffmpeg truncate or dither?)
Truncate:
Code: [Select]
]$ sox -r44.1k -n -b24 silence.24b.wav trim 0 10
]$ sox silence.24b.wav -n stats 2>&1 | grep 'Pk lev dB'
Pk lev dB       -inf

]$ ffmpeg -i silence.24b.wav out_default.wav
]$ sox out_default.wav -n stats 2>&1 | grep 'Pk lev dB'
Pk lev dB       -inf

]$ ffmpeg -i silence.24b.wav -af "aresample=dither_method=triangular" out_triangular.wav
]$ sox out_triangular.wav -n stats 2>&1 | grep 'Pk lev dB'
Pk lev dB     -90.31

And in the source code, the default is 0 (see options.c:91), which is DITHER_NONE (see swresample.h:149).

Re: 24 Bit smaller than 16 Bit

Reply #8
Sorry - I was off over the holiday.
Here are the data from Mediainfo. Reconverting does not change anything.

Original:
Code: [Select]
General
Complete name                            : E:\_test\original.dts
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
File size                                : 1.30 GiB
Overall bit rate mode                    : Variable

Audio
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless

16 Bit:
Code: [Select]
General
Complete name                            : E:\_test\16.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 235 MiB
Duration                                 : 1 h 59 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 275 kb/s

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 1 h 59 min
Bit rate mode                            : Variable
Bit rate                                 : 275 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Compression mode                         : Lossless
Stream size                              : 235 MiB (100%)
Writing library                          : libFLAC 1.3.3 (UTC 2019-08-04)

24 Bit:
Code: [Select]
General
Complete name                            : E:\_test\24.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 151 MiB
Duration                                 : 1 h 59 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 177 kb/s

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 1 h 59 min
Bit rate mode                            : Variable
Bit rate                                 : 177 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 151 MiB (100%)
Writing library                          : libFLAC 1.3.3 (UTC 2019-08-04)

Re: 24 Bit smaller than 16 Bit

Reply #9
When I use ffmpeg
dts -> flac (24 bit)
dts -> wav -> flac (16 bit)
then both files have almost the same size (149,9 vs 149,8 MB).

I saw that there is a new Flac version. I will check whether I have the problems also with 1.3.4

But the problem could be already libDcaDec.

Code: [Select]
command line: "D:\Tools\eac3to\eac3to.exe" "e:\_test\original.dts" "e:\_test\16.flac" -down16
------------------------------------------------------------------------------
DTS Master Audio, 2.0 channels, 24 bits, 48kHz
(core: DTS, 2.0 channels, 1509kbps, 48kHz)
Decoding with libDcaDec DTS Decoder...
libDcaDec reported the warning "XLL output not lossless".  <WARNING>
Reducing depth from 24 to 16 bits...
Encoding FLAC with libFlac...
Creating file "e:\_test\16.flac"...
Original audio track: max 24 bits, average 16 bits, most common 16 bits.
The processed audio track has a constant bit depth of 16 bits.
eac3to processing took 1 minute, 3 seconds.
Done.

Edit:
When I create a 16 Bit wav with eac3to and use ffmpeg afterwards to convert that wav to a flac then the size of the file is increasing again.
When I create a 24 bit wav with eac3to and create afterwards a 16 bit flac with it then I get again the large file (16 bit).
When I use ffmpeg to convert that 24 bit wav to a flac then I get a small file (24 bit).

Re: 24 Bit smaller than 16 Bit

Reply #10
Share a 10-20 second sample which exhibits a similar phenomenon, so that we can examine it and determine what's happening.
How can I do that? I tried Audacity - but when I import the wav, cut some seconds out and save that part to a new wav then I do not have that phenomenon.
I am not really familiar with ffmpeg.
 

I inverted the left channel with Audacity and merged it with the right one.
Only silence was left. So I assume that it is a 2-channel-mono track.
Or is there a better way to verify this?