Log in

View Full Version : Discussing advanced settings : Qpel, GMC, Treillis...


Manao
15th December 2003, 19:50
I open a new thread for users to post their comments on these features : in which case did they give a good result, in which other case they were disappointing.

I hope than, this way, we'll be able to get an idea of when one should use such or such features.

For my part, here are my results.

I made a bench test on 'The Hours' ( PAL, 16/9, 1h50, and a kind of film effect ), encoding the whole movie, keeping the first and second passes, with different settings enabled.

But, firstly, the avs I used, which is pretty simple :MPEG2Source("R:\hours.d2v",cpu2="oooooo")
crop(2,12,-0,-10)
LanczosResize(640,352)There is no denoising, because I wanted to retain the grain of the movie. Lanczos, of course, because I want the picture to be sharp, and because the first pass isn't too high for a 1-CD ripp.

The common settings are :
- ME 6, VHQ 4, Chroma motion on, Frame drop ratio 0, Max I-Frame interval 300
- Cartoon mode off, Reduce resolution off, Interlaced off
- B-Frames 2, 1.5, 0.75, 0
- Unrestricted profile
- Chroma optimizer off, No capped quants
- Default second pass's settings
- Second pass size : 579 400 Kb

For each encodes, I made a SSIM test and a visual one. The SSIM value is calculated with lumimasking, and without including the credit in the calculation. I used the following script :source = MPEG2Source("R:\hours.d2v",cpu2="oooooo"). \
trim(0,158000).crop(2,12,-0,-10).lanczosresize(640,352)
result = AVISource("R:\hours.avi").trim(3,158003)
ssimvalue = SSIM(source,result,"R:\hours.csv","R:\hours.txt",lumimask = true)
return ssimvalueHere are the table of the sizes / SSIM values obtained :
Options | Fst Pass | Snd Pass
--------------------------------+---------+----------+--------------
| Size | SSIM | SSIM
| | |
H263 - Treillis - AQ - GMC | 1151 | ~80 (1) | 74.56 (*)
H263 - AQ - GMC | 1209 | ~80 (1) | 74.50 (*)
HVSGOOD - Treillis - AQ - GMC | 1019 | 78.37 | 74.49 (*)
HVSGOOD - AQ - GMC | 1008 | 78.44 | 74.54 (*)
HVSGOOD - AQ | 997 | 78.45 | 74.32
HVSGOOD | 1027 | 78.73 | 74.57
HVSGOOD - QPel - Treillis | 1039 | 77.51 | 74.22
HVSGOOD - QPel | 1026 | 77.58 | 74.30
HVSGOOD - QPel - AQ | 989 | 77.32 | 74.07
HVSGOOD - QPel - GMC - Treillis | 1039 | 77.69 | 74.42
H263 - QPel - Treillis | 1087 | 79.49 | 74.79
HVSGOOD - QPel - BF(2,1,1) | 1027 | 77.58 | 74.00
HVSGOOD - QPel - BF(1,1.5,0.75) | 1091 | 78.06 | 74.17
HVSGOOD - QPel - No BF | 1405 | 79.64 | 73.61
MPEG - Qpel | 1201 | 78.42 | 74.30
HVSBEST - QPel | 1179 | 78.28 | 74.22(1) : I lost the .txt containing the SSIM value, but I recall it being higher than 80
(*) : It was slightly oversized ( 3-5 Mb ), but results are still valid.

And now, the visual impression, which is imho the most important, and which tends to disapprove SSIM results.

Concerning the matrix quant : HVSGOOD gives better results, visually, than H263, even at quant 2 ( and even if the SSIM is lower by 1.5 ). The HVS matrix retains noise better than H263. On this movie, ringing / mosquito noise at quant 2 are not perceptible. In two pass mode, you can see it, but it is still light, and visible both with H263 and HVSGOOD. I'm currently making a test with H263 and QPel to see if it improves the results for H263.

Concerning Adaptive Quantization, GMC and Treillis : I could not spot visual differences. Adaptive quantization reduces first pass size by roughly 30 Mb, but I can't spot on my computer its effects. Nor can I say that in two pass mode, the overall quality is better. The effect of GMC seems strange quantitatively speaking ( it increases the first pass size, and lowers ( by 0.01 ) the SSIM. I'm currently checking if I didn't make a mistake here ), but no effects visually speaking. Finally Treillis will also have to be probed more deeply.

