Log in

View Full Version : Q=1 used in 2-pass encoding?


Niño
19th April 2003, 18:15
During a full 2-pass encoding, with no quantizer restrictions, does xvid use q=1 too?

Thanks for the answers.

Kyo
19th April 2003, 18:27
Nop...
And I have make a little test with cap the P quant to 1-16 and the quality was worse... may be that capping the I quant but i didn't make this test...

Sharro
19th April 2003, 18:33
Check the Quantization Tab of the second pass.

There u'll see that quantizers for I and P frames is set to 2-31 both.

Why you wondeR?

Encode a scene at quant 1 and the same scene at quant 2.

It's not easy to spot the difference between the two ...except... FILESIZE.

Hope to have helped.

Sharro

Sharro
19th April 2003, 18:35
Originally posted by Kyo
Nop...
And I have make a little test with cap the P quant to 1-16 and the quality was worse... may be that capping the I quant but i didn't make this test...

Avoid capping quantizers PERIOD.

Let Xvid do it's magic... Some scenes can get higher quantizers without anything noticeable and you're saving for scenes that do need lower quants.

All the best.

Sharro

Kyo
19th April 2003, 18:55
I have capped the quant to "reasonable" values and my encodes look very good to my eyes, I don't claim to be better or not without capping, they look the same for me, I'm not to dumb to put a cap on P to something like 2-8-6 like we had seen before on some posts, and I think that with 16 there's enought space to calculate...


BS
Kyo

Didée
19th April 2003, 22:56
Originally posted by Kyo
And I have make a little test with cap the P quant to 1-16 and the quality was worse
---------
I'm not to dumb to put a cap on P to something like 2-8-6 like we had seen before on some posts, and I think that with 16 there's enought space to calculate

Lord-in-heaven !

If your rips usually use such quantizer ranges, then IMHO you are making pretty bad work, sorry.
It is mostly agreed that for an high quality rip, you should reach an average quantizer of ~3, preferable even < 3 (for p-frames). Now, lets relax that a little and assume we want to achieve an average quantizer of 4. Even then your max.quant will be 6, perhaps some single strays at 7 (as long as you're using linear curve compression).
If you need and use quantizers up to 16, we're not talking about quality, but simply about bad ripping.
I'd be curious to see an example of what you call "good quality".

Okay, perhaps our tastes are too different ...

Didée

iago
20th April 2003, 00:10
I must say that I totally agree with Didée on this issue. Period.

(I feel no need to add anything since Didée's argument and explanations are more than clear imho.)

regards,
iago

Jan Marijniszoon
20th April 2003, 01:14
I agree with Didée and iago too!

My range is always 2 - 3 for I-frames and also 2 - 3 (max 5) for P-frames.

Just for the reason I want good quality! I try to avoid > quant 4 as much as possible, just because it sucks :-)

And don't tell me to let XviD do it's magic...
My own eyes know what's good for me, not the codec or the computer :-)
Bigger quants are always noticable with a good eye.

About quantisizer 1...
Sometimes it gives more quality. I had an ugly dark scene were even at quant2 existed floating artifacts. They dissapeared with quant 1.
But it's insane to use it I guess. If you want to use more space, then try a custom matrix which consumes more space like hvs-best-picture or andreas 78er.

Greetings,
Jan.

Kyo
20th April 2003, 07:27
Excuse me Jan Marijniszoon but if you have a movie ~2h and you still wanna make pack it on ONE cd what you do? buy a 99min and make a XCD CD :rolleyes: or you are saying that most of your moves are on three CD's...?

But I understand that quality NO means the same for ALL our eyes :o

@Didée of course you're right, any normal movie(not dark,low contrast etc etc) <2h in one cd +1 or 2 ogg track don't use a quant over 4 and even 4 is sporadic... but I remember that on some tests(long time ago) I cap the quant P to 2-3 and the final size was oversized, plus some parts look a bit strange (not block-noise just strange) and when I left the deafults ranges 2-32 the overall quality was best... dunno if this still happen with the currents builds...

IMHO The XviD linear o alt cc curve don't need "extra" help of the capping quants like we done in the Nandub days.

And I really really don't want a flamewar, so my last post over the theme.

Acaila
20th April 2003, 07:57
I cap the quant P to 2-3 and the final size was oversizedThat's because the point where you can safely cap is different for every movie. It's best to first see what the uncapped quant range is by running a normal 2nd pass, and then once you know that point, run an "optimized" 2nd pass with capped quants. That way you won't run into an oversized file by accident.

OUTPinged_
20th April 2003, 11:10
@iago, did'e:

Such strict quantizer asks for some resolution reduction.

Consider putting 1hour of video to 1 CD, what are typical resolutions you guys are getting?

All my experience tells me that everything higher than 75% 1/2 pass ratio is just a waste of bits for regular movie dvdripping.

Though i must admit that the decision might be based on accomplishing different goals :-) Mine is "to have as much details as possible". Yours seems to be "having as little artifacts as possible", hehe.

