IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
Does adding -q0 to -b320 improve quality in LAME 3.99.5?, [was “Lame Q Switch - definitive answer needed”/TOS #6]
peteharrison86
post Nov 18 2013, 22:01
Post #1





Group: Members
Posts: 9
Joined: 18-November 13
Member No.: 112296



Can anyone give a definitive answer on whether using -q0 with -b 320 will provide better quality than using -b 320 without a -q switch, when encoding with the latest version of Lame (3.99.5)? I've read various posts about it and some say it's buggy, some say it's in an experimental stage of development and some say it's brilliant. If -q0 isn't recommended, can better quality be achieved when using -b 320 with another -q switch as opposed to using -b 320 without a -q switch?

Thanks.
Go to the top of the page
+Quote Post
pdq
post Nov 18 2013, 22:25
Post #2





Group: Members
Posts: 3420
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



You need to check out halb27's constraint vbr variant if you want to improve on cbr 320.
Go to the top of the page
+Quote Post
greynol
post Nov 18 2013, 22:28
Post #3





Group: Super Moderator
Posts: 10022
Joined: 1-April 04
From: San Francisco
Member No.: 13167



Without double-blind test results for the specific tracks you want to encode, there is no point in commenting about sound quality for various encodes.


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
binaryhermit
post Nov 18 2013, 23:27
Post #4





Group: Members
Posts: 36
Joined: 23-April 09
Member No.: 69212



And my understanding is that the default is -q3, which is mapped to the same thing as -q0.
Go to the top of the page
+Quote Post
TomasPin
post Nov 18 2013, 23:48
Post #5





Group: Members
Posts: 204
Joined: 5-June 13
From: Argentina
Member No.: 108508



...or just use VBR and never mind the -q switch.


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
db1989
post Nov 18 2013, 23:54
Post #6





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (binaryhermit @ Nov 18 2013, 22:27) *
And my understanding is that the default is -q3, which is mapped to the same thing as -q0.
AFAIR, this applies to VBR only, with the two being different under CBR. Interested readers can check this for themselves in the source code or, if not feeling that adventurous, perhaps in previous discussions on this same old question.

This post has been edited by db1989: Nov 18 2013, 23:58
Go to the top of the page
+Quote Post
peteharrison86
post Nov 19 2013, 00:03
Post #7





Group: Members
Posts: 9
Joined: 18-November 13
Member No.: 112296



QUOTE (binaryhermit @ Nov 18 2013, 22:27) *
And my understanding is that the default is -q3, which is mapped to the same thing as -q0.


Yeah I was just about to say I thought that's only in VBR. I just encoded a track using -b 320 without a -q switch so the default of q3 was used (as was illustrated in the Lame encoder window) and then I encoded the same track using -b 320 with the -q0 switch and the encode with the -q0 switch took 4 times longer, 28 seconds instead of 7, so in CBR q3 isn't mapped to q0.
Go to the top of the page
+Quote Post
DVDdoug
post Nov 19 2013, 00:22
Post #8





Group: Members
Posts: 2625
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



QUOTE
If -q0 isn't recommended, can better quality be achieved when using -b 320 with another -q switch as opposed to using -b 320 without a -q switch?
As a broad generalization - If you are getting audible artifacts at 320kbps (or V0), there's probably nothing you can do to improve the default performance.
Go to the top of the page
+Quote Post
Makaki
post Nov 19 2013, 05:44
Post #9





Group: Members
Posts: 67
Joined: 20-May 13
Member No.: 108227



Just wanted to point out that -h (which means high quality on the documentation) is mapped to -q 2.
Go to the top of the page
+Quote Post
peteharrison86
post Nov 19 2013, 14:12
Post #10





Group: Members
Posts: 9
Joined: 18-November 13
Member No.: 112296



QUOTE (Makaki @ Nov 19 2013, 04:44) *
Just wanted to point out that -h (which means high quality on the documentation) is mapped to -q 2.


Yeah it's strange that the developers have set the 'high quality' option to map to -q2 and not -q0, which is presumably higher quality although when I read the documentation it did say "-q 2: recommended. Same as -h. -q 0 and -q 1 are slow and may not produce significantly higher quality.". I kinda thought nothing of it but I assume the difference between q2 and q0 really must be either negligible or nothing at all, or else why would the 'high quality' setting (-h) be q2 and not q0? It's still kinda counter intuitive if you want the highest quality to not use the highest quality setting (q0) and to use q2 instead... Unless the numbers are arbitrary and q2 is the best quality, due to q0 being buggy or experimental, if it is, or maybe it's just because q0 and q1 are slow and they are better quality than q2 but only by a negligible amount.
Go to the top of the page
+Quote Post
pdq
post Nov 19 2013, 15:10
Post #11





Group: Members
Posts: 3420
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



I would simply add that most if not all of the tuning of the algorithms was probably performed with -h, so use of any other switch means using relatively untested areas of code. That's enough for me to stick with -h.
Go to the top of the page
+Quote Post
[JAZ]
post Nov 19 2013, 20:47
Post #12





Group: Members
Posts: 1785
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



First, about the OP's question: There is no definitive answer, because it hasn't been tested extensively.



Now, onto LAME's history:

The lame -q switches have had several evolutions during their history, including when they didn't exist and there was just -f and -h.
They are mostly related to CBR, because for VBR, the process of encoding is less dependant on how hard it tries to fit the data into the specified bitrate.
I won't enter much in detail, but the lame changelog has some information related to what was added to the different options.

Said that, it's important to understand this:

-f (and the -q 9 to -q 6 options) disable some of the analysis tools related to psychoacoustics and quantization. This means it calculates less information and as such, can make mistakes easier. The goal in this case is exclusively speed.
-h (and the -q 3 to -q 0 options) enable extra loops and analysis that allow to find the best compromise out of several options. The goal in this case, was to increase the quality for a determined bitrate. (CBR, remember?).

Now, onto the -q0 bug, the -q3 is the new -q2, and the -h is mapped to -q2 thing:

Several years ago, -q0 had a bug in its algorithm that could (i.e. not always) cause worse quality than -h (-q2 at that time). The bug was in the inner loop that tries to get the best quality by "brute force". Later on, this was fixed, but again it didn't receive much testing.

Later, a new "brute force" algorithm was created, and was activated with the -q 0 setting. This meant than then, all qualities were moved one position up. I.e. old -q2 became -q3, old -q0 became -q1 and so on (and yes.. old -q9 disappeared).

What didn't get changed was the quality to what -h was mapping, so this is why now -q 3 is the default (which used to be -h), and -h maintains the old mapping, that was -q 2.

It didn't help that nowadays, LAME is mostly tested for VBR, and as has been said already, the quality values work differently for VBR because they don't activate the same things.

This post has been edited by [JAZ]: Nov 19 2013, 20:48
Go to the top of the page
+Quote Post
peteharrison86
post Nov 20 2013, 00:05
Post #13





Group: Members
Posts: 9
Joined: 18-November 13
Member No.: 112296



QUOTE (pdq @ Nov 19 2013, 14:10) *
I would simply add that most if not all of the tuning of the algorithms was probably performed with -h, so use of any other switch means using relatively untested areas of code. That's enough for me to stick with -h.


I wonder why there isn't any mention of the -h switch (or the -q switches) on the wiki recommended settings. It says for best quality use -b 320 (with no switches). I wonder if it is safest to use -b 320 with no switches because that way you're using the developer's default settings that are regarded as safe / stable so there is the lowest likelihood of getting any artifacts. Can anyone clarify that? Is that the thinking behind -b 320 without any switches being listed in the wiki recommended settings?

This post has been edited by peteharrison86: Nov 20 2013, 00:08
Go to the top of the page
+Quote Post
pdq
post Nov 20 2013, 14:25
Post #14





Group: Members
Posts: 3420
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (peteharrison86 @ Nov 19 2013, 18:05) *
I wonder why there isn't any mention of the -h switch (or the -q switches) on the wiki recommended settings. It says for best quality use -b 320 (with no switches).

That's because -h is the default, so there is no need to include it.
Go to the top of the page
+Quote Post
peteharrison86
post Nov 20 2013, 16:38
Post #15





Group: Members
Posts: 9
Joined: 18-November 13
Member No.: 112296



QUOTE (pdq @ Nov 20 2013, 13:25) *
That's because -h is the default, so there is no need to include it.


-h isn't the default. When you use -b 320 with no switches it defaults to q3 and when you use -b 320 -h it maps to q2. I know q3 is the old q2 but in the Lame documentation and when you run lame --longhelp it says -h is the same as -q2 and it's recommended to use -h. If that is the case, on the wiki why doesn't it say it's recommended to use -h? Perhaps the Lame documentation is out of date and things have changed.
Go to the top of the page
+Quote Post
greynol
post Nov 20 2013, 18:07
Post #16





Group: Super Moderator
Posts: 10022
Joined: 1-April 04
From: San Francisco
Member No.: 13167



Probably because there no evidence that it provides any improvement in general.

Please refer to my first post in this discussion:
http://www.hydrogenaudio.org/forums/index....st&p=850498

It isn't just my opinion; it is forum policy.

This post has been edited by greynol: Nov 20 2013, 18:12


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
pdq
post Nov 20 2013, 18:22
Post #17





Group: Members
Posts: 3420
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



The nice thing about using the default in this case, is that you got the same results from one version to the next, even when the definitions of -q and -h were changing.

I distrust any switch for which the response to the question "What does it do?" is "For which version?"
Go to the top of the page
+Quote Post
greynol
post Nov 20 2013, 18:39
Post #18





Group: Super Moderator
Posts: 10022
Joined: 1-April 04
From: San Francisco
Member No.: 13167



One of a few very good reasons why we do not recommend additional switches.


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
Makaki
post Nov 20 2013, 20:34
Post #19





Group: Members
Posts: 67
Joined: 20-May 13
Member No.: 108227



Most of the information we have on the q switch is here:
http://wiki.hydrogenaudio.org/index.php?title=LAME_-q_switch

The information is based on previous discussions, feedback from the developers, the various documentations, verbose output of the lame tools, and the file headers of the resulting files.

EDIT: Note that those descriptions are as set by the LAME devs on the various docs, not Hydrogen Audio.


This post has been edited by Makaki: Nov 20 2013, 20:35
Go to the top of the page
+Quote Post
Fishman0919
post Nov 23 2013, 05:55
Post #20





Group: Members
Posts: 79
Joined: 18-December 03
Member No.: 10554



QUOTE (peteharrison86 @ Nov 18 2013, 13:01) *
Can anyone give a definitive answer on whether using -q0 with -b 320 will provide better quality than using -b 320 without a -q switch, when encoding with the latest version of Lame (3.99.5)? I've read various posts about it and some say it's buggy, some say it's in an experimental stage of development and some say it's brilliant. If -q0 isn't recommended, can better quality be achieved when using -b 320 with another -q switch as opposed to using -b 320 without a -q switch?

Thanks.


Will it provide better quality, YES.

Ask yourself this... If you pour a 1000 gallons of water into the ocean. does it increase it's level... YES. But would someone on the other side of the world notice the change?

Can you hear the difference... I can't answer that, but I think probably not.

It doesn't hurt for archiving but is the encoding time worth it? On my machine -b320 encodes at 38x where as -b320 -q0 does 10x

This post has been edited by Fishman0919: Nov 23 2013, 06:07
Go to the top of the page
+Quote Post
greynol
post Nov 23 2013, 06:53
Post #21





Group: Super Moderator
Posts: 10022
Joined: 1-April 04
From: San Francisco
Member No.: 13167



With lossy encoding, sound quality depends on what you can prove. If you cannot tell the difference between a -q0 encode and a -q3 encode then -q0 is not any better.

I suppose interested parties could try mushra testing files encoded to 112 CBR with various -q values in order to possibly get a sense of how the setting works, though once you hit transparency, there really is no such thing as increased quality.

This post has been edited by greynol: Nov 23 2013, 06:54


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
[JAZ]
post Nov 23 2013, 10:43
Post #22





Group: Members
Posts: 1785
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



QUOTE (Fishman0919 @ Nov 23 2013, 05:55) *
Will it provide better quality, YES.

Ask yourself this... If you pour a 1000 gallons of water into the ocean. does it increase it's level... YES. But would someone on the other side of the world notice the change?


That example is illustrative, but it is not completely correct, because increasing the level of quality does not mean "add more quality". It strictly means use more tools to determine the best usage of bits to retain the level of quality that the tools can analyze.

Between q3 and q0, there is also a change of some parameters, as described by the wiki article posted by Makaki, that change the level required. But that does not necessarily mean more quality, it means what is allowable.


As for the scenario described by greynol, testing a lower bitrate has its pros and cons. Since the bitrate is more restricted, trying harder can obtain a better representation of bits than what a lower q would do, but also, since less bitrate is available, the increased level of some parameters might not be fullfilled.

Go to the top of the page
+Quote Post
shadowking
post Nov 23 2013, 11:39
Post #23





Group: Members
Posts: 1527
Joined: 31-January 04
Member No.: 11664



I cannot see why q0 would not provide higher quality in some cases. Its more analysis and with cbr/abr that's a good thing. If we deviate in the other direction - towards Q9 thing do degrade at a certain point. Obviously Q3 was chosen as a 'sweet spot' for speed vs quality just like compression levels vs speed in lossless coders. To me it seems most people are after very fast encoding which I can understand and it becomes easy to dismiss the slower settings on those grounds that they are mostly 'useless'.

Whether the differences are audible is another issue. But if one isn't in a big hurry I'd give -Q0 or -Q1 a go using a lower encoding priority .


--------------------
Wavpack -b450s0.7
Go to the top of the page
+Quote Post
Nessuno
post Nov 23 2013, 11:40
Post #24





Group: Members
Posts: 423
Joined: 16-December 10
From: Palermo
Member No.: 86562



QUOTE (Fishman0919 @ Nov 23 2013, 05:55) *
It doesn't hurt for archiving...

Oh yes, it does hurt just using a lossy codec for archiving, whatever the codec and the bitrate or the quality level. It is a practice not to be endorsed.


--------------------
... I live by long distance.
Go to the top of the page
+Quote Post
greynol
post Nov 23 2013, 14:02
Post #25





Group: Super Moderator
Posts: 10022
Joined: 1-April 04
From: San Francisco
Member No.: 13167



Is it me, or are the arguments presented to support the idea that lower q values result in higher quality are just circular reasoning?

QUOTE (shadowking @ Nov 23 2013, 02:39) *
Whether the differences are audible is another issue.

No, whether the differences are audible is the issue.

QUOTE
mostly useless

Show me an example where it is useful @320 (per the topic) and you will have a leg to stand on.

This post has been edited by greynol: Nov 23 2013, 14:22


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2014 - 05:35