Log in

View Full Version : How many passes?


Hrungnir
30th October 2004, 09:55
I was just wondering, how many passes does one get by with? Is there for an example a lot of difference between a movie who's been encoded with two passes and another one with three passes? I know there's heaps of difference between one and two passes, I was just wondering if there was that much of a difference between two and three.

Best regards!

daldrum
4th November 2004, 15:51
Yeah, right, the biggest difference is between 1pass and 2pass encoding. The difference between 2pass and 3 or 4pass is not so great, it is all about fine-tuning-up of bitrate distribution. From my experience, 3PASS encoding is the optimum.

Hrungnir
4th November 2004, 17:03
Cool, thanks. I've been using 3 passes but never tried 4 passes - somehow doubted that it would make a big difference.

daldrum
5th November 2004, 09:06
Yeah, you would have to try really hard to see any noticeable difference between 3- and 4pass, so stick to 3pass. Cheers

DigitAl56K
5th November 2004, 09:34
Tip:

Create the file C:\framelevelcontrol.txt

Run Multipass 1st pass and Multipass nth pass.

Open framelevelcontrol.txt and scroll to the end of the file. Look at how many frames have been encoded at each quantizer. If the distribution is small (i.e. most frames have been encoded at quantizer 5,6,7) then you probably don't need to run another pass. If the distribution is larger (i.e. many frames have been encoded at q=3,4,5,6,7, etc.) then its probably a good idea to run another pass.

In an ideal world all frames would be encoded at the same quantizer.

AsTimeGoesBy
5th November 2004, 16:38
Hi! - Thanks for the 'C:\framelevelcontrol.txt' hint!
I myself have spend some thoughts how many pass will be good for me
because i have read in the official DivX 5.21 help guide:

Generally 98-99% of the optimal quality is obtained in three passes or less (1st, nth, nth).

I even have made my 1/2/3/4/5-multipass-test-clips but it's really hartd to see the difference.
Having a 'rule' based on quantisizers will make i easier to estmate the number of useful passes now.

Hrungnir
5th November 2004, 16:47
Yep, thank you likewise. I will stick to three passes I think and just let that suffice from now on.

Cheers mates!:cool:

akupenguin
6th November 2004, 10:28
Originally posted by DigitAl56K
In an ideal world all frames would be encoded at the same quantizer. No. That's easy. If that were the goal, it would rarely need a 3rd pass and never gain at all from a 4th.
Constant quantizer is not the optimal quality. It's not even constant quality. Multipass encoding puts bits where they're most needed. Compression artifacts are both more noticeable and cheaper to fix in low motion scenes, so they get slightly lower quants. Bits spent on I-frames improve both that frame and the subsequent P-frames, while B-frames aren't used for prediction and so get slightly lower quality. And there are a bunch of other more subtle optimizations.

Hrungnir
6th November 2004, 12:50
Listen up, this is weird; I encoded a cartoon (Family Guy) firs with three passes and compared it to my other Family Guy episodes I'd encoded with only two passes - the two pass encoded episodes were better! The three pass had more artifacts than the two pass - why is this? Does it have something to do with that it's a cartoon?

I encoded it again, this time only two passes, and it was much better.

Highly strange.

AsTimeGoesBy
6th November 2004, 14:07
Hi - You may have right 'suspecting' the cartoon style of our video. Some months ago i have experienced that cartoon are very tricky stuff to encode.
(I almost would say an animated gif or flash animation looks better than a DivX of the same size. ;))
Maybe check out too once the doom9.org's test chapter about encoding cartoons (http://www.doom9.org/codecs-203-4.htm) handling cartoons as '...a completely different type of movie'.

So i guess your experinece is rather cartoon-specific.
Generally i think too, multi-pass encoding may help improving the quality - but sometimes the optical improvment is quite low and i often wonder if it really was useful to spend many additional hours for that.

thrivx my appendix
7th November 2004, 21:54
The DivX manual says 3 passes are about 99% optimal. So I did 4 for good meausure. Then I did 5 and saw an improvement.

Now I do 8 (doubled 4).

Too many? Would 10 make any difference?

I do high bitrate encodes and it's very important that the output is as visually similar to the source as possible. Psychovisual enhancementss hurt quality, so I keep those off.

nicco
9th November 2004, 12:48
Psychovisual enhancementss hurt quality

True!
I usually encode at 2 passes, 3 passes don't give improvements to me

daldrum
9th November 2004, 13:05
thrivx my appendix?
I guess you are just kidding about doing 8 passes. Or are you just wasting your time and energy?

akupenguin
9th November 2004, 18:35
I don't think he's kidding: I've seen some people actually use 10 passes, and at least pass #5 made a visible improvement. Though there are better places than ratecontrol to spend that extra time if you really want those last few percent (e.g. rate/distortion optimization of everything). Anyway, it's only wasting CPU time, not your time.

thrivx my appendix
9th November 2004, 22:35
I think it may have something to do with resolution. I find that at higher resolutions, many passes will greatly benefit quality in constrast with a few passes, also at lower resolutions (real low). I don't know the inner workings of the codec, so I don't know why that is however.

