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: The "-q" switch? (Read 5991 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

The "-q" switch?

I am trying to add the "-q 0" switch effectively with the -V 2 ("2" or whatever value) preset with LAME 3.97 and there are interesting (or confusing) facts about this. As expected, the "-q 0" switch should and will decrease encoding speeds for LAME: I did the tests and this only happens when encoding using the old VBR algorithm (for example, -V 2 --vbr-old -q 0) but not with --vbr-new (e.g., -V 2 --vbr-new -q 0). Using the new VBR algorithm though the "-q" switch seems to have no value at all (or it could be that in the -V presets the codec might ignore such switch since it is defaulted to use it at "-q 2" or "-h").

Take a look at the SS I took of the LAME coding window box:
(commandline used: -V 2 --vbr-new -q 0)



From looking at the screenshot above, you may tell it is making use of -q 0 or -q 2? Or "VBR<q=2>" is not the same switch as the "qval=0" there? I'm totally confused.

The "-q" switch?

Reply #1
You should not be playing with the -q switch anyway, but I believe that it is ignored by vbr-new in 3.97 and later.

Edit: removed the quote.

The "-q" switch?

Reply #2
You should not be playing with the -q switch anyway, but I believe that it is ignored by vbr-new in 3.97 and later.

I just had a look at the CDex built-in encoding parameter options and it appears that "VBR<q=2>" and "qval=0" works independently otherwise CDex wouldn't make the two options available at the same time, I think (or it could be something the ripper devs. must have overlooked) :



The "-q" switch?

Reply #3
The q value that is next to the VBR string just denotes the -V setting.

So, -V 2 would show the string "VBR(q=2)"

-V 3 would show the string "VBR(q=3)"

-V 1.75 would show the string "VBR(q=1.75)"

and so on.


Now, the qval=x setting is what is specified by the -q parameter.

According to lame's help (when you do lame --longhelp),

"-q x"specifies the quality of the noise shaping and psychoacoustic algorithm.

If you don't specify anything with -q, by default it's the same as "-q 5"  regardless of the -V parameter.

"-h" is the same as "-q 2" and is the recommended parameter.  So, use either "-h" or "-q 2".  This is the "High Quality" setting.

Thus, "lame -h -V 3" is the same as "lame -q 2 -V 3"  however if you use "-h" instead of "-q 2" you won't get a "qval=2" in the display even though LAME is using that quality level.

"-q 0" is the "Highest Quality" setting for noise shaping and psychoacoustic algorithm, but also the slowest.

If you wanted the ultimate best VBR quality regardless of encoding speed, then doing "lame -q 0 -V 0" would be the way to go.

The "-q" switch?

Reply #4
In short: -V switch controls bitrate of mp3 file, -q switch controls complexity of compression algorithms.

The "-q" switch?

Reply #5
Uhm, alright thanks for the clarification guys.

I have been running a few tests and came to find that LAME does not ignore the additional "-q" parameter as I wondered it did when using it with the new VBR algorithm (--vbr-new), even if added manually by the user. What perhaps confused me is the fact that when specifying a -q value under --vbr-old that is not the default value, the encoding speeds may either increase or decrease in a very great amount (about 500% difference, taking for example -V 2 --vbr-old -q 2 against -V 2 --vbr-old -q 0 ---- while -V 2 --vbr-new -q 2 against -V 2 --vbr-new -q 0 is much lesser than 1%), which means that in the latter case the encoding speed was not sensible enough to me to perceive any difference in coding times on my trashy old rig (Northwood P4 2,4GHz non-HT ---- 1024MB DDR333 non-DC).

The "-q" switch?

Reply #6
I have been running a few tests and came to find that LAME does not ignore the additional "-q" parameter as I wondered it did when using it with the new VBR algorithm (--vbr-new), even if added manually by the user.

Because I believed this to be untrue and instead of simply dismissing difference in speed as completely insignificant, I encoded the same track twice with -V2 --vbr-new -q2 and -V2 --vbr-new -q0 and compared the files.  I found that even though Lame headers were slightly different, the mp3 data was absolutely identical.  So while it would appear that the statement is technically correct, it would seem that the two files are incapable of providing any possibility of producing an audible difference.

 

The "-q" switch?

Reply #7
@greynol:

Yes, I agree with you when you allege that -q 0 and -q 2 produces no audible difference but only within the --vbr-new method for -V 2. I'd suggest comparing the "-q" switch values with using --vbr-old, as I was sensible to notice difference in audio quality (also, -q 0 instead of -q 2 here most of the time tends to yield MP3 files with slightly smaller filesize yet this doesn't necessarily mean that average bitrate is ever different). It's kind of odd isn't it? Having two different filesizes with no average bitrate change in both files. Go figure. But indeed there are cases where the average bitrate is lightly lower as shown in Foobar.

About the difference in audio quality between -V 2 --vbr-old -q 0 and -V 2 --vbr-old -q 2. Well, I admit not being so skilled at giving out further technical explanations over the subject but I'll give it a try. It's like it appears that when encoding with the additional -q 0 switch the outcome sounds a bit more like consistent, solid, and compressed principally in the lower frequencies (just like as in encoding to any lossy format upping the bitrate - e.g. -V 0 compared to -V 2 or Musepack Q5 to Q7 might be good examples of that although in the -q 0 case there is no bitrate gain but the opposite). But as I don't know the codecs too well, the noise shapping and psymodeling thingie I can't present my ideas otherwise in a metaphorical way. Can somebody confirm my theory?


PS: Just for the note if I were to use MP3 I'd choose --vbr-new so anyways.

The "-q" switch?

Reply #8
About the difference in audio quality between -V 2 --vbr-old -q 0 and -V 2 --vbr-old -q 2. Well, I admit not being so skilled at giving out further technical explanations over the subject but I'll give it a try. It's like it appears that when encoding with the additional -q 0 switch the outcome sounds a bit more like consistent, solid, and compressed principally in the lower frequencies (just like as in encoding to any lossy format upping the bitrate - e.g. -V 0 compared to -V 2 or Musepack Q5 to Q7 might be good examples of that although in the -q 0 case there is no bitrate gain but the opposite). But as I don't know the codecs too well, the noise shapping and psymodeling thingie I can't present my ideas otherwise in a metaphorical way. Can somebody confirm my theory?

You will need to supply ABX results to confirm this.

The "-q" switch?

Reply #9
Yes, I agree with you when you allege that -q 0 and -q 2 produces no audible difference but only within the --vbr-new method for -V 2.

In your last post you claimed there was a difference with --vbr-new.  I wasn't questioning that there was a difference with --vbr-old.

The "-q" switch?

Reply #10
OK,

Just wished to stress that the -q parameter has almost (if not completely) no affect with --vbr-new. Only with --vbr-old that there seems to have differences both in numbers and sound.

The "-q" switch?

Reply #11
Ahem....  First post in google with the search "lame vbr-new q site:hydrogenaudio.org":

http://www.hydrogenaudio.org/forums/index....showtopic=53455

Basically:  (as it has recently been said), lame documentation is sometimes outdated, and others years old.

What has been said above about the console output  (VBR(qval=2) and qval=0) is correct, i.e. the former is the parameter of the -V setting and the latter the one for the -q setting.

And most importantly (and answering this post), the values of q, for vbr-new, between q0 and q3 output the same file, not because of a bug, but because with vbr-new, there are less quality steps to choose from.

With vbr-old, it usually wasn't advised to use -q 0, (years ago, because of some bug, but later on, because of negligible difference, but important encoding time increase).