Selur
20th April 2003, 11:34
Hmm,.. maybe i didn't get it,but:

If I choose a quantizer range from 1 to 31 (for I Frames), will Xvid in 2pass mode use quantizer 1 if possible or not?
(so undersized movies, e.g. really dark movies, should atleast contain some quant 1 frames)

Cu Selur

Ps.: btw. quantizer 1 => can't see any ringing artefact ;)

mf
20th April 2003, 11:36
You guys really don't trust XviD ratecontrol now do you? You think that if you let it loose it'll go crazy, which it doesn't. The defaults are fine for normal movies. Just leave it all at 2-31. If you have some bitrate to spare (2cd?) you can set I-frames to 1-31 and P-frames to 2-31, and all will still be fine. Hell even in the nandub days this worked fine. I remember doom9's guide saying cap to 1-8 or something, and all the sheep followed, but in reality, if you don't cap it, high quantizers will be rarely used anyway. And if they are used, then it's clear your encode has some really compressible parts, which you won't see anyway (ever thought about pitch blackness?). And if you do see them, you need to cut down on that Conv3D or whatever you use for AVS filtering (think about the philosophy behind blockbuster). Moral of the story: XviD is designed to work at its best without limitations, so don't limit it. Period.

Selur
20th April 2003, 12:50
I normaly do 2CD Rips :D

And at least for me it's not about not trusting, but about making sure. Some time ago quant 1 was said to be buggy/broken,.. so asking shouldn't hurt ;)
If I set quantizers to 1 to 31, I trust Xvid even more to make the right move. (it has one quantizer more to choose from)

Cu Selur

Ps.: I take your post as a "Yes, 2pass mode can use quant 1, if you allow it."