I encode my DVD-rips at 852x480p for 16:9 NTSC television. Prepared in AVS script:

video = MPEG2Source("Reservoir Dogs (1992).d2v").Lanczos4Resize(852, 480).DRemoveGrain(mode = 1)
return video

:devil: :devil:

After 8 passes, it will look nearly identical, emphasis on identical, to the DVD source at ~2000-2500 kbps. But filesize is not important for me, so I target 4483 megs and throw it onto a DVD-R. At which point, it's at ~5000 and looks as nice or better than the source (I must prefer h263 quant).

Hrungnir
9th November 2004, 22:45
I was just wondering; "...and it looks as nice or better than the source...", can it really look better than the source? Wouldn't it be better to make an identical copy of the DVD instead of encoding it to DIVX?

I've always liked the idea of having several high quality DIVX movies on a single DVD, let alone on a double layer DVD (I've got one of those burners), although the cost of a double layer DVD is quite high at the moment. But we always want more, more, more, better, better, better. So maybe I will soon start to encode the movies to a full DVD.

akupenguin
9th November 2004, 22:52
Problems with that script:
1) You're upscaling. At sufficiently high bitrates, the sharpening from lanczos might look good enough to offset the reduction in compression efficiency, but you could do better yet with a plain-old sharpener, or maybe lanczos with only a slight change in resolution. Leave it anamorphic.
2) Your final resolution is not divisible by 16. That introduces a serious penalty to both motion estimation and DCT at the edge of the frame. (Unless there are black bars at the edges, in which case you have to crop them off and then scale back to a multiple of 16.)

Neither of those is fatal at 5 mbit/sec, but those fixes are a much cheaper way to improve quality than extra passes.

akupenguin
9th November 2004, 23:00
Yes, it is quite possible to make a rip look better than the source. Most DVDs can benefit from at least a little denoising. (Though you don't have to rip it for that: "mplayer -vf pp=ac,hqdn3d=2 dvd://1", or the equivalent in ffdshow, makes a very nice realtime filter.) And many DVDs are screwed up in other ways, but that can't be cured in a one-size-fits-all avs.

thrivx my appendix
9th November 2004, 23:24
Originally posted by akupenguin
Problems with that script:
1) You're upscaling. At sufficiently high bitrates, the sharpening from lancsoz might look good enough to offset the reduction in compression efficiency, but you could do better yet with a plain-old sharpener, or maybe lanczos with only a slight change in resolution. Leave it anamorphic.
2) Your final resolution is not divisible by 16. That introduces a serious penalty to both motion estimation and DCT at the edge of the frame. (Unless there are black bars at the edges, in which case you have to crop them off and then scale back to a multiple of 16.)

Neither of those is fatal at 5 mbit/sec, but those fixes are a much cheaper way to improve quality than extra passes.
1) Height is always 480. Widescreen DVD is 4:3 with 16:9 tags, so it gets upsized from 720x480 regardless (MPEG2 stream has rectangular pixels, but lanczos4 -> anamorphic actually looks better to my eyes). DRemoveGrain increases compressibility without omitting fine detail.

2) 852x480 is the NTSC standard for 480p in widescreen format (it is the resolution of digital EDTV and is supported by HDTVs that do not upsize smaller video to 1280x720). The other standard is 856x480, but this is a greater deviation from "true" 16:9 and also is not divisible by 16.

I watch my encodes on a 32" EDTV plasma screen.

You have not provided fixes :rolleyes:

Try my settings, encode at 2500, you will be surprised

akupenguin
10th November 2004, 00:07
If you're worried about CPU time needed for playback, I guess lanczos beforehand will be faster than lanczos during playback.
But for optimal quality, the solution is: Compress at 720x480, and scale to 852:480 during playback.

thrivx my appendix
10th November 2004, 07:15
Originally posted by akupenguin
But for optimal quality, the solution is: Compress at 720x480, and scale to 852:480 during playback.
You know of any standalone player that will apply lanczos4 during playback and resize to exactly 852x480 at the press of a button?? I don't know of one that supports even simple aspect ratio for MPEG4. They put out what you put in. There is no standard for aspect tags in AVI.

akupenguin
10th November 2004, 07:37
You're using a standalone? sorry.
The closest I've found is XBMC (http://www.xboxmediacenter.de/).
Then I guess you'll have to compromise, and the solution you proposed is probably the best, as long as you have bits to spare.

Shinigami-Sama
27th November 2004, 06:39
8 passes dam
I use nero express visoin atm T_T
took back dvdlab pro did'nt like it to much convertion for me avi>mpg
mka/aac/vorbis/mp3.ect>mp2/wa/ac3
I find that to much work for little pay off
but I was wondering
how long to each extra passes take?
2pass nero takes about well realtime for me + about 10%
2hour moive 2passes in 2hour 20min
and was wondring
is it owrth it to use the exrta passes when i leave for work
I work short 5-6 hour shifts T_T
and how many passes would that work out to?
I would guess 5-6
about an hour each pass
spex for comp are
xp home :(
p4 3ghz d.o.t commander (+15% on demand oc'ing)
1 gb ddr 400 ram
gforce fx 5200...
mid range 120gb hd