Log in

View Full Version : Test results for QMF Encodes using CCE with various Matrices and QC Values.


jsquare
28th August 2003, 00:19
These are the results of a few tests I ran with some of CCE matrices, QMF Method posted by DDogg, also playing with different values of QC(Quantization or Image Quality Priority) and BIAS.

Here are my settings:

StarWars I: Phantom Menace
CCE 2.67
Encoded as XSVCD(Bitrate 0-2500 @ 720x480)
gerti67's SemiAutoCropAndResize(with and w/o QMF)
Tylo's D2SRoBa Plugin (2-CDs %=2 GOPs=2 Adj.Q=1 Sample Time=2m:43s:18)
Q.Factor fixed at 36

File size results:


Matrix->CCE CCE MPEG CCE Notch
QC BIAS Ultra-Low Very-Low Standard Standard KVCD QMF
17 20 29,943,880 N/A N/A N/A N/A NO
1 50 31,613,744 32,363,100 35,463,028 32,408,924 31,379,112 NO
64 50 26,647,992 27,224,132 30,543,448 27,245,232 26,403,696 NO
1 50 28,654,420 N/A 32,162,896 N/A 28,651,448 YES
64 50 23,887,528 N/A 27,022,148 N/A 23,970,304 YES


The high QC values makes a real difference in final file size, while BIAS made no impact at all even when I tried values of 1,25,50,100. Using QMF slows down your encoding to nearly half the speed, but it will help reduce the size further and improve image quality. Notch-KVCD matrix will give you almost the same results as CCE's Ultra-Low, but much better image quality at least to my eyes.

AviSynth Scripts used on these tests:

[AVISYNTH_SemiAutoCropAndResize]
0=DetectedTop=^DetectedTop. DetectedHeight=^DetectedHeight
1=BlocksToCropHorizontal=^BlocksToCropHorizontal. BlocksToCropVertical=^BlocksToCropVertical. BlockOptimization=^BlockOptimization
2=ResizeMethod=^ResizeMethod. Bicubic_b_Value=^b_value. Bicubic_c_Value=^c_value
3=GammaCorrection=^GammaCorrection. Hue=^Hue. Saturation=^Saturation. Brightness=^Brightness. Contrast=^Contrast
4=DebugMode=^DebugMode
5=DestinationWidth=^TargetWidth
6=DestinationHeight=^TargetHeight
7=LoadPlugin(!SimpleResize.dll)
8=Import(!SemiAutoCropAndResize.avs)
^DetectedTop.=58
^DetectedHeight=360
^BlocksToCropHorizontal.=0
^BlocksToCropVertical.=0
^BlockOptimization=16
^ResizeMethod.=3
^b_value.=0.0
^c_value=0.85
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0
^Contrast=1.0
^DebugMode=0
!SimpleResize.dll=V:\DVD2SVCD\Avisynth2.5 Plugins\SimpleResize\SimpleResize.dll
!SemiAutoCropAndResize.avs=V:\DVD2SVCD\Avisynth2.5 Plugins\AutoCrop\SemiAutoCropAndResize.avs

[AVISYNTH_SemiAutoCropAndResize QMF w/o Filters]
0=DetectedTop=^DetectedTop. DetectedHeight=^DetectedHeight
1=BlocksToCropHorizontal=^BlocksToCropHorizontal. BlocksToCropVertical=^BlocksToCropVertical. BlockOptimization=^BlockOptimization
2=ResizeMethod=^ResizeMethod. Bicubic_b_Value=^b_value. Bicubic_c_Value=^c_value
3=GammaCorrection=^GammaCorrection. Hue=^Hue. Saturation=^Saturation. Brightness=^Brightness. Contrast=^Contrast
4=DebugMode=^DebugMode
5=DestinationWidth=^TargetWidth
6=DestinationHeight=^TargetHeight
7=LoadPlugin(!SimpleResize.dll)
8=Import(!qmf15b1.avs)
9=function Low_Motion_Filter(clip c) { c = FluxSmooth(c,14,0) c = UnFilter(c,-10,-10) return c }
10=function Medium_Motion_Filter(clip c) { c = FluxSmooth(c,7,7) c = UnFilter(c,-20,-20) return c }
11=function High_Motion_Filter(clip c) { c = FluxSmooth(c,0,14) c = UnFilter(c,-30,-30) return c }
12=QMF()
13=Import(!SemiAutoCropAndResize.avs)
^DetectedTop.=58
^DetectedHeight=360
^BlocksToCropHorizontal.=0
^BlocksToCropVertical.=0
^BlockOptimization=16
^ResizeMethod.=3
^b_value.=0.0
^c_value=0.85
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=1.0
^Contrast=1.0
^DebugMode=0
!SimpleResize.dll=V:\DVD2SVCD\Avisynth2.5 Plugins\SimpleResize\SimpleResize.dll
!qmf15b1.avs=V:\DVD2SVCD\Avisynth2.5 Plugins\QMF\qmf15b1.avs
!SemiAutoCropAndResize.avs=V:\DVD2SVCD\Avisynth2.5 Plugins\AutoCrop\SemiAutoCropAndResize.avs