Didée
20th April 2003, 13:01
Jan Marijniszoon:
Yes, usage of matrices that produce higher bitrate is a good thing in many cases (and in some other it's not). We already had a thread called "Better quality at max quality?", and there was a reason for that. Quant-2 already sacrifices a little ...

Kyo:
My LOTR Fellowship SEE (3h20min) rip to 1CD (800MB through mode2-CD) goes just up to quant 8 - but with a special-made matrix. That would equal to ~ "quant 5.5" with standard quantization. So what?

Acaila:
Yes, exactly that way one should cap, if at all. See answer to mf below.

OUTPinged_:
Indeed, tastes are different ... (e.g. I like the picture of a good(!) CRT definetly more than the picture of a flat panel display)

Selur:
Still not evaluated, but I'm 99.9% sure it doesn't. Size of q1 is so huge, every bit reservoir would be eaten up 'immediately'. And you won't gain anything from one q1-frame every one or two minutes. I'd use custom matrices if q2 isn't enough, that way you can achieve much nicer bitrate scaling.

mf:
Well, I do trust XviD's rate control pretty much. But still, machines are dumb ...
There is one problem: Every now and then, on a "soft" scenechange, XviD is using a p-frame, not an I-frame. These P's are usually relative big. Now, I don't like to have used high quants on these "quasi-keyframes", and with proper quantizers capping you can catch at least some of these.

Uff

Didée

Selur
20th April 2003, 13:15
to get a sure answer I posted it (now) also in the XvidDevForum (here (http://www.xvid.org/modules.php?op=modload&name=phpBB2&file=viewtopic&p=5291#5291) ).

Maybe one of the devs is willed to give a definitive answer :)

Cu Selur

Ps.: Xvid rocks,.. (but be aware h264 is coming) :D

Niño
20th April 2003, 14:48
Selur, that`s what I was asking in my first post, thanks fore posting in xviD forum. :)
I don`t believe that q=1 are used in a 2-pass encoding, also because of the first pass at q=2.
My debugviewer never showed me Q=1, in my undersized rips too.
So I guess that setting 1-31 is the same than setting 2-31..

@Sharro.
I don`t agree that quality of a scene at quant 1 is the same of quant 2, but I know I won't gain anything from one q1-frame every one or two minutes, and that a 1-pass at Q=1 is bigger than VOB files.

Thanks for the answers.

fellip_nectar
20th April 2003, 14:58
@Niño

Did you have lumi masking enabled?

In my experience - the second pass never uses quant 1 if lumi masking is enabled but should do otherwise (provided your target filesize allows this)

Niño
20th April 2003, 15:13
No lumi masking was disabled and min quantizer resctrictions for I and P frames were set to 1 both, obviously..

I don`t tink that a second pass (q=1-31) filesize coul be bigger than the first pass (q=2), if it happens, should mean Q=1 were used.

haibane
28th April 2003, 01:46
shouldn't quant4 be approximately half the size of quant2, and quant3 is 2/3 of quant2, so it would be possible to approximate the average quant number by just look at the ration between target file size and 1st-pass file size.

I am agree of capping quantizers, since I can't stand any frame of quantizer bigger than 6, so that leaves me to cap my pf quant to 2-4 with bf setting. which means my target file size have to be at least half of my 1st-pass file size.

ominte
28th April 2003, 10:32
I'd be curious to see an example of what you call "good quality".
My LOTR Fellowship SEE (3h20min) rip to 1CD (800MB through mode2-CD)
Yes Didee, we all must have different ideas about "good quality"! From the second quote it is obvious your perception of qualtiy is unusual. It would take a bold man to place a 3h20min movie on 1CD. The only possible explanation for your actions that I can see is:
1. You filtered the crap out of your source
2. You reduced the resolution heavily e.g. 300x***
3. Or lastly you put up with a load of artifacts in your result

As you can see each of the three above all result in a quality far from "good".

Didée
28th April 2003, 12:00
From the second quote it is obvious your perception of qualtiy is unusual
Wait a minute.
Ominte, you're much too fast with drawing conclusions about me. Especially about my perception of quality.

When did I say that special rip has ultimate brilliant quality, not to distinguish from the DVD? I can't remember to have said that(Perhaps some RV9 nerds may say such silly things, but not me.)
I only said something about used quantizers ...

>> 1. You filtered the crap out of your source

Nope.
A little PP, a little dust, a little [piieeeep] ...

>> 2. You reduced the resolution heavily e.g. 300x***

Nope.
It's "bicubic(544,224,0.16,0.42)". Pretty much enough for >>TV viewing<<.

>> 3. Or lastly you put up with a load of artifacts in your result

Nope, not a load of ...
A little artefacting is present every now and then, yes. But it is really minor - since only low quants were used ;)

Heaven help, +3h on 1 CD is, well, an extreme case to still achieve acceptable results. (And of course, I did LOTR on 2CD also - *that* looks brilliant - but that was no challenge ;) )
It's more like "Let's see how we can scope with that impossible mission". And you can believe me, keeping that in mind, it looks pretty OK >>on TV<<.

With kindest regards :)

Didée

mf
28th April 2003, 13:06
Originally posted by Didée
Heaven help, +3h on 1 CD is, well, an extreme case to still achieve acceptable results. (And of course, I did LOTR on 2CD also - *that* looks brilliant - but that was no challenge ;) )
It's more like "Let's see how we can scope with that impossible mission". And you can believe me, keeping that in mind, it looks pretty OK >>on TV<<.

Heh, like Gladiator on 1CD in nandub :D. You might wanna try 90/99min CDs with mode2 :).