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: Strange results with Flac -0 & -3 in mono (Read 3626 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Strange results with Flac -0 & -3 in mono

While doing a lossless codecs comparison (yes, another one  ), I stumbled onto something I can't understand. I'm running these tests with 10 stereo CD and 10 mono CD. Here are my results with Flac 1.1.2:

10 Stereo CD
Total: 4860086216 bytes

Compressed:

-8: 3189723402 bytes (65,20%)
-7: 3195791461 bytes (65,32%)
-6: 3198932756 bytes (65,39%)
-5: 3200999368 bytes (65,43%)
-4: 3207872530 bytes (65,58%)
-3: 3268724195 bytes (66,78%)
-2: 3331715287 bytes (68,21%)
-1: 3345254970 bytes (68,49%)
-0: 3394787422 bytes (69,46%)

Those are expected results, nothing worth mentioning. Then here are the results on mono CD:

10 mono CD
Total: 5 014 974 824 bytes

Compressed:

-8: 1985302030 bytes (40,17%)
-7: 1987809706 bytes (40,22%)
-6: 1989794663 bytes (40,25%)
-5: 1990929735 bytes (40,28%)
-4: 1992459767 bytes (40,31%)
-3: 3097916561 bytes (62,03%)
-2: 2089742661 bytes (42,25%)
-1: 2094052058 bytes (42,33%)
-0: 3237643894 bytes (64,82%)

Presets -0 and -3 yield weird results, compared to other presets. Of course, I checked this and did this twice. Still, same results. Individually, each CD yield more or less the same result.

Could someone do a quick test and either confirm this or tell me I erred somewhere?

Strange results with Flac -0 & -3 in mono

Reply #1
Just looking at the presets:

Code: [Select]
-0, --compression-level-0, --fast  Synonymous with -l 0 -b 1152 -r 2,2
 -1, --compression-level-1          Synonymous with -l 0 -b 1152 -M -r 2,2
 -2, --compression-level-2          Synonymous with -l 0 -b 1152 -m -r 3
 -3, --compression-level-3          Synonymous with -l 6 -b 4608 -r 3,3
 -4, --compression-level-4          Synonymous with -l 8 -b 4608 -M -r 3,3
 -5, --compression-level-5          Synonymous with -l 8 -b 4608 -m -r 3,3
                                    -5 is the default setting
 -6, --compression-level-6          Synonymous with -l 8 -b 4608 -m -r 4
 -7, --compression-level-7          Synonymous with -l 8 -b 4608 -m -e -r 6
 -8, --compression-level-8, --best  Synonymous with -l 12 -b 4608 -m -e -r 6


It looks like it might have something to do with the -M or the -m switch which control whether or not adaptive mid-side or mid-side are used. It doesn't make sense though because those switches are only supposed to affect stereo encoding, unless there is a bug in the implementation. That is the only thing that I can see though. I've got some mono recordings I can test later and I'll see if the results are the same.


EDIT: If I don't try before you do, try using the -0 or the -3 switch with --channels=1.

Strange results with Flac -0 & -3 in mono

Reply #2
yes, for mono -0 and -1 should be the same, I suspect some bug with -M.

Josh

 

Strange results with Flac -0 & -3 in mono

Reply #3
Hmm, I'm not sure, I just tested one song, an old Beatles mono recording and I'm getting predictable results with -0 and -3. No bloated bitrates or anything. What was the cd you were using?

Strange results with Flac -0 & -3 in mono

Reply #4
Zoom and Josh: thanks for your answers. On Hardware.fr (a french forum), hpl-nyarla thotep did a quick test with 1 song ( Billie Holiday - [Greatest Hits #01] Easy Living [3:13] ). Same weird results than me:

Quote
-0 16552345 Bytes (48,57)%
-1 8363889 Bytes (24,54)%
-2 8337582 Bytes (24,46)%
-3 16117403 Bytes (47,29)%
-4 8080481 Bytes (23,71)%
-5 8080475 Bytes (23,71)%
-6 8075013 Bytes (23,69)%
-7 8053083 Bytes (23,63)%
-8 8040380 Bytes (23,59)%


I'm going to test again with --channels=1, as Zoom suggested.

@Josh: your answer is focused on -0 and -1. Should I understand that the -3 preset's ratio with mono files is to be expected?

@Zoom: The CDs are:

B.B. King: The Chronological 1949-1952
Bo Diddley: Bo Diddley is a Gunslinger
The Checkmates, ltd: Love is All We Have to Give
Elvis Presley: Elvis Presley (1956)
Jerry Lee Lewis: Jerry Lee Lewis (1958)
Otis Redding: Pain in My Heart
Ray Charles: The Birth of Soul (CD 1)
Small Faces: Small Faces (Anniversary ed., CD 2)
The Velvelettes: The Best Of
The Velvet Underground: The V. U. & Nico (Deluxe ed., CD 2)

Strange results with Flac -0 & -3 in mono

Reply #5
Ok, I think I figured out what is going on. Are you ripping the files as 16bit Mono WAV and then encoding to FLAC? or Are you ripping the files as 16bit Stereo WAV and then encoding to FLAC?

I ripped my files as mono and could not reproduce the errors you are getting. So I thought about it and guessed maybe you were ripping your mono files as stereo instead. By ripping a mono file as stereo you are basically duplicating the one channel to create stereo. This would indicate that the absence of the mid-side coding would create larger files. When mid-side is used the encoder can see that the two channels are identical and produces a smaller file.

I suppose I could be wrong, but that seems like the only logical explanation to me.

EDIT: Ok my encoding batch is done, yeah I get the same errors with a dual mono input file. -0 and -3 are larger.

Strange results with Flac -0 & -3 in mono

Reply #6
Quote
Ok, I think I figured out what is going on. Are you ripping the files as 16bit Mono WAV and then encoding to FLAC? or Are you ripping the files as 16bit Stereo WAV and then encoding to FLAC?

16bit stereo WAV then encoded to FLAC.  Actually, I could have rip them as mono files since these 10 CDs are all mono. But most of my 60's CD re-releases include both mono and stereo tracks, and the booklets don"t always mention which are mono or stereo.
Quote
I suppose I could be wrong, but that seems like the only logical explanation to me.

I'm pretty sure you've nailed it. Thank you. For what it's worth, I still did the test with --channels=1 and the results were the same.

@Josh: I think it's very confusing for users. I suppose most of the people rip their CD as stereo, without bothering to listen before ripping to each track to know if it's mono or stereo. And they probably expect like I did a better compression with -3 than with -2. I may be wrong, but I think FLAC is the only lossless codec with presets not recommanded for mono ripped in stereo. Maybe a warning somewhere would be useful? There is still an awful lot of mono or mixed mono/stereo records out there, and a lot of old geezers like me who love that music.