Notice that I used Lanczos for resizing, and a c_value of 0.85, don't know why but encodes look better when I use 0.85.

So my final decision for future encodes goes like this:
[list=1]
D2SRoBa for OPV
CCE 2.67 with Notch-KVCD Matrix
SemiAutoCropAndResize with QMF w/o Filters
QC=32 (CCE manual recommends 16-40)
BIAS=50 (or 30 like recommended by CCE Makes no difference)
[/list=1]
Hope this will help some of you guys, specially those trying 1-CD encodes.

DDogg
28th August 2003, 15:04
It is so cool when we all pull together. Thanks for these tests.

I also agree the kvcd-Notch seems to be a good choice although I saw a larger increase in file size than you did over CCE's Ultra Low. Also, I tend to think you are right about the Quantization (Flat panel priority) being around 30. I have been using a range between 20-30 lately.

I still don't understand bias within the context of sub 1,000 kb bitrates. I suspect it can't really do its job when it is confined that low.

Btw, in fairness to Bach, I think all his tests on matrices were done with much earlier versions of CCE that still used the linear and non-linear methods. It turns out that newer versions of CCE make the effects of different matrices much more evident. It may be that earlier version were not even properly using matrices. One thing for sure, they damn sure make a difference in CCE 2.67.00.11!

Holomatrix
28th August 2003, 21:31
Thanks for your report. Could you please do a test using Andreas SVCD matrix. I have found it to be the best so far. KVCD-Notch was tested/designed using TMPEG MPEG1 which I don't think works so well with CCE MPEG2.

kwag
29th August 2003, 00:08
Hi Holomatrix,

The KVCD "Notch" matrix works just as well in MPEG-2 :)
The "Andreas" matrix doesn't have any low frequency notch pattern, so it won't kill DCT blocks on that frequency domain as KVCD's matrix.
I believe the first KVCD matrix, the one that didn't have the "Notch" design, didn't perform as well as Andreas. But the newer "Notch" matrix is a complete different ball game ;)

-kwag

jsquare
29th August 2003, 02:38
Holomatrix, I will try a broader number of matrices next time including one I'm "tweaking" for lower Q values, also going to use SVCD standard resolution and not XSVCD like in previous tests.

Kwag is right, Notch-KVCD works very well will MPEG2 based on my tests, but I'm sure it will do a better job on SVCD than on my XSVCD since I'll be using a QC value of 32 for those tests which is better for SVCD.

DDogg
29th August 2003, 02:48
For those that do not have it, cut and paste this in at the botton of your matrices.ini in your d2s dir:


[KVCD-Notch by Kwag]
Intra=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,37,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79
NonIntra=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44

homerjay
29th August 2003, 23:11
i thought something was missing following the upgrade ( lost the notch on kvcd ) :rolleyes:
thanks for pointing theis out ddogg

DDogg
30th August 2003, 00:12
I guess the upgrade overwrites your Matrices.ini

DDogg
30th August 2003, 16:45
jsquare, I wanted to get your opinion and others with the goal to eventually establish a simple procedure on "how to attempt a 90-100 minute SVCD standard encode on 1 CD". You seem to be analytical, have a keen eye and have a good viewing vehicle for comparison.

I want to get away from the brutal filter concept and work toward more finesse. The research has been educational but I don't think I am getting anywhere adding more and more filters. We all know the downside to that in speed and image quality. The motion adaptive approach still makes the most sense to me and deals best with motion artifacts. Here is where I am at at the moment:

1> Attempt to find a filter setup to achieve Q of 30-32
2> First try with basic QMF BUT with Asharp(1, 4), This seems to give a very sharp and crisp picture and look MUCH nicer to my eyes, however it costs 5-6 points of Q.
3> If Q > 32 then remove ASharp and try basic QMF only as you suggested.
4> If Q > 32 but < 36 maybe try to live with it. If not:
5> Make the decision to add a CD or to add further softening with various methods. I think this is debatable as QMF softens already. WHat is your view? This step is where I am not clear on where to go and hopefully we can all pool our thoughts on what is practical.

Note: step 2 above might include Dialhot's Adaptive or Kwag's MAF filter without the ASharp? Any thoughts on that? Kwag?

jsquare
31st August 2003, 05:39
DDogg, here are my latest results and you will see some big differences in the use of Avisynth basic resizing filters (BiLinear, BiCubic & Lanczos) without any other scripts/filters, even made sure that CCE quality filters were turned off.
This time I selected one of my favorite material which I kind of love/hate for so many reasons: "SPR"

Test Setup

CCE = 2.67.00.11(EclCCE)
Video Format = SVCD
Image Qual. Priority(CQ) = 32
BIAS = 50
Q. Factor = 30
BitRate Range = 0-2500
D2SRoBa = 3% 3GOPs
Sample Time = 5m:05s:15
Sample Frames = 7335


Resize Method-> Bicubic(c=0.6) Lanczos Bilinear
CCE Matrix Size ABR Size ABR Size ABR
NonIntra 16+8 62,806,228 1642 64,098,920 1676 58,420,856 1528
NonIntra 16+7 64,496,128 1686 - - - -
NonIntra 16+6 66,543,104 1740 - - - -
NonIntra 16+5 68,914,836 1802 - - - -
NonIntra 16+4 71,611,620 1872 - - - -
Ultra-Low 77,988,732 2039 78,736,284 2059 74,043,512 1936
Notch-KVCD 78,560,780 2054 - - - -
Very-Low 80,317,196 2100 - - - -
Andreas SVCD 80,736,644 2111 - - - -
CCE Standard 80,884,344 2115 81,793,124 2139 77,177,256 2018
MPEG Standard 84,565,240 2211 85,157,584 2227 81,769,980 2138
Smooth (CG etc.) 84,757,140 2216 - - - -

Notes: ABR = Average Bit Rate, NonIntra 16+n = some test matrices I'll will explain later.

Comments: It seems like Bilinear will give you the best compression, but it could make your encoding smooth/un-sharp, BL also gives the best CCE speed and in my case was 1.8-2.0 vs 1.4-1.7 for BiCubic/Lanczos.

Call me a Matrix "fanatic" but somehow they seem to have a big effect on CCE behavior, of course the more they bring down the bitrate the less desirable are the results. If anyone wants to add another matrix to the list I will test it under the same settings and post the results.
The idea here is to find a balanced combination of all those variables(preferably CCE internals filters) that will make the best results with the least amount of filters/scripts(like DDogg suggested).

DDogg
1st September 2003, 01:58
Your results are as expected. I did a lot of testing quite some time ago and your tests bear out the ones I made. Something you might want to play with is Asharp and bilinear. Might be a good combo.

As for Matrixes, try this one. I have had a lot of correspondence lately and out of that came this matrix, let's call it Bach1. It is a combination of the standard intra and the kvcd Notch non-intra. It yields a smaller file size and to my eye (just cursory inspection so far) slightly better video quality.


[Bach1 Matrix]
Intra=8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83
NonIntra=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44

jsquare
1st September 2003, 16:19
Something you might want to play with is Asharp and bilinear.
DDogg I tried this already and Asharp(2,4) adds around 15% more to the file size.

Like in your matrix(16+2) I also added 16+n to the NonIntra cells to get those results leaving Intra as MPEG Standard.
You may want to try this one in combination with SemiAutoCropAndResize(Lanczos) yields better results than using Bilinear + Asharp:

[NonIntra=Intra+8]
Intra=8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83
NonIntra=16,24,27,30,34,35,37,42,24,24,30,34,35,37,42,45,27,30,34,35,37,42,42,46,30,30,34,35,37,42,45,48,30,34,35,37,40,43,48,56,34,35,37,40,43,48,56,66,34,35,37,42,46,54,64,77,35,37,42,46,54,64,77,91

DDogg
1st September 2003, 18:16
Thanks, I'll give it a try soom and report back.