PDA

View Full Version : High Profile VS Main Profile


shon3i
10th June 2006, 18:32
Sorry if thread exist but i don't find anything similar

Is this possible, i encoded some DVD (Date Movie) and find that MainProfile looks better than HighProfile aslo i do some PSNR calculations with 1000 frames from middle of movie. Results

High Profile: 32.8845db 2.23fps
--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 6 --trellis 1 --analyse all --8x8dct --me umh --progress --no-dct-decimate --no-psnr --output "HighProfile.mkv" "clipb.avs"

High Profile: 32.8837db 2.29fps but with --merange 8
--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 6 --trellis 1 --analyse all --8x8dct --me umh --merange 8 --progress --no-dct-decimate --no-psnr --output "HighProfile.mkv" "clipb.avs"

Main Profile: 32.8886db 2.49fps
--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --me umh --progress --no-dct-decimate --no-psnr --output "MainProfile.mkv" "clipb.avs"

Main Profile: 32.8884db 2.55fps but with --merange 8
--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --me umh --merange 8 --progress --no-dct-decimate --no-psnr --output "MainProfile.mkv" "clipb.avs"

I used merange 8 to see how much i can speedup process but keep quality, because my processor is Intel Pentium III Copermine @ 750mhz

Any idea ?? Thanks

Sagittaire
11th June 2006, 00:57
You use internal x264 value ... ???

your PSNR calculation seem false because very low (~ 32 dB is very low value and very poor quality). If not perhaps simply that 8*8 DCT don't work correctly in very high quantizer zones. Moreover IMO 8*8 DCT or not with this quality level don't change anything ... it's really too bad in all the case.

AlexI
11th June 2006, 08:25
Some suggestions... one, how sure are you of your psnr if you're running with no-psnr? the number you're getting might include the results of some filters (assuming avisynth here). I would try and see what x264 thinks the psnr is. The number is quite low for the bitrate. Try adding denoise, inverse telecine (if applicable) and deinterlace (if applicable).

Two, that's a command line that uses quite a lot of complex options... they may interact in unintended ways. Simplify ;) Like this: --me umh --subme 6 --ref 16 --analyse all --bframes 3 --weightb --trellis 1 --progress . I think you'll find that this is (a) about the same quality as what you're doing but much faster and (b) adding --8x8dct helps noticeably in this case (at a guess, by 0.1 dB).

Three, --merange 8, huh? That's a bizarre way to speed up ;) Bet you dropping any one of the complex options will result in a much greater speedup and less loss of quality. Using merange 8 increases the chances that some footage will cause the encoder to produce a really bad encode ;)

bond
11th June 2006, 11:16
is 8x8dct/i8x8 (btw high profile is more than just this) supposed to increase psnr? or is it "only" supposed to increase visual quality? ;)

shon3i
11th June 2006, 11:52
You use internal x264 value ... ???

your PSNR calculation seem false because very low (~ 32 dB is very low value and very poor quality). If not perhaps simply that 8*8 DCT don't work correctly in very high quantizer zones. Moreover IMO 8*8 DCT or not with this quality level don't change anything ... it's really too bad in all the case.I use compare function from avisynth to compare every clip with original, so what you suggest how to compare and get right PSNR, or what to do.

Some suggestions... one, how sure are you of your psnr if you're running with no-psnr? the number you're getting might include the results of some filters (assuming avisynth here). I would try and see what x264 thinks the psnr is. The number is quite low for the bitrate. Try adding denoise, inverse telecine (if applicable) and deinterlace (if applicable).
I use this avs script for comparing clips with original

clipa=directshowsource("mainProfile.mkv").ConvertToRGB24
clipb=import("orig.avs").ConvertToRGB24

compare(clipa,clipb,"","compare.avs.log") and when i play that file in virtualdub, i get log compare.avs.log which is last line overall PSNR=bla bla

Here is what i get from this file

Comparing channel(s) RGB