Finally, QPel. I already tried it on 'The beauty and the Beast', and I didn't like its effect. Well, this time, it's the contrary. What impressives results it gave me. I must confess I tried it only because I made a mistake configuring the codec, but I'm glad having made this one. It seems to like noise ( or grain, call it as you want ).

I'll try to take screenshots, but it takes time that I won't have until friday. I'm currently testing (H263 + QPel + Treillis) and (HVSGOOD + QPel + GMC), and I'll try different B-Frames settings soon. I'll add SSIM values / impression on this post.

But I'm eager to hear your experiences with these settings, and with B-Frames.

Edited : I added some results, and more will come soon, concerning b-frames settings this time. Visually speaking, QPel helped a lot for H263, but it still doesn't reach the quality of the HVS_GOOD matrix. Now testing b-frames ( 1,1.5,0.75 and 2,1,1, against the defaults : 2,1.5,0.75, with hvs_good and qpel enabled in each case

Edited 2 : Added different b-frames settings, now testing other matrices ( HVSBEST, HVSBETTER, MPEG ), with defaults b-frames and QPel, and HVSGOOD without b-frames.

Edited 3 : I compared the clip encoded with and without b-frames. They really bring quality. They do not blur the picture, but they give instead a less noisy picture ( on walls especially ). The only advantage of not using b-frames was slightly more stable walls. But else picture's quality was definitely better with b-frames on. The three different settings seem pretty close quality wise, I'll make further investigation. Screenshots are due to arrive during the week-end. I added some numbers, and I forgot to mention the aimed size, which was 579 400 Kb.

Edited 4: I bean to put screenshots. For the moment, two series illustrating the effects of the matrix ( all are made with QPel and b-frames ), and of QPel ( on H263 and HVS_GOOD ). Have a look here (http://www.geocities.com/manao47/index.htm). I asked a friend which pictures he prefered, she answered me twice the H263 - QPel. It's different from what I think ( I prefer HVSBest - Qpel, and HVSGood - QPel ), so you'll have to check to choose which one you prefer.

Rooster6975
15th December 2003, 23:00
Not really what you are asking, but thought you should know. If you do play with the QPel and GMC options, you will no longer be able to read the DivX on set top DivX Players. They simply don't support the options and can not read the disks. There are some good ones on the market right now which support all formats (div3, divx4 and 5.x, and xvid), but not with those advanced options.

As an example :
http://x300.sigmatek-players.com

R.

HarryM
16th December 2003, 13:02
B-frames very efficient - use it. :D

Q-pel is more interest. This feature consumes too much CPU power (cca +30% at encoding and encoding too) - but improvement of overall quality isn't so visible as at b-frames using.
Q-pel have one benefit - for the strong downsizing videos (etc from MPEG2 720x576px to 384x288px, bicubicresize) gives significantly better compressibility (cca +7%)than without.
For the slightly downsizing (or upsizing) videos Q-pel give lower compressibility than without.
I use it. :p

GMC is unusable (for me). GMC encoding consumes too much CPU power (cca +50%). Gain of compressibility is generally lower than +1%(!). CPU power for decoding is cca +5%.
I don't use it. :mad:

I use VHQ=1.
I don't use Adapt. quantization (is good?) :confused:

sysKin
16th December 2003, 14:16
I noticed one important thing about qpel: I can't see any mosquito noise with it. Sure, the video is still noisy, but in a different way (which I like much more).

Radek

HarryM
16th December 2003, 14:30
Originally posted by sysKin
I noticed one important thing about qpel: I can't see any mosquito noise with it. Sure, the video is still noisy, but in a different way (which I like much more).

Radek

Yes. For many videos is use of q-pel wonderful.

mfluder
16th December 2003, 16:21
IMHO qpel is one of the best things in XviD. I have been using it since its first implementation (Oct 2002). It simply retains much more details and hence the image looks much sharper. It really surprises me when some people here advise others not to use qpel _ever_. Sure, using qpel with cartoons and anime doesn't give very nice results but with movies, that's a totally different story.

mfluder

Manao
16th December 2003, 16:58
mfluder : for a long time, QPel lead to a lot of artifacts over faces, with dev-api-3. That's why it got a 'bad' reputation. That's why I was so reluctant to use it. And that's why I'll still test with and without QPel for the encodes I make, because I've the impression that the former artifacts are still latent, and just wait the occasion to reappear. I may be wrong, but I prefer here being on the safe side.

bond
16th December 2003, 19:16
yes, i can also only say that qpel is simply great!!!

if it comes on how to preserve as most details as possible (without blocks or so) there is imo no way around qpel

Originally posted by Rooster6975
If you do play with the QPel and GMC options, you will no longer be able to read the DivX on set top DivX Players. They simply don't support the options and can not read the disks.wrong!
some first generation chips werent able to decode qpel and gmc but newer ones (namely all mediatek based hardware players) can decode qpel and 1 warppoint gmc (xvids gmc has 3 warppoints) already without a problem

Alxemi
16th December 2003, 21:02
Yeah.. I like Qpel too :o)

