HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: arandor on 2020-08-03 21:52:31

Title: No Difference Between -q 0 and -q4 Using LAME VBR?
Post by: arandor on 2020-08-03 21:52:31
TL;DR: Is there any difference between `-q 0` and `-q 4` when using LAME VBR?

The LAME documentation (https://svn.code.sf.net/p/lame/svn/trunk/lame/USAGE) says:
Code: [Select]
For the default VBR mode since LAME 3.98, the following table applies.

-q 0 to -q 4    include all features of the other modes and additionally use
the best search when applying Huffman coding.
-q 5 and -q 6   include all features of -q7, calculate and consider actual
quantisation noise, and additionally enable subblock gain.
-q 7 to -q 9    This level uses a psymodel but does not calculate quantisation
noise when encoding: it takes a quick guess.
         
Does that mean there is no difference between `-q 0` and `-q 4` when using VBR? LAME does the exact same thing for any `-q` value between `0` and `4`?

Or, are there still gradations of quality between `-q 0` and `-q 4` when using VBR?

Thanks
Title: Re: No Difference Between -q 0 and -q4 Using LAME VBR?
Post by: magicgoose on 2020-08-03 23:16:17
Not sure, but if you try it, does it produce identical files or not? (do they decode to exactly the same data?)
Title: Re: No Difference Between -q 0 and -q4 Using LAME VBR?
Post by: arandor on 2020-08-04 02:02:09
Not sure, but if you try it, does it produce identical files or not? (do they decode to exactly the same data?)
Thanks for the idea. I encoded the same file with `-q 0`, `-q 4`, and `-q 5` then I checked the file sizes. The `-q 0` and `-q 4` had the exact same number of bytes (down to the byte). I ran MD5 on both of them and the results were identical.

The `-q 5` file was a little larger and the MD5 hash was different. So it appears setting `-q` to any value between 0 and 4 does produce the same result when using VBR mode.

I did find it strange that the `-q 5` file was larger. It was only a difference of about 46KB, but I figured setting `-q` to a lower quality setting (higher number) would produce a slightly smaller file.

Thanks
Title: Re: No Difference Between -q 0 and -q4 Using LAME VBR?
Post by: kode54 on 2020-08-04 09:39:05
The only difference between -q 0-4 and the next higher setting level, is a stronger Huffman encoder. The difference is lossless when it comes to the compressed audio itself. It's the difference between using level 5 and level 9 with a ZIP compressor. More efficient compression, but no effect on the underlying data, it just takes longer to compress.
Title: Re: No Difference Between -q 0 and -q4 Using LAME VBR?
Post by: shadowking on 2020-08-04 11:55:32
For --vbr-new and default vbr since lame 3.98:

-q9..7 or -f are identical= noise shaping 0, but still uses the psymodel

-q6..5 are identical. Use psymodel + noise shaping

-q4..0 are identical. Use psymodel + noise shaping + more precisions

Title: Re: No Difference Between -q 0 and -q4 Using LAME VBR?
Post by: arandor on 2020-08-04 18:17:03
Thanks for all the info!