View Full Version : xvid: motion precision search/VHQmode results
tanned55
24th April 2006, 23:05
I have a Philips dvdp642/37 player. Using Koepi's v1.2.. flickering occurs when Motion Precision Search/VHQ Mode are set at 6/1, 6/0, 5/1 etc. When set to 3/3 it is respectable viewing. Previous encodes at 4/4 looked good but now flicker at this setting.
My dilema is the recommended 6/1 does not work well on this player. Does selecting lower values considerably depreciate the quality? :thanks:
Teegedeck
25th April 2006, 09:08
What do you mean precisely by 'flickering'?
Generally, higher ME search precision and VHQ modes simply deliver higher quality and 'optimize away' film-grain and slight noise. They don't have anything to do with 'flicker' as I have come to understand the word. Rather a bad quantizer-distribution leads to flicker. A combination like 3/3, which probably preserves film-grain well at the cost of vastly higher filesize, can actually look better than 6/4 but usually only at the same constant quantizer, NOT at the same filesize.
Edit: You should at least use VHQ=1, but most of the time the higher the value the better.
sysKin
25th April 2006, 11:35
Motion precision 4 and higher activates inter4v macroblock mode. If you have trouble with this mode, something is wrong on your decoder side.
Find out what decoder you're using and use ffdshow or xvid or maybe divx instead, they all work fine.
boombastic
25th April 2006, 13:43
What do you mean precisely by 'flickering'?
Generally, higher ME search precision and VHQ modes simply deliver higher quality and 'optimize away' film-grain and slight noise. They don't have anything to do with 'flicker' as I have come to understand the word. Rather a bad quantizer-distribution leads to flicker. A combination like 3/3, which probably preserves film-grain well at the cost of vastly higher filesize, can actually look better than 6/4 but usually only at the same constant quantizer, NOT at the same filesize.
Sorry for my intrusion:i don't understand the relation between ME and VHQ modes, film grain(=noise?) and filesize.Why higher VHQ modes increment the final filesize?In which way they reduce the film grain?And how they are related to ME?I always tought that VHW only concern the degree of motion of the image....Sorry for my misunderstanding!
Teegedeck
25th April 2006, 14:56
You got that a bit wrong. For ME prec. and VHQ goes: the higher, the better (generally speaking).
Higher motion search precision values trigger a more time-consuming but more exact search for the best motion-vectors. Better motion vectors mean less mistakes have to be compensated, which means less bits have to be spent. VHQ extends ME search even further and introduces mode decisions to be made based upon cost-effectiveness and quality (I can't recall how that is measured). Something like that anyway. I cannot claim I understand RDO. In sysKin's own words:
It does two things - first, it is able to compute the number of bits a macroblock would take in different scenarios and choose the scenario which shows the smallest number. Second, it can do some limited motion vector seach to minimize the bits for a given scenario. The 'scenarios' are macroblock modes - there can be one vector (we can look for it using this tool), four vectors (we can also look for them) or the macroblock can be intra (nothing to look for here).
As you can see (I hope?) it doesn't change quality at fixed quantizer - it reduces number of bits at fixed quantizer.
The problem with noise and optimization is that it's most cost-effective not to encode it at all (something that will happen at VHQ>2 and/or ME prec. >5) and that might lead to a loss of perceived detail (if you have a high quality display) and sometimes to the 'floating walls'-effect.
tanned55
25th April 2006, 16:27
What do you mean precisely by 'flickering'?
Generally, higher ME search precision and VHQ modes simply deliver higher quality and 'optimize away' film-grain and slight noise. They don't have anything to do with 'flicker' as I have come to understand the word. Rather a bad quantizer-distribution leads to flicker. A combination like 3/3, which probably preserves film-grain well at the cost of vastly higher filesize, can actually look better than 6/4 but usually only at the same constant quantizer, NOT at the same filesize.
Edit: You should at least use VHQ=1, but most of the time the higher the value the better.
By flickering I mean at scenes where there is motion a wavy line(s) briefly occur on about ¼ of the screen. The videos are from a miniDV cam (orig codec: MainConcept ProDV 3.0.16) so there's not much movement as in a std DVD. It's odd but the intensity seems to happen as a result of the Motion precision search/VHQ setting. The player is a Philips dvp-342/37.
Boulder
26th April 2006, 11:50
Do you use the correct options for interlaced encoding or do you deinterlace before encoding? Your DV material is probably originally interlaced.
tanned55
26th April 2006, 12:51
Do you use the correct options for interlaced encoding or do you deinterlace before encoding? Your DV material is probably originally interlaced.
On Profile tab, Interlaced Encoding(top field first)/Adaptive Quantization are both disabled.
Boulder
26th April 2006, 12:57
If your material is interlaced when you encode it, you must enable interlaced encoding. However, DV is bottom field first so you must either switch the field order to TFF or deinterlace in your Avisynth script.
tanned55
26th April 2006, 13:10
If your material is interlaced when you encode it, you must enable interlaced encoding. However, DV is bottom field first so you must either switch the field order to TFF or deinterlace in your Avisynth script.
Thank you. Flickering stopped after I enabled Interlaced encoding and Top field first; is this the correct configuration?
Because B-VOP registers 0 at all fields on the Xvid Status screen after enabling Interlaced Encoding/TFF, so on the following tabs should any references to bframes be disabled?: Motion tab - Use VHA for bframes too.....Profile tab - B-VOPs?
Do you know anything about determining Avg bitrates? The formula I was given is H*W*fps*.2 or .3(quality)/1024 = avg bitrate. Another method was to run a 1st pass dummy file and use the status screens' avg bitrate.
:thanks:
Teegedeck
26th April 2006, 15:33
Well, good that that's solved. :)
About bitrates: For one-pass encoding use a constant quantizer; if you need control over filesizes use two-pass encoding. CBR sucks.
To determin what 'bitrate' you should encode at for which resolution use Gordian Knot.
tanned55
26th April 2006, 16:17
Well, good that that's solved. :)
About bitrates: For one-pass encoding use a constant quantizer; if you need control over filesizes use two-pass encoding. CBR sucks.
To determin what 'bitrate' you should encode at for which resolution use Gordian Knot.
Thanks, this is finally curtailing (a good end result I hope_
Why's CBR bad? Does one-pass partake of this? How do you I use Gordian Knot to determine avg bitrate "and" does avg bitrate only refer to 2-pass encodes? :thanks:
Teegedeck
26th April 2006, 16:35
Why's CBR bad? Does one-pass partake of this?CBR is bad because it doesn't work properly. It is very hard for a codec to foretell how big an encoding is going to be without a first pass. All XviD can do is interpolate how big the result has come out so far at a given quality and make a guess at which level of quality (quantizer) to use right now in order to meet the aimed-at filesize (because bitrate is nothing but a given filesize for a given duration). If the guess was bad, and there suddenly is more going on in the picture, the result will be a tendency for the encoding to grow too big and CBR mode will try to counter that by using radically lower quality for some time afterwards... Such guesswork is CBR. And XviD doesn't do it very well.
There's two modes in XviD for one-pass encoding: CBR (bitrate) and constant quantizer. CBR allows a very vague control over the resulting filesize at the cost of seriously degraded quality. Constant quantizer delivers constant quality at the cost of no control over filesize at all apart from guesswork - unless you made a filesize prediction with Enc. Look Enc up in the 'XviD presets' thread where I mentioned it.
How do you I use Gordian Knot to determine avg bitrate "and" does avg bitrate only refer to 2-pass encodes?Please consult the guides section of doom9.org.
And please try to struggle free from this 'average bitrate'-thinking. It's really not very useful for comprehending how things work, more of the opposite. Try to think in terms of 'quality', 'filesize', 'duration', 'resolution' and 'complexity' (=mainly amount of details and motion). The higher complexity, resolution and duration of a video, the bigger will filesize be at a constant quality. The higher complexity, resolution and duration of a video are at a constant filesize, the lower quality will be.
'Bitrate' is actually nothing but filesize/duration. A very artificial way of expressing that, for example, 'this video is 100 MBs at 10 minutes'. And CBR mode is very bad because here it's actually more like 'each minute of this video is 10 MBs' - while for two-pass it would mean 'the short scene with the car-chase is 30 MBs a minute, for the remainder it's more like 8 MBs/minute'. You can imagine how the CBR-car-chase-scene looks in comparison to the 2-pass car-chase-scene.
tanned55
1st May 2006, 04:41
There's two modes in XviD for one-pass encoding: CBR (bitrate) and constant quantizer. CBR allows a very vague control over the resulting filesize at the cost of seriously degraded quality. Constant quantizer delivers constant quality at the cost of no control over filesize at all apart from guesswork -
Thank you for the insight. Please correct me if I'm wrong; (1)what I'm learning is that '2-pass encoding' is best used for specified 'filesize(s) and has no effect on quality? (2) CBR-bitrate is the mode when xxxxkbps is typed in or implemented using the slider and is used for 2 pass encoding and CBR-Quantizer is more of the quality mode?
'Bitrate' is actually nothing but filesize/duration.
Basically, what's the difference between CBR, Avg bitrate and data rate; are they interchangeable terms? Quantizers of 2, 2.5 and 3 yield filesizes of 208/156/101MBs with 'data rates of 718/538/351-kbps. Is choosing the cbr-quantizer a matter of preview?
I monitor the avg kbps on the Xvid status screen; later check the files' Properties taking note of the data rate. Should there be a large disparity between the two? I hope I'm not confusing myself further... All n all, thanks for your time and support. :thanks:
Teegedeck
2nd May 2006, 08:34
First let me point you to this useful FAQ. (http://ronald.vslcatena.nl/docs/xvidfaq.html)
Thank you for the insight. Please correct me if I'm wrong; (1)what I'm learning is that '2-pass encoding' is best used for specified 'filesize(s) and has no effect on quality?Now, what would the use of that be? 2-pass delivers the best quality for a specified filesize. CBR tries to deliver the best quality for a specified filesize and fails miserably.
(2) CBR-bitrate is the mode when xxxxkbps is typed in or implemented using the slider and is used for 2 pass encodingYou surely meant '1 pass encoding'. and CBR-Quantizer is more of the quality mode?There is no such thing as CBR-quantizer. CBR is short for 'Constant Bitrate'. It's either constant quantizer or CBR. Both are one-pass.
Basically, what's the difference between CBR, Avg bitrate and data rate; are they interchangeable terms? Quantizers of 2, 2.5 and 3 yield filesizes of 208/156/101MBs with 'data rates of 718/538/351-kbps. Is choosing the cbr-quantizer a matter of preview?(There is no such thing as CBR-quantizers...) Generally all those terms mean the same - but an average bitrate can mean the bitrate is averaged over two hours (that's what it is in 2-pass) or over a few seconds (that's what it means for CBR).
'Bitrate' is just the filesize you end up with when you encode at a specific quantizer.
XviD always encodes at some quantizer and the result is always a filesize. That the same quantizer produces different filesizes for every movie and each scene in that movie is because every video is different.
Just think of quantizers as 'compression levels'. A lower quantizer removes less details (=higher quality) but consequently produces bigger filesizes.
Now, when XviD tries to reach a certain, defined filesize (=bitrate) it does so by choosing the quantizer that is likely to produce the desired size and by constantly switching between quantizers when the desired filesize is in-between what can be reached with constant quantizers. (That's the same that happens when you select an 'odd' quantizer like 3.5 in constant quantizer one-pass.) The difference between doing that in two-pass and trying to do that in one-pass ('CBR') is that in the second pass of a two-pass XviD has a pretty good idea about which quantizers to use for which scenes of the movie in order to reach the correct filesize (like 'OK, quantizer 3 for that dialogue scene, quantizer 4 for that car-chase and switching between 3 and 4 for all the rest; 3-4-3-4... ') - while in CBR mode it's blindly guessing and correcting itsef all the time (like 'Hm, let's try quantizer 3... Ah; no! The scene has turned into one of these car-chases that take so much space to encode! If I continue that way, I'll overshoot by hundreds of MB! Now I've gotta use quantizer 6 in order make up for that waste just now...')
That's the difference between encoding to a certain filesize in two-pass and in one-pass (CBR one pass).
Finally, encoding in one-pass at constant quantizer yields no control over filesize but an inspired guess - unless you do a filesize prediction with a tool called Enc - but ensures a constant quality.
Blue_MiSfit
8th May 2006, 13:30
Well said Teegedeck!
@Tanned55:
As a simple rule of thumb, the best way to do it IMHO:
1) If you know how big you want the video to be, use 2 pass and specify an output filesize or average bitrate - the two are interchangeable as Teegedeck stated. filesize/duration = average bitrate
2) If you dont care how big it gets, and want the best possible quality, use 1 pass, constant quantizer 2. I use 3, as it's very close visually (usually) and is much smaller
3) XviD "CBR" must be persecuted with extreme prejudice.
:)
~MiSfit
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.