Mean Max Max
Absolute Mean Pos. Neg.
Frame Dev. Dev. Dev. Dev. PSNR (dB)
-----------------------------------------------------
0 1.1473 -0.4570 6 -8 44.6307
1 1.1627 -0.0475 9 -10 44.6091
2 1.3428 +0.0120 9 -13 43.6370
3 1.2207 +0.0421 13 -12 44.3203
4 1.2362 +0.0164 13 -13 44.1505
5 1.2283 +0.0244 16 -14 44.0317
6 1.2916 +0.0840 13 -40 43.7160
7 1.3071 +0.0715 18 -17 43.6809
8 1.3154 +0.0002 25 -18 43.5376
9 1.3178 +0.0586 27 -15 43.5079
10 1.3255 +0.0520 18 -16 43.4312
........
989 2.2077 -0.0100 19 -18 38.8246
990 1.8841 -0.0460 14 -18 40.1931
991 2.5344 -0.3806 25 -34 37.4382
992 2.5213 -0.2997 25 -26 37.5688
993 2.2742 +0.0267 21 -20 38.5242
994 2.7140 -0.1991 30 -31 36.7987
995 2.5486 -0.0355 23 -21 37.5289
996 3.0126 -0.1867 34 -38 35.9053
997 2.5016 +0.0228 22 -22 37.7212
998 2.8883 -0.4075 31 -27 36.4138
999 133.8093 -125.6358 125 -130 6.4465
1000 133.7824 -125.5683 125 -130 6.4487



Total frames processed: 1001

Minimum Average Maximum
Mean Absolute Deviation: 0.8642 1.7852 133.8093
Mean Deviation: -125.6358 -0.3671 +0.1577
PSNR: 6.4465 42.3864 46.0534
Overall PSNR: 32.8884


Two, that's a command line that uses quite a lot of complex options... they may interact in unintended ways. Simplify Like this: --me umh --subme 6 --ref 16 --analyse all --bframes 3 --weightb --trellis 1 --progress . I think you'll find that this is (a) about the same quality as what you're doing but much faster and (b) adding --8x8dct helps noticeably in this case (at a guess, by 0.1 dB). Thanks for that but ref 16 is too much and overkill for my cpu. Aslo this is insane settings.

Three, --merange 8, huh? That's a bizarre way to speed up Bet you dropping any one of the complex options will result in a much greater speedup and less loss of quality. Using merange 8 increases the chances that some footage will cause the encoder to produce a really bad encode Thanks for info.

Manao
11th June 2006, 14:40
999 133.8093 -125.6358 125 -130 6.4465
1000 133.7824 -125.5683 125 -130 6.4487



Total frames processed: 1001

Minimum Average Maximum
Mean Absolute Deviation: 0.8642 1.7852 133.8093
Mean Deviation: -125.6358 -0.3671 +0.1577
PSNR: 6.4465 42.3864 46.0534
Overall PSNR: 32.8884There is the issue. The last two frames must be taken into account ( you used virtualdub, didn't you ? so with bframes, you're missing some frames at the end ). The overall is highly sensitive to a very low value ( and 6 is a very low value ), which means that this value alone will almost decide the final psnr value, while by itself the value doesn't depend on the encoding settings.

shon3i
11th June 2006, 14:55
Yes i use VirtualDub, but what i need to do, or what settings to use encode this film propertly, Main or High Profile, aslo how to calculate PSNR corectly. Thanks

Sagittaire
11th June 2006, 15:56
use simply internal PSNR computation from x264 CLI. Moreover PSNR in avisynth is not YV12 but YUY2 space color.

shon3i
11th June 2006, 17:23
Did you mean to use --no-psnr switch or what??

unmei
11th June 2006, 18:46
to *not* use that switch..

shon3i
11th June 2006, 20:32
to *not* use that switch..
I am not using that switch, check my cmd. aslo i do encodings with megui.

Manao
12th June 2006, 00:14
I am not using that switch, check my cmd.Then report the psnrs given by x264, instead of computing psnr on your own. x264 is a safer way to compute psnr.

shon3i
12th June 2006, 12:36
Ok here is:

Main Profile:

avis [info]: 640x352 @ 25.00 fps (1001 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE
x264 [info]: slice I:6 Avg QP:17.00 size: 15188 PSNR Mean Y:48.47 U:50.15 V:51.39 Avg:49.07 Global:48.57
x264 [info]: slice P:749 Avg QP:17.04 size: 5968 PSNR Mean Y:48.35 U:50.04 V:51.51 Avg:48.99 Global:48.66
x264 [info]: slice B:246 Avg QP:19.79 size: 3344 PSNR Mean Y:44.52 U:46.21 V:46.92 Avg:45.09 Global:44.88
x264 [info]: mb I I16..4: 79.6% 0.0% 20.4%
x264 [info]: mb P I16..4: 18.5% 0.0% 1.9% P16..4: 53.4% 6.3% 7.6% 0.3% 0.2% skip:11.9%
x264 [info]: mb B I16..4: 0.0% 0.0% 0.2% B16..8: 30.1% 1.2% 3.3% direct: 6.5% skip:58.7%
x264 [info]: direct mvs spatial:76.4% temporal:23.6%
x264 [info]: ref P 53.4% 25.9% 20.7%
x264 [info]: ref B 79.9% 13.8% 6.3%
x264 [info]: PSNR Mean Y:47.410 U:49.097 V:50.380 Avg:48.034 Global:47.387 kb/s:1075.62

--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --me umh --progress --no-dct-decimate --output "MainProfile.mkv" "clipb.avs"

High Profile:

avis [info]: 640x352 @ 25.00 fps (1001 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE
x264 [info]: slice I:6 Avg QP:17.17 size: 14414 PSNR Mean Y:48.42 U:50.04 V:51.27 Avg:49.00 Global:48.39
x264 [info]: slice P:749 Avg QP:17.00 size: 6002 PSNR Mean Y:48.30 U:50.01 V:51.49 Avg:48.95 Global:48.64
x264 [info]: slice B:246 Avg QP:19.99 size: 3261 PSNR Mean Y:44.51 U:46.12 V:46.85 Avg:45.05 Global:44.86
x264 [info]: mb I I16..4: 60.1% 24.1% 15.9%
x264 [info]: mb P I16..4: 12.9% 3.2% 1.8% P16..4: 54.3% 6.9% 8.7% 0.3% 0.2% skip:11.7%
x264 [info]: mb B I16..4: 0.1% 0.0% 0.1% B16..8: 28.5% 1.2% 3.1% direct: 5.8% skip:61.2%
x264 [info]: 8x8 transform intra:18.2% inter:40.4%
x264 [info]: direct mvs spatial:76.4% temporal:23.6%
x264 [info]: ref P 52.8% 26.5% 20.6%
x264 [info]: ref B 78.1% 15.0% 6.8%
x264 [info]: PSNR Mean Y:47.371 U:49.059 V:50.351 Avg:47.994 Global:47.363 kb/s:1075.85

--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --subme 6 --trellis 1 --analyse all --8x8dct --me umh --progress --no-dct-decimate --output "HighProfile.mkv" "clipb.avs"

Again is Main Profile have little bigger PSNR than High Profile. Is there some catch or is like bond say

is 8x8dct/i8x8 (btw high profile is more than just this) supposed to increase psnr? or is it "only" supposed to increase visual quality?

Daodan
12th June 2006, 12:44
Have you tried to see what a SSIM test has to say? After some old tests of mine I don't really trust PSNR. Also what do your eyes say? (probably the both will look the same unless you look for specific problems).

shon3i
12th June 2006, 13:30
Have you tried to see what a SSIM test has to say? After some old tests of mine I don't really trust PSNR. Also what do your eyes say? (probably the both will look the same unless you look for specific problems).
@Daodan i newer play with this test's so i don't know how to preform SSIM test, what i need to compare, any program or how?? Thanks

Daodan
12th June 2006, 13:41
This thread might help:
http://forum.doom9.org/showthread.php?t=61128=ssim
It's basically similar procedure to the first PSNR tests you made (make an avs script and play it in VD).

Sharktooth
12th June 2006, 13:43
can you also post the avisynth script?

shon3i
12th June 2006, 13:54
@Daodan thanks a lot.

@Sharktooth sure, here is

DGDecode_mpeg2source("B13.d2v",info=3)
ColorMatrix(hints=true)
#Not doing anything because the source is progressive
crop( 10, 2, -10, -4)

LanczosResize(640,352) # Lanczos (Sharp)
#denoise

Daodan
12th June 2006, 13:56
In case that question was adressed to me the avs samples are in the link I already gave:

Some script examples:


Code:

a=mpeg2source("C:\Vobs\pacte.d2v").crop(14,92,692,416).lanczosresize(640,256)
b=AVISource("C:\Vobs\xvid.avi").trim(1,0)
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)
In this example, i compare the dvd source to the xvid compressed version. As bframes are used, i have to trim the first frame of the xvid version.


Code:

a=mpeg2source("C:\Vobs\pacte.d2v").crop(14,92,692,416).lanczosresize(640,256)
b=AVISource("C:\Vobs\divx.avi")
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)
There, i compare the same source to a divx compressed version. No need to cut any frames there.