Manao: Beauty and the Beast is not a good movie for testing... it has a lot of noise and ringing even in the DVD source... I encoded it some time ago and i was very confused because i thought my XviD settings were responsible of the bad quality, but it was the source.
There was a long post somewhere in the forum talking about this problem.

Manao
16th December 2003, 21:07
Beauty and the Beast is not a good movie for testingYeah, that's why I used 'The Hours' ;) ( OK, my post was too long )

mikeX
16th December 2003, 21:58
i got some really good results with beta 2 on 'Ghost In The Shell' (anime)(runs 1h20):

profile: unrestricted
matrix: h.263
adaptive quant (only on the second pass)
Q-Pel
B-VOPs: 2 - 1.5 - 0.7

zone: weight 1, chroma optimizer (+ greyscale + quant 16 for ending credits)

advanced:
ME 6
VHQ 3
Chroma Motion
max I-fr interval 240 (i had ntsc 23.97 fps)
NO trellis (i used to use it but i think it slowed things down and didn't help that much)
default quantizers
(2-pass only)
I-fr boost 15%
max overflow improv 50
" " degrad 50

curve compression: 0,0,0

avs script: (gordian knot 0.28.6.3)

LoadPlugin("D:\PROGRA~1\vd-enc\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("D:\PROGRA~1\vd-enc\GORDIA~1\undot.dll")

mpeg2source("F:\ghost\ripped-ghost\ghost.d2v")

crop(6,12,708,452)

BicubicResize(640,336,0,0.5) # neutral bicubic #

Undot()
#end of avs script

at first i tried out 'cartoon mode' with an 8 pixel step for the resize filter but virtualdubmod 1.5.10.1-2389 crashed.
i tried again with a 16 pixel step but again it crashed (at a different point)

i took out the 'cartoon mode' option and things went quite well!!

the movie plays almost exceptionally on my pc (athlon xp 1800+ 256MB ram winxp sp1 - sony Trinitron 100ES Multiscan 15') using the latest ffdshow filter (and it damn well should since it came out undersized at 595MB with an avg of 1000 kbps)

ps: i almost always use q-pel and only once did it gave artifacts using some older dev api 3 build of koepi's

it also plays really great on a pc eith a Neovo 15' LCD screen (which always gives out bad results)

i used roughly the same settings (+ a fluxsmooth(7,7) filter) to encode a greyscale movie i'd also done some time ago with a stable koepi build i think (no B-frames, no q-pel), dr. strangelove (runs 1h30):

same astonishing results (here too i got an undersized movie- avg 989 kbps (gspot) vs avg 997 @ same resolution [+bigger size] for older encoding)- great improvement from my previous encoding (especially on the LCD monitor)

Nibor
16th December 2003, 22:34
Originally posted by mikeX
adaptive quant (only on the second pass)
Why is that?
Can Adaptive Quantisation do all its magic if it is only activated in the second pass?
The purpose of Adaptive Quantisation is to give less bitrate to 'darker' regions (or regions where quality is less distinguishable for the human eye),
so I think activating Adaptive Quantisation in the first pass too is required to have the quantizer allocation done (which is what AQ is good for)...

Am I right or maybe just plain wrong :) ?

Can someone, who is a bit more sure on this, clarify?

.: Nibor :.

mikeX
16th December 2003, 22:47
well the reason i do that is beqause i remember reading a post refering to luma masking (dev api 3), which equals to adaptive quantization i believe, that said only to apply it on the second pass since it applied the extra compression twice if turned on for both passes and gave bad results...
so i figured i'd try out the same thing with the beta...
i did some testing earlier on with beta 1 (adapt quant for both passes vs second pass only) on some captured video i had but i couldn't really tell the difference...

anyone who can clarify this matter is more than welcome!

btw i'm watching the movie right now(ghost).. it's really great work!!!

Teegedeck
16th December 2003, 23:52
That really is some way old info on lumi-masking. Use in both passes is advised. BTW, I'd like to give it a try on some anime with flat surfaces once I have time (New Year?) but I don't have high hopes that it will do a job as splendid there as it does for 'normal' movies.

bond
17th December 2003, 08:35
it was once said that lumi masking/adaptive quant will not result in a nice pic when watching the movie on TV!
Is this still the case? if yes, how will it look like, compared to watching the movie on a pc monitor? how to circumvent it...

Manao
20th December 2003, 13:39
I added screenshots, have a look here (http://www.geocities.com/manao47/index.htm)

Kb_cruncher
22nd December 2003, 16:51
I am a believer in using bframes as they reduce filesize a good amount while reducing quality by very little.Personally i use 2 bframes, somtimes 3 depending on the source but i think it pays to be careful when using them as some other xvid settings(chroma motion, adquant, trellis)and avisynth filters do have an effect on them.I restrict bframe quant to 4 in second pass but quant 5 and 6 are still allowed to be used even with the restriction in place.At quant 6 blocks become visible to me.
Case in point - when using bframes without any other setting enabled but VHQ and quant restricted to 4 for bframes the bframe quant stays on 4 for most frames but if i start to use other xvid settings or filters the bframes quant rises, by how much depends on the number of other xvid setting used at once or the strength of the filter(s).

This is why i hardly ever use any other settings or filters.Instead i reduce the resolution and/or use a softer resizer and i always use H.263 instead of ME when bframes are enables as the low quant of bframes really shows with ME.

If your looking for a 1cd rip(i am not)then use Convolution3d and/or undot filters in your script as these filter very little while reducing size by quite a bit and distributing bframe quants between 4, 5 ,6 evenly in relation to other heavier filters(mip, deen ect)which do reduce size more but not much and send the bframes quant to 6 only so ending up with a potentially much worse looking encode.

Teegedeck
22nd December 2003, 22:08
It would be interesting to hear what kind of source you've encoded. Usually, quants >6 don't neccessarily result in blocking. When you talk about 'ME' do you actually mean MPEG-quants? (ME is already in use as an abbreviation for motion estimation.)

Kb_cruncher
23rd December 2003, 02:53
My source is dvd.I can definatly see blocks at quant 6.However i did make a mistake when i said qant 5 and 6 are allowed as i did not think the average bitrate set for the second pass would make a difference as qaunts have been restricted but it does, so even though restrictions are in place the codec still tries to stay as close as possible to the bitrate entered(or target size).As i had the bitrate set lower than the average for the source it used quants 5 and 6 to try and stay within that bitrate, once i input the proper average bitrate the bframe quant stayed at 4.

As an experiment i increased the resolution in the second pass from 640x352 to 704x384 which indroduced quants 5 and 6 again, i then added Undot and c3d to my script and the bframe quant stayed at 4.Whats interesting to note is that the second pass at the higher res and filters added to the script gave me better quality than the first second pass at the lower res while staying very close to the end size of the first second pass i did.

By ME i mean MPEG as oppose to H.263.

[EDIT]

The xvid Status window is an invalublable tool for getting quality encodes everytime as you can watch what quants are used.

Here is what i do as of know.

I restrict quantisers to 2 for I,P frames and 4 for Bframes.set the resolution to the maximum possible, setup a 5% test in vdub, do the first pass.Then in the second pass whatch what quants the bframes use.If quants 5 and 6 are introduced then change the script to iclude a smoother, turn on other xvid settings, then lower the resolution(i do it in this order)until quants 5 and 6 disappear within my target size.

You may say that not keeping settings the same for both passes is wrong but i find this way gives me much more control over quality than just allowing whatever quantisers the codec needs to use to stay within the average bitrate/filesize.

Sagittaire
23rd December 2003, 03:58
And with ffvfw and XviD 1.0 in 3 pass ... !!!?

For improuve quality in 2 pass mode with XviD 1.0 & low compressibility make first pass with quant3 or quant 4 ...

QPel for low compressibility encoding have a very negative effect for PSNR, OverallPSNR, SSIM, VQM and visual test for me ...

if you want very high with XviD in Quant2 (quant2 for IFrame & Pframe, quant3 for Brame) choose this setting ...

andreas_78er.matrix
Ultra High
VHQ4
CM
Trelli
AQ
GMC
Qpel
bframe 1/1.00/1.00

If quality aren't high for you make encoding in quant1 ... ;-)