In the two examples, i compare the dvd to mpeg-4 codecs. But the SSIM metric should works as better on any codec, video source.

Nota:
-Compared clips must have same width/height/length
-SSIM is computed in yv12 colorspace

In my old tests I used directshowsource (without any postprocessing for the mkv and for the source I used the avs script used for encoding). In version 0.25 I think lumimasking can't be true or false anymore but it can get values that I have no idea what they mean (but if left blank is equivalent tu true). The SSIM value is in averageSSIM.txt

EDIT: it seems it was not...still, I leave the text here in case someone lazy still needs it.

Manao
12th June 2006, 14:20
8x8dct ought to raise the psnr by ~0.1dB, at least. I'd try to remove trellis, and to try a constant quantizer encoding. Also, what type of content are you encoding ?

Sagittaire
12th June 2006, 14:57
Quality is simply very high with average quant at 17. With this quality it's hardest to have real quality improuvement with advanced function like RDO, Trelli, WPred ...

-> Visual quality at this level quality is the same for eyes. Very hard for eyes to see differences between MP and HP (isn't it?)

-> Hard to have PSNR or SSIM improvement here (try with 1168 and see the result ... certainely always very close PSNR) simply because distortion are already very low : you can try with very faster setting and objective/subjective quality will be the same:

--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 1 --bframes 2 --weightb --direct auto --subme 5 --analyse all --8x8dct --me hex --progress --output "HighProfile.mkv" "clipb.avs"


Use very slow setting with very high quality level is simply useless

shon3i
12th June 2006, 17:04
Here is SSIM:

Main Profile:
82.46

High Profile:
82.44

8x8dct ought to raise the psnr by ~0.1dB, I'd try to remove trellisDid you think that can be help, because my machine is so slow and i need about one day to encode this movie, and in my type 8x8dct only decrase PSNR by -1.50db

and to try a constant quantizer encoding. Also, what type of content are you encoding ?
I encode DVD movie with duration of 1 hours and 24 minutes and few seconds, and with fixed size of 700MB

Quality is simply very high with average quant at 17. With this quality it's hardest to have real quality improuvement with advanced function like RDO, Trelli, WPred ...Yes, but not whole move looks that good, because i use 1000 frames to test and see why Main Profile looks better than High Profile in some dark and very complicated scens, real avg quantizer of whole movie is about 24 or 25. Whole movie looks better with Main Profile with settings on my first post, so i want to see is this possible, and can in future only to use main profile because is double faster(on my machine).

-> Visual quality at this level quality is the same for eyes. Very hard for eyes to see differences between MP and HP (isn't it?)True, but i saw some blocks in HP, and for me that's is very strange, i've try to post some pictures later.

--pass 2 --bitrate 1068 --stats "clipb.stats" --ref 1 --bframes 2 --weightb --direct auto --subme 5 --analyse all --8x8dct --me hex --progress --output "HighProfile.mkv" "clipb.avs"
Thanks for this i will try and post results.

Sharktooth
13th June 2006, 22:15
Do not resize to 640 too (keep it 720 or 704).
i suspect a low resolution will nullify the advantage of the 8x8 transform coz the fine details get lost during resize.

shon3i
14th June 2006, 10:55
Hmm thanks for info, i will try.

SCIF
21st June 2006, 05:39
People, did you see thread with merange's test (http://forum.doom9.org/showthread.php?t=110636)? This thread also prove useless high merange's values. What do you think about this?

shon3i
21st June 2006, 20:26
I agree with you, merange 8 not disturb quality, and very little decrase PSNR and SSIM, but spedup is huge!