View Full Version : Low Bitrate MAF Encodes using CCE and Tylo's 1 pass Plug-in


DDogg
5th August 2003, 00:30
(NOTE: Advanced users only - please do not post in this thread until you have verified you have Gerti's Semi-AutoResize working properly)

Using The MAF script below (modification of Gerti's) I have had some
impressive low bitrate encodes using Tylo's CCE 1-pass plug-in.

I am talking sub 800 kb/s bitrates like "the Mtrx" @697 kb/s on one
cd with hardly any artifacts - 2:15 mins on 1 80 min CDR (using CCE
2.67.00.11 and RB's Progressive CCE template). Quite astonishing
really.

The new features in Avisynth 2.52 that allow Motion Adaptive
Filtering (MAF) really make a lot of new thinking possible and
brings this stuff into the mainstream for DVD2SVCD. Perhaps the kvcd-
notch matrix makes a difference also if it is used in cce
2.67.00.11. Dunno. This stuff is WELL worth playing around with
(IMO). I mean, the encode doesn't HAVE to go on just one cd. This
MAF stuff just allows more flexibility. A three hour movie on 2 cds
is very possible for sure.

BTW, backup your ini file in your dvd2svcd directory BEFORE you mess
with this if you don't like it.

Holomatrix turned me on to this MAF stuff as well as this site where
you can get all the filters and the KVCD matrix (is it even used in
CCE 2.67.00.11?):
http://www.rj-elektronik.de/avalon/Guides/dvd2kvcd/dvd2kvcd.htm

I think this group could do a lot more work on this subject as it
applies to DVD2SVCD. Now, where the hell IS Bach when you need
him? :-/

You must first install Gerti's filter, understand its use, and get
it working properly BEFORE moving to the one below. See
http://forum.doom9.org/showthread.php?s=&threadid=55641

After you follow the instructions you will have the
[AVISYNTH_AutoDetectBorders] section in your dvd2svcd.ini already,
so just add the section [AVISYNTH_MY_SemiAutoCropAndResize_MA
script (2.5.2)]

Add it below Gerti's standard SemiAutoCropAndResize section in the
dvd2svcd.ini. That way you can use both depending on whether you
want the extra compression.

BTW, most of all the credit for this stuff goes to KWAG and remember
this stuff was set up for tmpg and works well with it. Also ProCoder
as long as the bitrate is not below 900. ProCoder will allow no
lower than that (900). I think ProCoder actually does the best job
but the 900 limitation screws me up on longer movies. Maybe we can
figure a way around that.

Note: I am using a standard 480 width and mpeg2dec10 and modifying the script as:
mpeg2source("D:\matrix\DVD2AV~1.D2V")

[AVISYNTH_AutoDetectBorders]
0=LoadPlugin(!AutoCrop.dll)
1=AutoCrop(1,4,2,0,^OffsetTop,0,^OffsetBottom,^Threshold,5,0)
2=BilinearResize(^TargetWidth,^TargetHeight)
3=AddBorders(0,^BorderTop,0,^BorderBottom)
!AutoCrop.dll=C:\Program Files\AviSynth 2.5\plugins\autocrop\AutoCrop.dll
^OffsetTop=0
^OffsetBottom=0
^Threshold=20

[AVISYNTH_MY_SemiAutoCropAndResize_MA script (2.5.2)]
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)
9=LoadPlugin(!StMedianfilter.dll)
10=LoadPlugin(!Asharp.dll)
11=LoadPlugin(!Undot.dll)
12=MaxTreshold=^max_threshold
13=scd_trigger=^scd_trigger
14=nf=0
15=undot()
16=Limiter()
17=asharp(1,4)
18=STMedianFilter(^stm1,^stm2,0,0)
19=MergeChroma(blur(^max_threshold))
20=MergeLuma(blur(0.1))
21=ScriptClip("nf=YDifferenceToNext()"+chr(13)+"nf>2.5 ? asharp(-(fmin((nf/30),1)),0):TemporalSoften(2,7,7,3,2)")
22=ScriptClip("nf >scd_trigger ? asharp(-2,0):asharp(0,0)")
23=Limiter()
24=function fmin(float f1,float f2){return(f1<f2) ? f1:f2}
^DetectedTop.=60
^DetectedHeight=358
^BlocksToCropHorizontal.=1
^BlocksToCropVertical.=2
^BlockOptimization=16
^ResizeMethod.=2
^b_value.=0.0
^c_value=0.5
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0
^Contrast=1.0
^DebugMode=0
!SimpleResize.dll=C:\Program Files\AviSynth 2.5\plugins\SimpleResize.dll
!SemiAutoCropAndResize.avs=C:\Program Files\AviSynth 2.5\plugins\autocrop\SemiAutoCropAndResize.avs
!StMedianfilter.dll=C:\Program Files\AviSynth 2.5\plugins\STMedianFilter.dll
!Asharp.dll=C:\Program Files\AviSynth 2.5\plugins\asharp.dll
!Undot.dll=C:\Program Files\AviSynth 2.5\plugins\UnDot.dll
^max_threshold=1.50
^scd_trigger=30
^stm1=8
^stm2=32

homerjay
5th August 2003, 10:38
woooo :eek:
that is a script and a half there :p
going to definately give this a shot DDOGG but i have a couple of questions please ....

1 how long does that take to run and what speed is your rig
2 is the output technically an skvcd or is it a svcd

thanks & will report back results :D

jorel
5th August 2003, 12:00
excuse me DDogg,

i'm not a tester or developer but
i learn one fantastic hint with
Sh0dan and Dialhot(Phil)in kvcd forum:

avisynth 252 have the (great) "autoload" function!
we only need to put all filers in the
"plugins" folder of avisynth 25, then,
we can remove all lines with:

#=loadplugin(!xxx.dll)
and
!xxx.dll=C:\xx...\xx...dll

they all will "autoload" and the script is smaller
working in the same great way!

:)

DDogg
5th August 2003, 14:07
@ homerjay, this is just Gerti's standard semi-auto dvd2svcd INI script (awesome work) with the MAF stuff added. It is not a regular avisynth script, rather it is added to the dvd2svcd.ini file in your dvd2svcd directory and is available as a drop down in the frameserver tab. Do make sure to first follow Gerti's excellent instructions for installing his script BEFORE you try this.

It creates a standard 480x480 SVCD, but one with a much lower bitrate than we normally think of as "standard". The MAF stuff,I am guessing, would slow you down about 50% over the normal semi-auto script.

@jorel, of course, absolutely correct, and one can remove those plug-in lines and renumber the script if they desire, but I would suggest they first get this working and then make any mods later.

Holomatrix
5th August 2003, 15:42
Originally posted by DDogg

Holomatrix turned me on to this MAF stuff as well as this site where
you can get all the filters and the KVCD matrix (is it even used in
CCE 2.67.00.11?):
http://members.lycos.co.uk/dcdvideo/DVD2KVCD/dvd2kvcd.htm


I'm running some tests as to see what matrix looks better with CCE. KVCD-Notch or my regular Andreas SVCD Matrix. Even though I think it was Bach that said the matrices are useless :)

Originally posted by DDogg
?=
?asharp=
?f1=


Maybe DVD2SVCD could omit putting the ?= stuff at the end of the script due to him not knowing if the script is going to work, thinking there is stuff missing. Avisynth will let us know, for sure :)

r6d2
5th August 2003, 17:21
I've tried it and it generates a very good encode indeed. However, DVD2SVCD stalls after muxing, when calculating audio size. Only way out is terminating it. Looking at bbMPEG's screen it generates a lot of underflows. Maybe this is the cause?

Anyway, I've burnt the mpeg manually with VCDEasy, but when playing it looks jerky at certain parts.

Anyone experiencing this?

DDogg
5th August 2003, 18:00
I've only done it on progessive sources and have not had a problem, except my older Apex 703 can't seem to deal with a svcd longer than 99 minutes but still plays smoothly. My Cyberhome 500 doesn't have a problem with it.

There has been mentions of some problem using chapters and image creation in DVD2SVCD with these type of disks and people have been using vcdeasy to make and burn the image. I have not experienced any problems yet although I have not paid much attention to that area yet.

Holomatrix
5th August 2003, 19:01
Originally posted by r6d2
I've tried it and it generates a very good encode indeed. However, DVD2SVCD stalls after muxing, when calculating audio size. Only way out is terminating it. Looking at bbMPEG's screen it generates a lot of underflows. Maybe this is the cause?

Anyway, I've burnt the mpeg manually with VCDEasy, but when playing it looks jerky at certain parts.

Anyone experiencing this?

Are you doing AVI? How are you muxing? As long as your encoding as MPEG2 and Muxing as SVCD NTSC you should be alright. Try double clicking on the SVCD radio button in bbmpeg to reset and changes that might have occured and I image create with VCDxbuild with no problems.

@ddogg - I think the problems with image creation that those people were having with DVD2SVCD was because of the modified Kwag GOP structure with TMPEG and things like that. Using CCE, I haven't had a problem

DDogg
5th August 2003, 19:26
@ddogg - I think the problems with image creation that those people were having with DVD2SVCD was because of the modified Kwag GOP structure with TMPEG and things like that. Using CCE, I haven't had a problem Yep! I'll bet you are right.

r6d2
5th August 2003, 22:50
Originally posted by Holomatrix
[B]Are you doing AVI? How are you muxing? As long as your encoding as MPEG2 and Muxing as SVCD NTSC you should be alright. Try double clicking on the SVCD radio button in bbmpeg to reset and changes that might have occured and I image create with VCDxbuild with no problems.

Thanks for you help, @Holomatrix. It is not an AVI, but a DVD. I'm muxing with bbMPEG's "double click SVCD's defaults", just as you suggested.

I think I found the problem anyway... It's too stupid to confess... OK, I'll say it: I was using MPEG-1 (29.9fps) on a IVTCed movie (23.9fps).

I was using MPEG-1 because of the low BR. I did a test of a 5 minute clip and encoded on both MPEG-1 and MPEG-2 at 29.9fps using CCE, and according to Bitrate Viewer's results, MPEG-1 gets consistently half the Q of MPEG-2...

Shouldn't MPEG-1 be the mode for these low BRs?


@ddogg - I think the problems with image creation that those people were having with DVD2SVCD was because of the modified Kwag GOP structure with TMPEG and things like that. Using CCE, I haven't had a problem
I've always wondered how Kwag always get those magic encodes. I've obtained comparable quality on some of my encodes with TMPGEnc, but this guy always gets it right!

In fact (AFAIK), Kwag uses mostly MPEG-1... It must be for a reason, isn't it? What do you think?

Holomatrix
6th August 2003, 01:34
True, MPEG1 would probably look a little better but unfortunatly my DVD player does not play XVCD to well so I'm stuck with doing XSVCD's but I'm not complaining, still looks great. If you want to mux as a MPEG1 without getting the underflows you can mux using the bbmpeg setting from Kwag, somthing like - Double clicking on the VCD radio button, checking VBR, setting Forced muxed rate to 0, setting Startup delay(ms) pack to 400. I think that's it, Kwag also uses a higher res like 544X480.

dvd2svcd
6th August 2003, 10:46
Originally posted by Holomatrix
Maybe DVD2SVCD could omit putting the ?= stuff at the end of the script due to him not knowing if the script is going to work, thinking there is stuff missing. Avisynth will let us know, for sure :) If you wanna use AVISYNTH internal ? or ^ make sure to put a space after the sign.

WRONG:
24=function fmin(float f1,float f2){return(f1<f2)?f1:f2}

RIGHT:
24=function fmin(float f1,float f2){return(f1<f2) ? f1:f2}

In the current version it'll mean that you only get one ?= which wont be filled. In the next version there'll be no ?= at all except if you omit the space after the sign.

Holomatrix
6th August 2003, 12:02
Cool, thanks. No big deal, just wanted to add that in so we didn't get any questions on "What is this stuff at the end of my script? I keep deleting it but it still comes back" :) If you know what I mean. :)

I don't have any luck with the Tylo plugin. I just did Phonebooth NTSC last night and the plugin picked a Q of 63 and bitrate of 1365, the movie is only 81 min. What if the movie was 130 min? Scary :) Do I need to lower my min bitrate in the Tylo INI? To bad the plugin couldn't ask me "Do you want to use a Q of 50 and bitrate of 1150 instead?" or somthing like that so I could choose my own quality (sort of).

EDIT: I just did Die Another Day again and it picked a Q of 63 and bitrate of 850 (2 1/2 hr movie) What is the deal with 63 ?

telemike
6th August 2003, 15:12
Can I use the new MAF with CCE 2.50?

I would have to re-install dvd2svcd for avisynth 2.52. I am using 2.08 with spacedust() and Temporalcleaner() with good results. Tylo's plugin certainly helps. I gotta try this if it will work with cce 2.50

r6d2
6th August 2003, 15:24
Originally posted by Holomatrix
I don't have any luck with the Tylo plugin. I just did Phonebooth NTSC last night and the plugin picked a Q of 63 and bitrate of 1365, the movie is only 81 min.

On the other side, I'm astonished. Two movies with this MAF stuff: Homeward Bound I and II, 1 CD each:

Q=32, BR=1189, 84 min
Q=52, BR=1127, 88 min

Weird, ah? Very different Qs, similar BRs and minutes. Anyway, both results look great!

One curious thing is that on the first case the BR could be gotten on the first try, look at this log:

- Number of CDs : 1
- Target mpv size : 753323136. (1189 kbps)
--------------------------------------------------------
- Binary search for Q:
- Estimated mpv size : 753424590. (Q=32, 1189 kbps, 15075316 sample sz)
- Estimated mpv size : 587742224. (Q=48, 928 kbps, 11760168 sample sz)
- Computed mpv size : 670583407. (Q=40, 1059 kbps, (Q48+Q32)/2)
- Computed mpv size : 712003998. (Q=36, 1124 kbps, (Q40+Q32)/2)
- Computed mpv size : 732714319. (Q=34, 1157 kbps, (Q36+Q32)/2)
- Estimated mpv size : 738560921. (Q=33, 1166 kbps, 14777908 sample sz)
--------------------------------------------------------
- Q Weight : (753323136. / 49.977366255144 - 14660923.) / (15075316 - 14660923.)
- Adjust Q : (33 + 1.0 - 0.995101312516253 - (0.8)) = 32.2048986874837
- Determined Q. : 32

And D2Sroba did not use it immediately, it went through the whole process anyway (3 sample encodes). (So I guess Door #1 I gave to @homerjay on the other thread was a "nice to expect" but deadend at last :))

Maybe Tylo will optimize this to stop the search when the result is alredy found!


To bad the plugin couldn't ask me "Do you want to use a Q of 50 and bitrate of 1150 instead?"
How could it do that? Remember Q and BR are inverse proportionally related to each other... A lower Q means a higher BR...

You cannot have both: space and quality. If you go for space, you'll get the best quality that fits in. If you go for quality, you will get the space it needs... But the perfect world is only for those who own a DVD writer :D

Holomatrix
6th August 2003, 15:49
Originally posted by r6d2
On the other side, I'm astonished. Two movies with this MAF stuff: Homeward Bound I and II, 1 CD each:

Q=32, BR=1189, 84 min
Q=52, BR=1127, 88 min

Weird, ah? Very different Qs, similar BRs and minutes. Anyway, both results look great!

Are you using MPEG2 now? or did you try muxing at MPEG1 with the settings I mentioned?

Originally posted by r6d2
How could it do that? Remember Q and BR are inverse proportionally related to each other... A lower Q means a higher BR...

You cannot have both: space and quality. If you go for space, you'll get the best quality that fits in. If you go for quality, you will get the space it needs... But the perfect world is only for those who own a DVD writer :D

I got confused there for a sec :)

Is 63 the highest Q that D2Sroba goes?

telemike
6th August 2003, 16:05
I think Tylo has his plugin set such that Q=63 is the max. It will not go over that.

Will the MAF work with CCE 2.50?:confused:

Holomatrix
6th August 2003, 16:11
Originally posted by telemike
I think Tylo has his plugin set such that Q=63 is the max. It will not go over that.

Will the MAF work with CCE 2.50?:confused:

Not sure Try it and let us know :) You can go here http://members.lycos.co.uk/dcdvideo/DVD2KVCD/dvd2kvcd.htm and download AviSynthSwitcher DCD-Video Edition which will allow you to switch between AVIsynth's with a click of the button.

homerjay
6th August 2003, 16:33
you can edit the ini i think to make Q higher than 63
(think i tried that at some point)
max is actually 64 - adjust q figure rounded up i think

DDogg
6th August 2003, 16:40
Just for the record I am using 128 audio and I am setting max at 2616, min at 100 and average at 1150. No, I don't have a clue how I came up with that so don't ask :)

Holomatrix
6th August 2003, 16:45
Originally posted by DDogg
Just for the record I am using 128 audio and I am setting max at 2616, min at 100 and average at 1150. No, I don't have a clue how I came up with that so don't ask :)

What min and max est bitrate to you have in the D2Sroba.ini?

r6d2
6th August 2003, 17:13
Originally posted by DDogg
Just for the record I am using 128 audio and I am setting max at 2616, min at 100 and average at 1150. No, I don't have a clue how I came up with that so don't ask :)
You said don't ask, but... Anyway :) What do you use AVG for? Are you doing Multipass now?

In my case I'm doing 96 audio (Stereo) since these are for my kids and translated spanish audio is always lower quality than the original. Works for me.
Originally posted by homerjay
you can edit the ini i think to make Q higher than 63
(think i tried that at some point)

What are the parameters names? They don't appear on my INI file.
Originally posted by Holomatrix
Are you using MPEG2 now? or did you try muxing at MPEG1 with the settings I mentioned?
Not yet, I'm about to do it now since MPEG-2 went way out of bounds on Cats & Dogs. BTW, when you get Q=63, the plugin's maximum value, check the actual BR. It may not fit on the number of CDs you expect.

I think Tylo made a hardcode max of 64 based on Bach's definition of the method (it is a power of 2 magic number :)). Besides, Qs above 60 are not that good, according to the CCE Manual.

It's funny, but I've read in many places that with NTSC, if you can go 23.9 fps by force filming of IVTC then you must do it to save 1/5 the filesize and hence the BR. However, if you open a 29.9 source in FitCD and change the fps combo box to 23.9 you don't get more BR, you just get more I-frames, which means of course better quality. But on tests I've done Q is indeed much lower with MPEG-1 at 29.9 than MPEG-2 at 23.9 at low BRs.

I'll check MPEG-1 with your mux settings and I'll come back with this.

@Telemike, please test 2.50 and tell us, please!

Another thing to @all,

If you created a VAF file (not much time impact) then you can check the Q visually opening the MOVIE project with CCE. Just change the encode mode to Multipass and click on Bit Allocation. On the movies I mentioned, mostly were green, and rarely went up gray (never red). So, a high Q like 52 is not necessarily bad :)

telemike
6th August 2003, 17:21
I will hopefully get to play around with it this weekend when i have some time.

r6d2
6th August 2003, 18:58
Originally posted by r6d2
I'll check MPEG-1 with your mux settings and I'll come back with this.

Sorry, no luck. Even if you select MPEG-1 in DVD2SVCD, it will use the mode set in the template you're using (MPEG-2). Changing the template to MPEG-1 is of no use since CCE does not support OPV in MPEG-1, just CBR!

Maybe that was the origin of my muxing problem!

Last week I tried an interesting script posted by @jorel in www.kvcd.net, which does MAF with TMPGEnc, but I could not get rid of the muxing problems. I'll go back to those to see if with @Holomatrix settings I can get rid of them.

Holomatrix
6th August 2003, 19:15
Originally posted by r6d2
Sorry, no luck. Even if you select MPEG-1 in DVD2SVCD, it will use the mode set in the template you're using (MPEG-2). Changing the template to MPEG-1 is of no use since CCE does not support OPV in MPEG-1, just CBR!

Maybe that was the origin of my muxing problem!

Last week I tried an interesting script posted by @jorel in www.kvcd.net, which does MAF with TMPGEnc, but I could not get rid of the muxing problems. I'll go back to those to see if with @Holomatrix settings I can get rid of them.

Let me know how you make out. These are the settings I'm refering to http://www.kvcd.net/forum/viewtopic.php?t=2224 Maybe only good for muxing MPEG1 KVCD created by TMPEG.

DDogg
6th August 2003, 19:37
Deleted due to bad information

telemike
6th August 2003, 20:01
Is the script at the beginning of the post correct? Please let me know what to use for testing with CCE 2.50/ THanks

Holomatrix
6th August 2003, 20:11
Originally posted by DDogg
Hmmm, I read Dvd2svcd's post above and changed the script above. Then I ran tylo's 1 pass. My Q dropped 15 points which is great, but I don't really understand why unless those spaces were not allowing the MAF portion to run correctly. Anyway, either make those changes or copy and paste from above. When you guys were mentioning Q's above 60 it got me to thinking that maybe something was not right.

My present test encode of the mtrx (NYSC)(trimmed to 186,523 frames via frame selection) is encoding at Q=35 bitrate - 847. Yesterday, it was Q-53 and bitrate-710 so I don't know what the hell is going on unless it was those spaces.

Note if you get it edited or pasted in correctly, open Dvd2svcd, close it and look at the ini file you should only now see the one ? mark at the bottom.

If somebody has a copy of the matrx around I sure wish they would give it a try and see if they are getting the same.

Not sure what is going on, there are other scripts at kvcd.net that do not have the spaces. I'll try a movie I just did and see what happens. You would think that if it was a problem then Avisynth would give syntax errors.

DDogg
6th August 2003, 20:34
Yeah, I think I was smoking crack. It is back to normal after I deleted my old working directory. I had made a lot of changes on multiple runs and maybe something got whacked. At least the edits to the script above got rid of a couple of the ? marks and it should be ok to use. Hey guys, this is a case of the blind leading the sighted, sorry. :-/

/edit: One thing I did learn is to MANUALLY dellete all the dsroba files yourself before doing a restart from dvd2svcd.

r6d2
6th August 2003, 20:50
Originally posted by DDogg
My present test encode of the mtrx (NYSC)(trimmed to 186,523 frames via frame selection) is encoding at Q=35 bitrate - 847. Yesterday, it was Q-53 and bitrate-710 so I don't know what the hell is going on unless it was those spaces.

Just tested the same movie again, with all the spaces in place... Absolutely no difference in the D2Sroba log file...

I keep getting Q=63, exactly the same BR (and even byte sample sizes) in all tries, as with your original script.

It's been reported also in www.kvcd.net that this "glitch in DVD2SVCD" is harmless to AviSynth...

So I guess we should conclude that... spaces compress very well! :D

Are you sure you did not change any other parameters?

(Edit: crack smoking makes you type faster :D))

DDogg
6th August 2003, 21:43
Current ("TheMtrxfirstone")

Changed semi-auto to a more neutral bicubic of .0,.50
186,620 frames. Duration = 2:09:35:20 Q=49 Bitrate=713

BTW, if Q > 55-60 then I would not bother completing it. Maybe trim some credits off, use a more neutral resizer. Or you could exchange stmedian for Deen() in the script. That may buy you some Q, but it may be too much.

homerjay
6th August 2003, 21:43
Originally posted by r6d2
What are the parameters names? They don't appear on my INI file.


hi r6d2 i was referring worst_q= is that not what that is ?

r6d2
6th August 2003, 22:11
Originally posted by homerjay
hi r6d2 i was referring worst_q= is that not what that is ?
Nope, that's the Worst Q :), i.e., the worst quality you want (same on the GUI), not the limit of the binary search.
Originally posted by DDogg
BTW, if Q > 55-60 then I would not bother completing it.

Agree with you.

Maybe trim some credits off, use a more neutral resizer. Or you could exchange stmedian for Deen() in the script. That may buy you some Q, but it may be too much.

Deen() buys tipically 10% BR saving in my tests. UnDot() buys 3%.

I mostly go with Bilinear with SemiAutoCropAndResize, because it is resizing in one dimension only and does a pretty good job about 20% faster. Also saves 3-4% BR.

You can also go for CVD. Aliasing is much less noticeable with heavy filtering like this. And buys about 20% BR.

Holomatrix
7th August 2003, 00:48
Originally posted by DDogg
Yeah, I think I was smoking crack. It is back to normal after I deleted my old working directory. I had made a lot of changes on multiple runs and maybe something got whacked. At least the edits to the script above got rid of a couple of the ? marks and it should be ok to use. Hey guys, this is a case of the blind leading the sighted, sorry. :-/

/edit: One thing I did learn is to MANUALLY dellete all the dsroba files yourself before doing a restart from dvd2svcd.

:) email me some would ya :)

fastchef
7th August 2003, 01:39
hey guys, great idea for a dvd2svcd addon thanks. i ran 2 tests, the first with ddogg's stmedian and the second with deen.

movie length: 01:40:46 (144982 frames, 23.976 fps)
first test: cds=1 Q=29 bitrate=950
second test: cds=1 Q=16 bitrate=924


i was wondering if i could use msharpen instead of asharp in the script and how would i go about configuring the ini file to accomidate the change?

Holomatrix
7th August 2003, 04:18
I'll try Deen() again and see if I get a Q drop. To replace asharp, just do it the same way you did with Stmed. Replace the first Asharp(1,4) with MSharpen(Strength=75) or whatever. Make sure you download the 2.5 version of MSharpen and put it in your plugin directory. Leave the asharp in the MAF section because I don't know what would happen if you change it there to.

telemike
7th August 2003, 13:41
[AVISYNTH_Adaptative Filter]
0=ConvertoYV12()
1=nf=0
2=GripCrop(^TargetWidth, ^TargetHeight+^BorderTop+^BorderBottom, overscan=^overscan, source_anamorphic=^source_ana, dest_anamorphic=^dest_ana)
3=GripSize(resizer="BiLinearResize")
4=Undot()
5=Asharp(1, 4)
6=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
7=MergeChroma(blur(^blur_chroma))
8=MergeLuma(blur(^blur_luma))
9=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
10=ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf >= SwitchThreshold ? unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))) : TemporalCleaner(6+nf,11+nf) ")
11=GripBorders()
12=function fmin(int f1, int f2) { return (f1<f2) ? f1 : f2 }
^overscan=1
^source_ana=true
^dest_ana=false
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.58
^blur_luma=0.1



http://www.nic.fi/~lhahne/GripFit_YV12.zip

edit: added script below:

[AVISYNTH_maf_BilinearResize]
0=ConvertoYV12()
1=nf=0
2=BilinearResize(^TargetWidth,^TargetHeight)
3=Undot()
4=Asharp(1, 4)
5=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
6=MergeChroma(blur(^blur_chroma))
7=MergeLuma(blur(^blur_luma))
8=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
9=ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf >= SwitchThreshold ? unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))) : TemporalCleaner(6+nf,11+nf) ")
10=AddBorders(0,^BorderTop,0,^BorderBottom)
11=function fmin(int f1, int f2) { return (f1<f2) ? f1 : f2 }
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.58
^blur_luma=0.1

Holomatrix
7th August 2003, 14:04
That script works well too but were using SemiAutoCrip instead of Grip. In the MAF section some would say TemporalCleaner looks better some would say TemporalSoften looks better. Why did you post that script?

telemike
7th August 2003, 14:08
I am planning on testing that one with CCE 2.50. I would also prefer to use Gripfit instead so this is an alternative. I will post results tommorow hopefully.

Have you patched DVD2SVCD to do YV12 instead of YUY2? There is talk about that over at www.kvcd.net

DDogg
7th August 2003, 14:09
@fastchef - remarkably low Q for that length of encode. Can you tell us exactly what version of mpeg2dec
you are using and your IDCT setting if you are using one? It turns out IDCT=7 is giving me better compression
than 6 using mpeg2dec version 10 on my OC'ed XP-1700 (183x12 2.2 ghz). Oh, and fastchef, for the record,
none of this stuff is ours. All of this stuff is from Kwag's KVCD.net and all credit goes to him and
that group. I brought it up here because much of Kwag's stuff is XVCD and I only wanted to concentrate on the
dvd2svcd angle.

@telemike - Originally I got a strange overlay exception error when I tried the adaptive last week. Finally got
it working yesterday and it lowered my Q considerably.
It turned out to be the spaces which I see you corrected.

I wonder if it is because it is cropping differently from the Semi-Auto, or if it is just a better use
of the filters. I would be much more comfortable using semi-auto, but it is giving me about 10 points
higher Q. Maybe it is just this one particular encode I am working on.

/Add: this is the variant that is working for me with avisynth 2.52:

[AVISYNTH_Adaptative Filter]
0=nf=0
1=GripCrop(^TargetWidth, ^TargetHeight+^BorderTop+^BorderBottom, overscan=^overscan, source_anamorphic=^source_ana, dest_anamorphic=^dest_ana)
2=GripSize(resizer="BiCubicResize")
3=Undot()
4=Asharp(1, 4)
5=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
6=MergeChroma(blur(^blur_chroma))
7=MergeLuma(blur(^blur_luma))
8=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
9=ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf >= SwitchThreshold ? unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))) : TemporalCleaner(6+nf,11+nf) ")
10=GripBorders()
11=function fmin(int f1, int f2) { return (f1<f2) ? f1 : f2 }
^overscan=1
^source_ana=true
^dest_ana=false
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.58
^blur_luma=0.1

Holomatrix
7th August 2003, 14:15
@ Telemike - You don't need to put 0=ConvertoTOYV12() at the beginning of your script. It's working YV12 anyway.

telemike
7th August 2003, 14:22
Hmmm.. Maybe it's to do with Divx AVI conversions?

Here's the thread: http://www.kvcd.net/forum/viewtopic.php?t=5499

homerjay
7th August 2003, 15:43
@holomatrix - ive had to do the 0=ConvertoTOYV12() in my testing too

@fastchef - will catch up with you later to discuss this in more depth ;)

fastchef
7th August 2003, 16:31
@ddogg - i used mpeg2dec3 v. 1.10, default idct no modifier there. props to the Kwag then :)

@homerjay - ;)

jorel
7th August 2003, 16:40
@ DDogg
:)

Little fix in the script:
as SwitchThreshold can be egual to 4 and the limits for
temporalcleaner parameters are (10,15), the correct line is :

TemporalCleaner(6+nf,11+nf)

!

Holomatrix
7th August 2003, 17:16
Originally posted by homerjay
@holomatrix - ive had to do the 0=ConvertoTOYV12() in my testing too

@fastchef - will catch up with you later to discuss this in more depth ;)

For AVI2SVCD conversions ?

homerjay
7th August 2003, 17:20
no pal dvd's using cce 2.67 and avisynth 2.5x

Holomatrix
7th August 2003, 17:26
@homerjay - What would happen if you didn't add that line at the begining?

@ddogg + Jorel - with this other AF script what are we trying to accomplish here, a higher degree of compression or quality?

r6d2
7th August 2003, 17:31
Originally posted by DDogg
Oh, and fastchef, for the record, none of this stuff is ours. All of this stuff is from Kwag's KVCD.net and all credit goes to him and
that group. I brought it up here because much of Kwag's stuff is XVCD and I only wanted to concentrate on the
dvd2svcd angle.

I was just going to point that out. Some sites have ripped Kwag's technology without any warning or permission whatsoever, and he is very pissed off (whith reason, IMO). So he made this final statement on this matter on Jul. 18:
[Excerpt from Kwag's posting]
So these files should NOT be hosted somewhere else, without their permission. The same applies for the contents on the forums. This applies to scripts being designed and hosted here on this site. If you want to offer the scripts on your site, please place a link to our site. Do not copy & paste the scripts that are hosted here to your site.

Further reading here: http://www.kvcd.net/forum/viewtopic.php?t=5139

After typing this I'm thinking this post itself is an authorized Copy&Paste, but since I'm linking to the source, I hope he won't be upset.

jorel
7th August 2003, 17:44
Originally posted by Holomatrix
@homerjay - What would happen if you didn't add that line at the begining?

@ddogg + Jorel - with this other AF script what are we trying to accomplish here, a higher degree of compression or quality?

in my results i got good compression in the final size,
really small size,and the quality is a little better,
...seems more "clean"!
my dvd source is one musical and have lots of "smokes" in the show.

better is wait for DDogg, the tester!
:)

telemike
7th August 2003, 18:14
Yes, I give IMMENSE credit to KWAG and the crew from kVCD.net as well as the others here :)

Thanks to y'all here and over yonder at www.kvcd.net, I am making really good SVCD's with 1-pass CCE!
:D

Holomatrix
7th August 2003, 18:32
Originally posted by jorel
@ DDogg
:)

Little fix in the script:
as SwitchThreshold can be egual to 4 and the limits for
temporalcleaner parameters are (10,15), the correct line is :

TemporalCleaner(6+nf,11+nf)

!

Do you mean change the end 2 to a 4?
8=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 4

jorel
7th August 2003, 22:02
Originally posted by Holomatrix
Do you mean change the end 2 to a 4?
8=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 4

no ,i wrote "can be" egual to 4 or less:
SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
means
if width is <=352 will chosed 4,if width is <=480 will choosed 3
the switchthreshold "auto choose" the values.
then use
TemporalCleaner(6+nf,11+nf),remember the "limits" of the filter.

ahhh.....sorry my poor english!
:o

homerjay
7th August 2003, 22:28
Originally posted by Holomatrix
@homerjay - What would happen if you didn't add that line at the begining?


colours were messed up:confused:

Holomatrix
7th August 2003, 22:50
Oh, that's right, I forgot that those Divx codex's installed screwed things up for me. I did an encode and the people were blue :) I just added SwapUV() and all was fine. I don't do AVI anymore so haven't had that problem.

DDogg
7th August 2003, 22:57
Jorel, so I THINK :) you are just saying, Change TemporalCleaner(6+nf,13+nf) to TemporalCleaner(6+nf,11+nf). Is that all? If not, please post the corrected line as a CODE segment - bracket CODE bracket then end with bracket /CODE bracket.

The reason I even brought up the second script was because it seemed to give better compression than the semi-auto-MAF and thought others might like to test that. I personally will probably settle in on the Semi-auto MAF because I do not really want to deal with setting anamorphic true or false and all that BS.

However, that being said, compression is the name of the game when doing 90-120 minutes on one piss-ant 80 min cdr. Same goes for IDCT factor - If IDCT 7 is slower but gives better compression, then it is what I would use. My new machine is fast enough not to notice much anyway.

Speed and compression are nearly mutually exclusive. BUT, that being said, if Tylo's plugin AND these MAF scripts can give us an accurate and fast 1pass vbr 1 cd encode using CCE on a 90-120 min source...well then you kinda get the best of both worlds.

Actually the real reason I brought this stuff up was because I was bored and wanted to hear myself expound :p

jorel
7th August 2003, 23:43
Originally posted by DDogg
Jorel, so I THINK :) you are just saying, Change TemporalCleaner(6+nf,13+nf) to TemporalCleaner(6+nf,11+nf). Is that all? If not, please post the corrected line as a CODE segment - bracket CODE bracket then end with bracket /CODE bracket.

The reason I even brought up the second script was because it seemed to give better compression than the semi-auto-MAF and thought others might like to test that. I personally will probably settle in on the Semi-auto MAF because I do not really want to deal with setting anamorphic true or false and all that BS.

However, that being said, compression is the name of the game when doing 90-120 minutes on one piss-ant 80 min cdr. Same goes for IDCT factor - If IDCT 7 is slower but gives better compression, then it is what I would use. My new machine is fast enough not to notice much anyway.

Speed and compression are nearly mutually exclusive. BUT, that being said, if Tylo's plugin AND these MAF scripts can give us an accurate and fast 1pass vbr 1 cd encode using CCE on a 90-120 min source...well then you kinda get the best of both worlds.

Actually the real reason I brought this stuff up was because I was bored and wanted to hear myself expound :p

i had to quote your post for evident reasons.
see that i wrote that my english is horrible in my last post.

see the "full" line changed:
9=ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf >= SwitchThreshold ? unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))) : TemporalCleaner(6+nf,11+nf) ")
from your post: "Last edited by DDogg on 7th August 2003 at 19:39"
like i wrote before!

only this my friend,cos it give clean results and short final size!
:)
best regards.

DDogg
7th August 2003, 23:49
Thanks, Jorel. The above is edited as you suggested.

telemike
8th August 2003, 00:02
Couldn't get motion filtering to work with CCE 2.50 :(

I did get this script to work:


[AVISYNTH_STM_BilinearResize]
0=BilinearResize(^TargetWidth,^TargetHeight)
1=Undot()
2=Asharp(1, 4)
3=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
4=TemporalCleaner(6,11)
5=MergeChroma(blur(^blur_chroma))
6=MergeLuma(blur(^blur_luma))
7=AddBorders(0,^BorderTop,0,^BorderBottom)
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.50
^blur_luma=0.1


Any suggestions?

Holomatrix
8th August 2003, 00:31
Originally posted by telemike
Couldn't get motion filtering to work with CCE 2.50 :(

I did get this script to work:


[AVISYNTH_STM_BilinearResize]
0=BilinearResize(^TargetWidth,^TargetHeight)
1=Undot()
2=Asharp(1, 4)
3=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
4=TemporalCleaner(6,11)
5=MergeChroma(blur(^blur_chroma))
6=MergeLuma(blur(^blur_luma))
7=AddBorders(0,^BorderTop,0,^BorderBottom)
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.50
^blur_luma=0.1


Any suggestions?

Upgrade your CCE version :)

DDogg
8th August 2003, 04:55
Telemike, I checked 2.5 and it is working for me with the adaptive script above. When you say "Couldn't get motion filtering to work with CCE 2.50", what exactly do you mean? What happened?

r6d2
8th August 2003, 05:31
DDogg,

I cannot tell you how much I appreciate you were bored. This CCE+SemiAutoCropAndResize+MAF (spaces arguably important), has me really surprised.

Just encoded Solaris (the movie, not the Sun Microsystems Operating System :)), and I got the following:

CVD, Q=6
SVCD, Q=12

Both length=01:32:46 (credits cutted), Video BR=1073, Audio BR=96, only ¡1 CD!

Just unbelievable! And in terms of quality they compete hand to hand to Kwag's 1 CD TMPGEnc encodes (which I barely got to reproduce, anyway)!

I cannot think of the bunch of 2 and 3 CD encodes I have on my library... What a waste of CDs and storage space!

Kudos to you, man, and remain bored, please.

tylo
8th August 2003, 08:41
Now, where the hell IS Bach when you need him? :-/
Now, who needs Bach when you have DDogg? :D

jorel
8th August 2003, 09:24
Originally posted by tylo
Now, who needs Bach when you have DDogg? :D
:p

ha,ha,ha...
yeah,who?!?!?
hey DDogg,
stay "bored" and smoke some "crack" too.
(only kidding,you know,...i can't resist)
;)

@ r6d2
a long time i try to show that i got the
same results like you posted here my friend!

:)

kwag
8th August 2003, 09:59
Just unbelievable! And in terms of quality they compete hand to hand to Kwag's 1 CD TMPGEnc encodes (which I barely got to reproduce, anyway)!

I assume you are comparing MPEG-2, right ?
Because I am aware that CCE's MPEG-2 quality is better than TMPEG's MPEG-2 quality (at bitrates > 2,500Kbps). But quality wise, TMPEG's MPEG-1 is still not matched by any present encoder!
So on MPEG-1, there's still no encoder that can match TMPEG on low bitrates!
And TMPEG's MPEG-1 quality IS better that CCE's MPEG-2 quality at low bitrates. And that IS an industry fact ;)
Just a note ;)

-kwag

dvd2svcd
8th August 2003, 10:23
@Kwag: You know better than making posts like that. It's bound to start a flame on what's best and that is _not_ needed in this thread. Any further "this or that is best" in this thread will be deleted or edited by me! And if you'd show some good faith I'd prefer you to edit your post.

telemike
8th August 2003, 11:05
@ddog: I got Kwag's Adaptive Script to work! :D I must have scripted mine wrong.

In my test I noticed a HUGE compression increase over a non-filtered encode. Wow.


[AVISYNTH_Adaptative Filter_Anamorphic]
0=nf=0
1=GripCrop(^TargetWidth, ^TargetHeight+^BorderTop+^BorderBottom, overscan=^overscan, source_anamorphic=^source_ana, dest_anamorphic=^dest_ana)
2=GripSize(resizer="BiCubicResize")
3=Undot()
4=Asharp(1, 4)
5=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
6=MergeChroma(blur(^blur_chroma))
7=MergeLuma(blur(^blur_luma))
8=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
9=ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf >= SwitchThreshold ? unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))) : TemporalCleaner(6+nf,11+nf) ")
10=GripBorders()
11=function fmin(int f1, int f2) { return (f1<f2) ? f1 : f2 }
^overscan=1
^source_ana=true
^dest_ana=false
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.58
^blur_luma=0.1
?=

r6d2
8th August 2003, 14:14
Originally posted by kwag
I assume you are comparing MPEG-2, right ?

Hi Kwag, I'm so glad you pay this forum a visit. Yes, I'm talking about MPEG-2. Unfortunately, I've not ben able to successfully mux MPEG-1 with DVD2SVCD, but I have done some attempts to use MAF with DVD2SVCD and TMPGEnc using MPEG-2 (as you suggested on a thread for DVD2SVCD), but I ended up with terrible quantization, above 10 in most of the movie.

I have seen screenshots in your forum to support your "industry fact" statement :), and I really admire your encodes, but I have found it difficult to match the quality you get, even starting from scratch and going by the book.

I invite you to try this MAF script with CCE+MPEG-2. You may be surprised.

Holomatrix
8th August 2003, 14:32
Originally posted by r6d2

I invite you to try this MAF script with CCE+MPEG-2. You may be surprised.

I think by asking KWAG to try CCE would be going against his Religion :) hehe

r6d2
8th August 2003, 14:47
Originally posted by DDogg
Now, where the hell IS Bach when you need
him? :-/

Seems that Bach found a new place to install his tent...

http://forum.doom9.org/showthread.php?s=&postid=355500#post355500

jorel
8th August 2003, 14:55
Originally posted by Holomatrix
I think by asking KWAG to try CCE would be going against his Religion :) hehe

this is not the case holomatrix!
the real reason is the quality of the results
with mpeg1 using MAX bitrate 2500 in tmpgenc.
you got fantastic quality in one cd with very long time source.

i ever use dvd2svcd with tmpgenc encoder to got my kvcds mpeg1
320x240 or 352x480 and the reults.....you know!
great progs,great scripts.....great results.
:)

DDogg
8th August 2003, 15:12
Hey, no hassles guys. Tmpg is great as well as the great sleeper, Procoder. I love Kwag's strong opinions as that drives a passionate search for quality as he has long demonstrated (and frankly did not get all the respect he deserved for it).

But, because of those strong opinions, I wanted to concentrate on giving dvd2svcd, CCE and one pass vbr a shot as these are a very fast method to produce a more or less standard svcd. This is very on topic for this forum whereas non standard xvcds are definitely not.

Also, I would greatly appreciate hearing Kwag's opinions on low bitrate encodes using ProCoder, both mpeg1 and mpeg2. Kwag, have you tried Procoder? I have a feeling it might make you take a second look.

jorel
8th August 2003, 15:54
of course DDogg,
no need preocupations.
;)

telemike is my friend here and in other forum too!
Kwag post lots of goods in kvcd forum about d2s too.
he is developing one good program called CQMatic
and have intentions to use CCE too.

the intention is good results and friendship.
i got more from friendship cos
all my results came from you all,not came from my own knowledge.
this is the idea.
problems....never.

:)

ps:
see how i'm "expert"...look my avatar!
:p

DDogg
8th August 2003, 16:20
@ telemike, something I did notice that may be interesting to you. I was using cce 2.67.00.11 for most of all my tests and I got to know Tylo's Q32 first pass bitrate yield pretty well (in my sleep).

When I tried 2.50 I noticed the first pass as about 200 higher. I only did it once so maybe it was a glitch, but that would tend to indicate 2.50 would not be as efficient as the later versions. Just a FYI for you to take a look at.

@r6d2Just encoded Solaris (the movie, not the Sun Microsystems Operating System ), and I got the following ...That is an incredible result! However, as we all know it depends on the source. I am trying to do the usuual sspxts which is 4:3 and having hell getting anything under 60. These are the encodes that I would guess would benefit by that second or third pass. I am just not up to speed on that and my eyes are giving me a lot of problems so catching up and reading 50 page threads are difficult.

Holomatrix
8th August 2003, 16:36
Originally posted by DDogg

@r6d2That is an incredible result! However, as we all know it depends on the source. I am trying to do the usuual sspxts which is 4:3 and having hell getting anything under 60. These are the encodes that I would guess would benefit by that second or third pass.
I second that, because I am trying to get the movie 'Phonebooth' below a Q of 63 with is only 80 min which I know would give me better results by doing a multi-pass encode instead. I just don't get why D2Sroba would pick a high Q on such a short movie.

DDogg
8th August 2003, 17:01
Holo, I know you do know damn well why that is :p:) All Tylo is doing is measuring the size of the pass. The size of the pass is based upon compressibility of a given source.

Take "the mtrx" for example. Green and dark 16:9, it compresses well so a pass is smaller. Take the favorite ball-buster SPR, damn near impossible to compress properly because of all the grain, fast jerky pans and water and high action shots. Pass is much bigger because of that. Tylo has to keep increasing the Q to hit the project bitrate he needs for sizing. I think I said that right :)

BTW, SPR might well be an excellent test subject for MAF.

Holomatrix
8th August 2003, 17:20
Originally posted by DDogg
Holo, I know you do know damn well why that is :p:) All Tylo is doing is measuring the size of the pass. The size of the pass is based upon compressibility of a given source.

:) Yes that I know, I don't think I type everything I mean to say, I had a discussion a little while back which I can't remember right now (memory is going weary) about what I thought the '?' in D2Sroba meant, I was under the impression that the '?' in amount of CD's would allow me, or D2Sroba tell me that "I have determined that your movie will fit on 1 CD at a Q of 63 or 2 CD's at a Q of 50, What do you want to choose?" then encode at that, or automatically pick 2 CD's if the determined Q is higher that your picked worst Q. If determined Q is worse than my worst Q then I wouldn't mind D2Sroba automatically doing more passes to determine the Q for 2 CD's. Does that make sense? :)

Crackhead
8th August 2003, 17:23
@holo and ddogg
got the same problem with Tomb Raider(88mins) and The Crimson Rivers(90mins)[cutted the credits of both movies] , D2SRoba won't go under a Q of 63!

The results of Tomb Raider weren't so bad, a lot artifacts around the faces, but not noticeable on TV.
Didn't finish The Crimson Rivers cause of the high Q.:mad:

I will do some more tests this week, but i think i won't get a q of 12 like r6d2 got:angry: :o

Greetz, Crackhead

r6d2
8th August 2003, 17:57
Originally posted by Holomatrix
I had a discussion a little while back which I can't remember right now (memory is going weary) about what I thought the '?' in D2Sroba meant,

I would not call it a discussion, just a conversation, and it is on the old thread. Anyway, what I tried to tell you then, and I quote myself here :), is:
Originally posted by r6d2
In "?" mode, it will let you choose only if two Qs will satisfy your requirent. If only one does, it won't ask and just proceed.

Originally posted by Holomatrix
If determined Q is worse than my worst Q then I wouldn't mind D2Sroba automatically doing more passes to determine the Q for 2 CD's. Does that make sense? :)
It makes a lot of sense, this is known as range mode: 1-2, 2-3, even 1-4.

Anyway, the "Really Worst Q" factor will eliminate all this hassle, if you're really going for quality. BR, even if it is low, is a result of the Q you set, not otherwise. I don't know if I'm being clear enough on this new parameter concept. If anyone has a question please welcome.

Holomatrix
8th August 2003, 18:26
I think I'm getting it now :) My brain doesn’t work like a sponge to much anymore, I think sometimes like a wall :) Thanks

kwag
8th August 2003, 19:04
Deleted! You were warned!

dvd2svcd
8th August 2003, 22:18
@Kwag: Next time I will strike you. I will not have your strong opinions start a flamewar! I have always been fair to you, so be fair to me too.

r6d2
8th August 2003, 23:41
Originally posted by Holomatrix
I am trying to get the movie 'Phonebooth' below a Q of 63 with is only 80 min which I know would give me better results by doing a multi-pass encode instead.
Beware: Multipass (2 pass, for instance) will not give you signifficantly better quality than OPV if you still confine the movie to 1 CD. Neither n-pass would.

Multipass will spread a little better the scarce BR available, but that's it. On 1 CD rips there's no much BR to spare.

So you may say, "I'll go for multipass 2 CDs then", to which a good answer would be: go for OPV, 2 CDs. Half the time, comparable quality.

r6d2
9th August 2003, 18:28
Originally posted by r6d2
Just encoded Solaris [...] and I got the following:

CVD, Q=6
SVCD, Q=12

Both length=01:32:46 (credits cutted), Video BR=1073, Audio BR=96, only ¡1 CD!

Just unbelievable!

Guys, I have terrible news for us all. You know, when something is incredible, unbelievable, wonderful, and all those spectacular first impressions you get, I always keep on thinking on it for a while. And most of the time I find out that too good to be true stuff is really too good to be true, if you know what I mean :)

So I did some more checking. I tried the movie above without any filtering, and with the simple, quicker and worthy UnDot()+Deen() companion. Here are my findings. The columns are sorted by descending Q.

Movie: Solaris
Length: 1:32:46 (133468 frames, 23.976 fps)
(no credits)
Audio BR 96 kbps Stereo
Target size 1 CD
Target MPV size 713 MB
Target Video BR 1.073 kbps
D2Sroba Default values

Setup Resolution_________________ SVCD SVCD SVCD CVD
Determined Q_______________ 14 12 10 6
Estimated Video BR_________ 1.123 1.073 1.092 1.071
Filters SemiAutoCrop & Resize______ Yes Yes Yes Yes
MAF________________________ No Yes No Yes
UnDot()+Deen()_____________ No No Yes No
Results Actual MPV size [MB]_______ 726 704 719 700
Encode Duration____________ 1:03 2:45 2:09 2:04
Target Size/Actual Size____ 98% 101% 99% 102%
CCE Speed__________________ 1,47 0,56 0,72 0,75

First of all I must say that the quality of all encodes is great. Even the unfiltered one. Let's see some conclusions:


MAF takes 1.3 times more than UnDot()+Deen(), and does not reduce Q as much.

In MAF, by its adaptative nature, actual sizes end up being lower than target sizes (you will not overflow), but error is bigger.

The use of UnDot()+Deen(), since not adaptative, predicts better. It cleans and homogeinizes the whole source in the same way, and probably more than MAF, so it allows to predict more precisely. It seems to overflow a little, though.

When you have a very clean and compressible movie with a low Q, not doing any filtering will save you a lot of time!

The incredible low BR of this Solaris encode does not yield on the MAF script, but on the compressibility of the movie (dark and green, and 16:9, same as DDogg's "the mtrx"). (So, what else is new :))


I'm certain this is a one movie only test, but at least clears up the "less that wonderful" results after all.

Things like this remind me of people still trying to build perpetual motion machines, turning lead into gold and stuff like that :)

The bottom line is, IMHO, MAF is great, but not much greater than simple known already filtering, and the most important thing is it will not do any magic, nor is the panacea to 1 CD rips. Just compresses the source a bit, and takes a lot of time. :)

DDogg
9th August 2003, 20:14
Ain't that just some doody in your oatmeal! :mad:

Just dropped my Q by 10 points using my standard deen(), undot() and undot() again after the import line of Gert's semi-auto over using semi-auto with MAF. Well, at least I know this encode like the back of my hand so I can do a good compare when I screen it.

kwag
9th August 2003, 21:19
The bottom line is, IHMO, MAF is great, but not much greater than simple known already filtering, and the most important thing is it will not do any magic, nor is the panacea to 1 CD rips. Just compresses the source a bit, and takes a lot of time. :)
That's not the case if you are encoding a very high action film. That's where the MA script will really shine, and reduce your file size considerably.
I do agree that if you are encoding a slow action film, some parts of the MA script are really not necessary. Like the "blurring" part. You will still benefit from the "Temporal" MA section of the filter, as it will help clean up very low action parts of the movie. But I would still use undot and a very low temporal filter statically on all frames, to reduce noise spots :)
It's really up to anyone to "Plug-in" whatever filter they want to make adaptive. The framework is already there, provided by AviSynth, so it doesn't necessarily mean it has to be a fixed Temporal/Blurr MA filter. The limit is the imagination ;)

-kwag

r6d2
9th August 2003, 21:43
Hi, Kwag, and welcome back to the forum :)

Word of mouth is you're doing some testing with CCE and DVD2SVCD. Did you try the MAF+CCE stuff?

Originally posted by kwag
That's not the case if you are encoding a very high action film. That's where the MA script will really shine, and reduce your file size considerably.

I'll try it with the Back to the Future Trilogy, guess it qualifies as a high action movie. Does it, according to your experience?

kwag
9th August 2003, 21:51
Originally posted by r6d2
Did you try the MAF+CCE stuff? No, but because of the nature of the MA design, it shouldn't make any difference no matter what encoder you use.


I'll try it with the Back to the Future Trilogy, guess it qualifies as a high action movie. Does it, according to your experience?
Sure it does! But a better test would be something like "Black Hawk Down" or something similar. That's where you'll see the real file size drop :)

-kwag

r6d2
9th August 2003, 22:21
Originally posted by kwag
[B]No, but because of the nature of the MA design, it shouldn't make any difference no matter what encoder you use.
Oh, my... I never though I'd hear you to say that! :D:D:D

If I only could get MPEG-1 working with TMGPEnc and DVD2SVCD to take advantage on the good low BR MPEG-1 encodes you do...

DDogg
9th August 2003, 23:54
Yep, my test encode using just standard semi-auto with undot(), deen() and undot() again after the import line was as good or better than the semi-auto w/MAF I did yesterday. Source 147 mins progressive NTSC, Bitrate was 907, Q for 1st run was 48 with bias 10.
480x480 4:3 full screen. Encoding method used was 1 pass Roba which is 2 passes total.

r6d2
10th August 2003, 00:18
Originally posted by r6d2
I'll try it with the Back to the Future Trilogy
I guess it's going to be Back to 2 Discs Trilogy... :(

SemiAutoCrop, standard: Q=63 (not by hard limit, but by actual BR)
MAF: Q=62
MAF modified with Deen() instead of STMEdian: Q=58

IMHO, all encodes suck, even on 100% visual you can see the artifacts.

I'd try SemiAuto standard with UnDot()+Deen()+UnDot() as per DDogg's suggestion, but I decided to go 2 discs anyway and put in a second audio track.

(@Kwag, I guess it was not a high action movie after all. Maybe we can ask Zemeckis to incorporate more action on a future remake to get it on 1 CD :D)

Holomatrix
10th August 2003, 01:24
Originally posted by DDogg
Yep, my test encode using just standard semi-auto with undot(), deen() and undot() again after the import line was as good or better than the semi-auto w/MAF I did yesterday. Source 147 mins progressive NTSC, Bitrate was 907, Q for 1st run was 48 with bias 10.
480x480 4:3 full screen. Encoding method used was 1 pass Roba which is 2 passes total.

So are you doing this? ;

Undot()
Deen()
Import Semi ...
Undot()

for me file size was only a bit smaller.
Tested a chapter at 50 Q bias 14 with SemiMAF =20,065 meg, Semi Un+Deen+un =20,040 meg

telemike
10th August 2003, 18:24
I just did Daredevil. 480x480 SVCD. DVD2SVCd with MAF script. CCE speed = .650 D2Sroba came up with a Q of 38 for a 1 Cd encode.



========================================================
D2SRoBa v2.4.4 - DVD2SVCD plugin, by tylo
OS Version: WIN_XP
--------------------------------------------------------
- DVD2SVCD Shutdown
- 2003-08-10 09:33:49
--------------------------------------------------------
Settings:
- CD size : 800
- Number of CD's : auto
- Worst Q. factor : 40
+ One pass VBR Robshot/Bach : 1
- Sample percentage : 2.0
- Sample GOPs : 1
- Adjust Q. : 0.8
- Safety Zone : 34
+ Do credits bitrate tweak : 0
- Start time : 0:00:00
- Bitrate : 1000
--------------------------------------------------------
- Movie length : 01:43:35 (149030 frames, 23.976 fps)
- Audio size est : 124315983. bytes (160 + 0 kbps)
- CD user data size : 833237920. = (800 - 5)*1024*1024 - 380000
- SelectRangeEvery : every 750, select 15 frames
- Num. sample frames : 2985
--------------------------------------------------------
Calculations:
- Estimated mpv size : 666565608. (Q=40, 857 kbps, 13350992 sample sz)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Number of CDs : 1
- Target mpv size : 689790437. (887 kbps)
--------------------------------------------------------
- Binary search for Q:
- Estimated mpv size : 759827533. (Q=32, 977 kbps, 15218984 sample sz)
- Computed mpv size : 713196571. (Q=36, 917 kbps, (Q40+Q32)/2)
- Estimated mpv size : 687524668. (Q=38, 884 kbps, 13770792 sample sz)
- Estimated mpv size : 697181213. (Q=37, 897 kbps, 13964208 sample sz)
--------------------------------------------------------
- Q Weight : (689790437. / 49.9262981574539 - 13770792) / (14284988. - 13770792)
- Adjust Q : (38 + 1.0 - 8.82587379954006e-002 - (0.8)) = 38.1117412620046
- Determined Q. : 38
--------------------------------------------------------
Replace values in ecl file:
- opv_q_factor : 38
- opv_brate_max : 1931 ==> 2530
- vbr_brate_avg : 6000 ==> 887
--------------------------------------------------------
- Encoding Movie
- 2003-08-10 09:54:50
--------------------------------------------------------
- Actual mpv file size:
08/10/2003 12:32 PM 690475136 Encoded_Video_CCE_NTSC.mpv

r6d2
10th August 2003, 18:39
Originally posted by telemike
I just did Daredevil. 480x480 SVCD. DVD2SVCd with MAF script. CCE speed = .650 D2Sroba came up with a Q of 38 for a 1 Cd encode.

Not bad. I think though that 160 for audio is too much for a 1 CD rip. The 10% rule advises to go for 96 in this case, which would give you a 951 BR, likely to be a Q=34 for video.

telemike
10th August 2003, 18:48
I usually use 160k audio for 2-cd encodes and 128k for 1-cd's. Howver, I thought D2sroba was going to do a 2-cd encode since I set 40 as my worst Q.

Crackhead
10th August 2003, 20:10
I do some tests on this topic, too, so can someone post this undot(),Deen(), Semi(),Undot()-Script, cause I'm a total newbie on this.
I wouldn't get it work in 5 years!:angry: :angry:

My first results on this topic is, that it doesn't matter what script or how many cds you take, the human eye won't realize any change!:D :D

The TV-screen is so "bad", I didn't notice the artifacts which are clearly visibel on the PC-screen, and I think noone would!:cool: :D

I'll go for a 1cd encode of every movie 'til I get a DVD writer, the options to get a satisfying 1cd encode are quite good, good enough!

This is just my opinion, so feel free to persuade me of another opinion, but plz with some understandable, no theoretical or technical stuff!:D :D ;)

Greetz, Crackhead

r6d2
10th August 2003, 23:37
Originally posted by Crackhead
The TV-screen is so "bad", I didn't notice the artifacts which are clearly visibel on the PC-screen, and I think noone would!:cool: :D
IMHO you are very close to the absolute truth here, if such a thing exists :D
I'll go for a 1cd encode of every movie 'til I get a DVD writer, the options to get a satisfying 1cd encode are quite good, good enough!
However, why a DVD writer would change your mind then? Your 1CD encodes will continue to look good enough!
This is just my opinion, so feel free to persuade me of another opinion, but plz with some understandable, no theoretical or technical stuff!:D :D ;)
OK, not trying to evangelize here, but my thoughts on the matter are the following (I consider myself just a movie fan and I'd love to hear the experts too in an understandable language):

My next TV will (hopefully) be an HDTV. Its resolution are about 720x1280 (Progressive) and 1080x1920 (Interlaced). That's quite more than double what we have today. My DVD player has a zoom mode (I guess most do). So, when encoding, I do my tests in 2x Zoom mode. If it's not too blurry, my bet is that this encode will look reasonably well on an HDTV.

There are currently players being developed to support this kind of resolutions (as well as DivX! and MPEG-4 in general!)

On sample here:

http://www.keohi.com/keohihdtv/videodevices/momitsuv880/momitsuv880_background.html

As I said, this is my bet. I don't know if it is a good one :)

telemike
11th August 2003, 11:06
I have a 43" HDTV.

SVCD's done at 480x480 look great. CVD at 352x480 looks blocky and jaggy.

I don't use my Terapin VCD recorder anymore since it's CBR1150 VCD @ 352x240 and it it blocky but watchable.

Barker
16th August 2003, 08:00
I just purchased Gangs of New York 2 CD set which has the movie split into 2 discs, which, when I realized this I thought it would be a great test for this (3 cd's would be a pain to make out of 2 different DVD's; ~1:30 a piece). I used this method, and ended up with Q64 (not surprising, because it's over 4 gb's to begin with (one part), and I'm doing 128 main, 96 comments audio as a test). Other movies that I have done without the MAF script (and without 2nd audio) do not look anywhere near as good as this one, even with lower Q values. I'm not sure what is causing this, but if anyone has this movie and is willing to try, please do, and tell me I'm not crazy?

If this is the results I can get with this script, then I will never go back to the original method I was encoding with.

Thanks for all your suggestions, DDogg, and everyone else in this thread!!!

Regards,
Barker

DDogg
16th August 2003, 15:26
Barker, as I am sure you know, it ALL depends on the compressibility of a given source. Some 90 minute sources will look pretty decent, whereas some will not. This is definitely not a one size fits all kind of thing. As mentioned before are the classic examples of "The Mtrx" and "SPRyan". Forgetting the lengths, the first example is material that compresses extremely well, while the second is pure hell and normally requires nearly twice the bitrate for the same section of length (that maybe is slight exaggeration to make the point).

You might want to play around with making a notation of the size of the first Q32 prediction run (D2SRoBa_Q32.mpv) of D2SRoBa on a source you have found to have YOUR minimum acceptable quality on 1 CD for YOUR viewing vehicle. Chances are (not always), if another encode has the same or smaller size for that same prediction pass, it will be ok to at least try to put it on 1 cd (assuming you used the same script and the same settings in CCE). This can save you a lot of useless attempts and wasted time and it takes into consideration both the compressibility AND the length of the source.

Here is an example of my own personal "Compression Index" (I always use the same test script and same test cce settings [Edit: sample size in D2SRoBa for this test was 1%]:

1> "Final Dstination" --- D2SRoBa_Q32.mpv = 8,196KB, Len -- 133341 frames Time 1:32:41 Target mpv size:-(1043 kbps)
2> "The Usual Sspxts" - D2SRoBa_Q32.mpv = 10,380KB, Len - 148070 frames Time 1:42:55 Target mpv size:-(926 kbps)
3> "The Mtrix" -------- D2SRoBa_Q32.mpv = 8,388KB, Len --- 186356 frames Time 2:09:32 Target mpv size:-(709 kbps)


I know from experience that #1 and #3 (barely) on 1 cd is acceptable to me, whereas #2 is not. So, if the D2SRoBa_Q32.mpv is much bigger than 8,300 I normally just go for 2 cds and same myself a lot of aggravation. Note above how the target bitrate is not the indicator of quality!

Barker
16th August 2003, 18:18
So other than the compressibility being bad, there is no other reason why I am getting really low Q factors on a 1:25 length film? And why does it look acceptable at that Q? I've seen Q32's that looked awful, even at higher bitrates.

Thanks for the tip, and the index DDogg.

Regards,
Barker

DDogg
16th August 2003, 19:26
So other than the compressibility being bad, there is no other reason why I am getting really low Q factors on a 1:25 length film? You are not, you are getting a real High Q factor. Was that a typo? I am surprised a Q 64 looks good to you, but I don't know your viewing setup. Also, I don't know the size of the Q32 pass. Would you still have that laying about? If not could you do a Q32 pass and report the size? I would be interested.

It may be that the source is dark and has a directors blur for a soft artistic look which would help a lot in sustaining a higher Q (IMO), or it may be that I am full of beans. Dunno yet. Maybe I can rent a copy to test with to find out more.

Barker
16th August 2003, 19:49
Yes, that was a typo, I meant high Q. Anyhow, the Q32 was 28,843 KB, but I was using a sample size of 3 which when you mentioned your sizes, I assume you were using lower. I actually got a Q 62 on an encode without the MAF, however, without the filters in the script, it seemed a lot blockier (more artifacts). Dunno, I'm new to this MAF method, so I may need to do more tests to get the big picture. It seemed to do the job well on this movie though, I wouldn't have thought I would ever get this on 1 CD.

Regards,
Barker

DDogg
16th August 2003, 19:56
Ah, heck, thanks for the prompt about the sample size. It was 1%. I edited that in on my post.I wouldn't have thought I would ever get this on 1 CD. Me neither :)

[/add] Barker, you may like the result of using the standard SemiAuto script with a few extra filter inserted. Turn on script editing and right before the import line towards the bottom add undot() and Deen() [edit: also add undot() after the import line] like this:

LoadPlugin("C:\PROGRA~1\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("C:\usual\DVD2AV~1.D2V")
DetectedTop=0 DetectedHeight=480
BlocksToCropHorizontal=2 BlocksToCropVertical=2 BlockOptimization=16
ResizeMethod=3 Bicubic_b_Value=0.0 Bicubic_c_Value=0.6
GammaCorrection=1.0 Hue=0 Saturation=1.0 Brightness=5.0 Contrast=1.0
DebugMode=0
DestinationWidth=480
DestinationHeight=480
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SimpleResize.dll")
Undot()#add this
Deen() #and this
Import("C:\Program Files\AviSynth 2.5 plugins\autocrop\SemiAutoCropAndResize.avs")
undot() #add this

Barker
17th August 2003, 16:03
Yeah, the Undot, Deen brought my Q value down to 56, Ill try encoding that, and compare the 2. Thanx for the tip.

Regards,
Barker

DDogg
17th August 2003, 16:45
I would be interested in your comparison. As Kwag and R6D2 discussed, the MAF may work better on hard high action while having the filters in place for all video (as above) may work better for slower paced source. I'm particurlly interested in how you gage the amount of contour noise on flat walls, sky and such.

fastchef
18th August 2003, 02:35
As Kwag and R6D2 discussed, the MAF may work better on hard high action

i'd agree with that 100%, as i encoded a high action movie, xmen and came out with a low Q . i used mpeg2dec version 1.10 lanczos resize
Settings:
- CD size : 800
- Number of CD's : 1
- Worst Q. factor : ---
+ One pass VBR Robshot/Bach : 1
- Sample percentage : 2.5
- Sample GOPs : 1
- Adjust Q. : 0.8
- Safety Zone : 34

- Q Weight : (714988777. / 39.8573705179283 - 17287296) / (18291600. - 17287296)
- Adjust Q : (27 + 1.0 - 0.64859649607761 - (0.8)) = 26.5514035039224
- Determined Q. : 26

Barker
19th August 2003, 00:40
I was suprised to see that undot and deen actually outperformed maf on this movie. It compressed better, had less artifacts (blockyness) and not as much halo effect in the sky compared to the maf script. It was a definate visual difference though(even on a TV screen), and i'm pleased with the outcome of using these 2 filters. I will try to get my hands on a noisier, high motion flick and give maf another shot soon.

Regards,
Barker

Holomatrix
19th August 2003, 12:33
Originally posted by DDogg
Ah, heck, thanks for the prompt about the sample size. It was 1%. I edited that in on my post. Me neither :)

[/add] Barker, you may like the result of using the standard SemiAuto script with a few extra filter inserted. Turn on script editing and right before the import line towards the bottom add undot() and Deen() like this:

LoadPlugin("C:\PROGRA~1\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("C:\usual\DVD2AV~1.D2V")
DetectedTop=0 DetectedHeight=480
BlocksToCropHorizontal=2 BlocksToCropVertical=2 BlockOptimization=16
ResizeMethod=3 Bicubic_b_Value=0.0 Bicubic_c_Value=0.6
GammaCorrection=1.0 Hue=0 Saturation=1.0 Brightness=5.0 Contrast=1.0
DebugMode=0
DestinationWidth=480
DestinationHeight=480
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SimpleResize.dll")
Undot()#add this
Deen() #and this
Import("C:\Program Files\AviSynth 2.5 plugins\autocrop\SemiAutoCropAndResize.avs")

So you've decided to do filtering before resize. Is this a quality or compressibility decision? Would you pull the same stunt with the MAF script?

DDogg
19th August 2003, 13:47
Is this a quality or compressibility decision? Both, in my mind. It is one of those things where, "I have always done it that way". It always made sense to me to apply filters to the source before it had been adulterated although it is certainly slower. My present machine is about equivalent to an XP 3200, so it does not hurt me as much as it would some.

Now that you mention it, when I get some time, I think I'll try filtering before resize in the MAF script. It can't hurt to try.

{/add: I edited in the second undot() after the import line in the script above. I normally do this and forgot to do so when I replied to Barker.)

Holomatrix
19th August 2003, 14:04
What do you do with noise added by the resizer, non-optimal filters and low bitrate encoding? Should we add more filters after resize as well?

DDogg
19th August 2003, 15:00
Frankly, I would ask Kwag and Dialhot's opinions on that as I know they have spent a tremendous amount of time on the subject. Ultimately it may well turn out that the optimum solution is a combination of Pre and Post filtering. Btw, r6d2, suggested an elegant way of setting this up in Gerti's semi-auto thread.

Now as to what those optimum pre and post filters are I haven't a clue yet. It may be that they have to be hand tailored for the individual source. If so, that is not very practical as it is too time consuming, except as an educational exercise in compression art.

DDogg
21st August 2003, 16:58
Advanced users only.

This script template is an odball combination of Gerti's Semi-Auto, HomiE FR's QMF and a few pre-filter settings from
the Kwag crew and a few other things I may have forgotten.

The template works for my 1 cd encodes very well and has dealt with some of my problem encodes and allowed
good quality on 1 cd. No guarantees or exorbitant claims. Try it, hope you like it, if not ...

As an example, on my present project Standard Semi-Auto and D2SRoBa gave me a final Q of 44. This script gave
me a Q31 and excellent video quality. See note below on CCE "flat image priority".

Btw, if you have installed the August 20 test build of Avisynth from CSV please go no further. Something is broken
when it comes to the Semi-Auto scripts or derivatives like this one.

To use this template you will need to get this file:
http://perso.wanadoo.fr/homie.fr/qmf-1.5b1.rar
from this thread:
http://forum.doom9.org/showthread.php?s=&threadid=56051&perpage=30&pagenumber=2

After you extract qmf-1.5b1.avs, you will need to rename it to qmf15b1.avs because of some kind of quirk in D2S. D2S does
not like the filename qmf-1.5b1.avs in a template.
Note that I saved qmf15b1.avs in C:\Program Files\AviSynth 2.5\plugins\QMF\
and I have SemiAutoCropAndResize.avs in C:\Program Files\AviSynth 2.5\plugins\autocrop\.

If you put it somewhere else, please remember to scroll down in the frameserver tab and change the path
to where you put it. While there, double check you have the correct path to SemiAutoCropAndResize.avs. If you get a picture
in the preview (conversion tab) you are good to go so exit D2S after the path changes so they will be changed. If you do not
have it setup correctly you will get a red on black error in preview.

IMO, raise the "flat image priority" to 25-30 in CCE (maybe even 40?). This better deals with
contour lines. I think this filter is already dealing with the mosquito noise pretty well.


[AVISYNTH_SemiAutoCropAndResize with HomiE FR QMF]
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=Undot()
10=STMedianFilter(8, 32, 0, 0 )
11=# LOW MOTION FILTER FUNCTION
12=# -> STRONG TEMPORAL SMOOTHING (USING FLUXSMOOTH)
13=# -> SOFT SPATIAL SMOOTHING (USING UNFILTER)
14=function Low_Motion_Filter(clip c) { c = FluxSmooth(c,14,0) c = UnFilter(c,-10,-10) return c }
15=# MEDIUM MOTION FILTER FUNCTION
16=# -> MEDIUM TEMPORAL SMOOTHING (USING FLUXSMOOTH)
17=# -> MEDIUM SPATIAL SMOOTHING (USING FLUXSMOOTH AND UNFILTER)
18=function Medium_Motion_Filter(clip c) { c = FluxSmooth(c,7,7) c = UnFilter(c,-20,-20) return c }
19=# HIGH MOTION FILTER FUNCTION
20=# -> NO TEMPORAL SMOOTHING
21=# -> STRONG SPATIAL SMOOTHING (USING FLUXSMOOTH AND UNFILTER)
22=function High_Motion_Filter(clip c) { c = FluxSmooth(c,0,14) c = UnFilter(c,-30,-30) return c }
23=# APPLYING ADAPTATIVE SPATIO-TEMPORAL SMOOTHER (USING QMF)
24=QMF()
25=Import(!SemiAutoCropAndResize.avs)
26=undot()
27=Temporalsoften(2,3,3,mode=2,scenechange=6)
^DetectedTop.=6
^DetectedHeight=468
^BlocksToCropHorizontal.=2
^BlocksToCropVertical.=2
^BlockOptimization=16
^ResizeMethod.=2
^b_value.=0.0
^c_value=0.55
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0.0
^Contrast=1.0
^DebugMode=0
!SimpleResize.dll=C:\Program Files\AviSynth 2.5\plugins\SimpleResize.dll
!qmf15b1.avs=C:\Program Files\AviSynth 2.5\plugins\QMF\qmf15b1.avs
!SemiAutoCropAndResize.avs=C:\Program Files\AviSynth 2.5\plugins\autocrop\SemiAutoCropAndResize.avs

Holomatrix
21st August 2003, 17:30
Just a quick note (2 cents), that using Bilinear resize seems to drop Q a few points as well, not sure if by doing so will blur the video to much but does give smaller file sizes. :)

DDogg
21st August 2003, 18:56
Yeah, I know, but I personally don't like the softer look it gives. It is almost fuzzy to me. Maybe for really worst case I would use it. People ought to try it to see if it fits their tastes. I noticed r6D2 has said he likes it.

Reader reference:
You would change it by setting ResizeMethod to 1 in the scrolling box in the Frameserver Tab.

ResizeMethod:
1 = Use BilinearResize
2 = Use BicubicResize with Bicubic_b_Value and Bicubic_c_Value
3 = Use LanczosResize
4 = Use SimpleResize

Anything but 2 disregards the Bicubic_b_Value and Bicubic_c_Value

r6d2
21st August 2003, 19:58
Originally posted by DDogg
[B]Yeah, I know, but I personally don't like the softer look it gives. It is almost fuzzy to me.
I really envy your eyes. I cannot tell the quality difference. Abiding KISS, just UnDot() and Deen() before Bilinear resize keeps my 1 CD encodings within reasonable time and quality limits.

How about speed with this one? About the same as MAF?

Holomatrix
21st August 2003, 20:16
seems to drop my speed about .32 CCE points :(

r6d2
21st August 2003, 20:44
Originally posted by Holomatrix
seems to drop my speed about .32 CCE points :(
From what value (unfiltered source)?

Holomatrix
21st August 2003, 21:25
I was just compairing the SemiAuto+MAF script (.66) to this SemiAuto+QMF script (.34)

DDogg
21st August 2003, 21:44
I get about 1.0 real time with this script on a 4:3. But I have a hopped up XP 1700 T-BRED-B JIUHB 0312 running a close equivalent to a XP 3200 (183x12)(not bad for a 48 dollar chip!) Eeek! Now I realize why you don't want an extra pass.

fastchef
22nd August 2003, 06:25
i've played a bit with HomiE FR's QMF on my athlonxp 2100, but doing 3 or 4 passes was a bit much(time factor and cpu usage)
so i'm definately up for a test of this QMF using the D2SRoBa plugin :)

DDogg
22nd August 2003, 14:12
fastchef, let us know what you find. I may be full of beans yet again, but it seems to work well for me.

fastchef
22nd August 2003, 15:41
it worked very well, looks good to my eye and low Q of 20. again, used mpeg2dec version 1.10

========================================================
D2SRoBa v2.4.4 - DVD2SVCD plugin, by tylo
OS Version: WIN_XP
--------------------------------------------------------
- DVD2SVCD Shutdown
- 2003-08-21 22:37:40
--------------------------------------------------------
Settings:
- CD size : 800
- Number of CD's : 1
- Worst Q. factor : ---
+ One pass VBR Robshot/Bach : 1
- Sample percentage : 2.5
- Sample GOPs : 1
- Adjust Q. : 0.8
- Safety Zone : 34
+ Do credits bitrate tweak : 0
- Start time : 0:00:00
- Bitrate : 1000
--------------------------------------------------------
- Movie length : 01:37:12 (139848 frames, 23.976 fps)
- Audio size est : 93325326. bytes (128 + 0 kbps)
- CD user data size : 834286496. = (800 - 4)*1024*1024 - 380000
- SelectRangeEvery : every 600, select 15 frames
- Num. sample frames : 3510
--------------------------------------------------------
Calculations:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Number of CDs : 1
- Target mpv size : 721805594. (989 kbps)
--------------------------------------------------------
- Binary search for Q:
- Estimated mpv size : 543591965. (Q=32, 745 kbps, 13643440 sample sz)
- Estimated mpv size : 821816972. (Q=16, 1127 kbps, 20626520 sample sz)
- Estimated mpv size : 645931218. (Q=24, 885 kbps, 16212020 sample sz)
- Estimated mpv size : 717959392. (Q=20, 984 kbps, 18019832 sample sz)
- Computed mpv size : 769888182. (Q=18, 1055 kbps, (Q20+Q16)/2)
- Estimated mpv size : 740233553. (Q=19, 1015 kbps, 18578884 sample sz)
--------------------------------------------------------
- Q Weight : (721805594. / 39.842735042735 - 18019832) / (19323176. - 18019832)
- Adjust Q : (20 + 1.0 - 7.40668545227281e-002 - (0.8)) = 20.1259331454773
- Determined Q. : 20
--------------------------------------------------------
Replace values in ecl file:
- opv_q_factor : 20
- opv_brate_max : 983 ==> 2530
- vbr_brate_avg : 6000 ==> 989
--------------------------------------------------------
- Encoding Movie
- 2003-08-21 23:18:02
--------------------------------------------------------
- Actual mpv file size:
08/22/2003 02:19 AM 699584772 Encoded_Video_CCE_NTSC.mpv
--------------------------------------------------------

jsquare
22nd August 2003, 16:32
The QMF script gives better results than MAF:
I just tried the QMF+D2SRoba 1-CD method with ST-Nemesis(Q=36) and DareDevil(Q=26) with very good image compared to MAF. There are only a couple of things that I don't like: CCE encoding speed dropped by .30 and it looks kind of blurry in some scenes, it needs more sharpness.

DDogg
22nd August 2003, 16:51
and it looks kind of blurry in some scenes, it needs more sharpness. Well you could easily alter or remove the temporalsoften statement, or maybe change to LanczosResize. If you do, let us know what that does to your encode. I expect your Q would go up a bit.

DDogg
22nd August 2003, 20:01
I just finished my 1cd test (problem) encode, The Usual Suspxts. Maybe all the study and 50 test encodes are a charm because it is close to perfect in all respects. No contour lines, no blocks, no mosquito noise. Encoding Q was 35 (down from 56) and the resulting VAF shows the average Q is under 6 with the max as 7.56. :cool:

Here are some settings to try if you want to play. They go against some of the common wisdom, but seem to work pretty well for this type of one CD encode, at least they did for me and are the result of a LOT of time spent trying to figure this out.

D2S settings:
Audio 128 Stereo
Semi-Auto with HomiE FR QMF
Matrix - CCE 2.62 Ultra Low Bitrate (we shall see)
Bias - 26 (odd, I know)
Max 2616 Min 300 (since you are using 128 audio)

CCE settings - Change "flat image priority" to 30

If you give these settings try, please let us know the results.

fastchef
23rd August 2003, 00:40
oh i forgot to say, i was getting speeds of .02 with cce 2.67 so i deleted this line:
10=STMedianFilter(8, 32, 0, 0 )
after that, speed was back to .50

also, i used the cce 2.6x standard matrix

jsquare
23rd August 2003, 00:53
Originally posted by DDogg
Well you could easily alter or remove the temporalsoften statement, or maybe change to LanczosResize. If you do, let us know what that does to your encode. I expect your Q would go up a bit.

Had the IQ Priority too high (45), took it back to 17 and it looks sharper, Lanczos increases Q and removing TemporalSoften makes people's faces like they have "rosacea"

My seetings:
CCE 2.67
Audio = 128kb Stereo
Semi-Auto with HomiE FR QMF
Matrix = CCE 2.50 Standard
Bias = 20
IQ Priority = 17
Max = 2500 Min = 300

r6d2
23rd August 2003, 01:27
I just finished a 1 CD encode of MIB with QMF stuff.

D2S settings:
Audio 96 Stereo
Semi-Auto with HomiE FR QMF (Bicubic)
Matrix - CCE 2.62 Standard
Bias - 20
Max 2530 Min 300

CCE settings - "flat image priority" to 25

Results: Q=32, CCE Speed 0.25

Previously, with KISS UnDot() & Deen() + Bilinear:

Q=35, CCE Speed 0.7

Visual quality comparison... Sorry, cannot tell a difference by just looking, even in full screen (and it's a 10% Q delta!)

DDogg
23rd August 2003, 06:26
r6d2,

1> Can you give us the what the Q would have been using straight Semi-Auto on MIB? (No filters). I suspect it might have already been fairly low to begin with. If so I don't think you would get a lot of additional help. Dunno for sure. I've only done two encodes with this setup.
2> I'm curious why you are using 2530 with 96 audio? 2646 might work better and give you more headroom?

r6d2
23rd August 2003, 07:43
Originally posted by DDogg
1> Can you give us the what the Q would have been using straight Semi-Auto on MIB? (No filters). I suspect it might have already been fairly low to begin with.
I knew you'd ask for that... So, it is ready ;) Q=39, speed 1.1

2> I'm curious why you are using 2530 with 96 audio? 2646 might work better and give you more headroom?
Sometimes when Audio and Video have a ratio too lower than 10% I get muxing errors or an image only my standalone can play, not PowerDVD.

I've left 2530 as my "default" attempting to fix that. No space is wasted, anyway, because the second pass uses it. I guess my bitrate curve is just a little flatter, like yours with that magic 26 bias parameter ;)

Regarding this QMF stuff, I tried it on a cartoon and it really improved it. I had given up with my standard KISS filters and had turned to CVD resolution. I tried QMF and kept the Q but with SVCD!

jsquare
23rd August 2003, 16:35
Bias=26 lowers the Q from 39 to 34 on VIKINGS at CVD resolution and using 128k Audio D2SRoBa SAmple=2.5% GOPs=3 Adj.Q=1 I got exactly 813MB, same as 2-Pass VBR but in 1/2 the time.

I removed the Undot, STMedianFilter and TemporalSoften lines and my speed went up from .67 to 1.07, I think QMF does a good job without those filters.

On the BlockOptimization settings if a choose 16 the preview on D2S seems to move towards the bottom, but if I choose 8 it aligns at the center, this is a wide screen movie and AutoDetectBorders reports Top=58 Height=362, if using CropH/V=2 then both Top=56 Height=360 are divisible by 8 but not by 16, don't know if this is correct but it looks logical to me.

r6d2
23rd August 2003, 16:44
Originally posted by jsquare
Bias=26 lowers the Q from 39 to 34 on VIKINGS at CVD resolution and using 128k Audio D2SRoBa SAmple=2.5% GOPs=3 Adj.Q=1 I got exactly 813MB, same as 2-Pass VBR but in 1/2 the time.

Which bias value gave you Q=39? If it was, for instance, 10, would you try something like bias=40?

I have the suspicion that increasing bias is just like lowering the Max, so you lower Q but artificially.

jsquare
23rd August 2003, 17:31
[QUOTE]Originally posted by r6d2
Which bias value gave you 39? If it was, for instance, 10, would you try something like 40?

BIAS=17/Q=39 and BIAS=26/Q=34 on Vikins, I'll try a higher BIAS on my next encode(TopGun) but I want to play with BlockOptimization settings and see if has anything to do with encoding speed and Q value.

r6d2
23rd August 2003, 17:36
Originally posted by jsquare
BIAS=17/Q=39 and BIAS=26/Q=34 on Vikins, I'll try a higher BIAS on my next encode(TopGun) but I want to play with BlockOptimization settings and see if has anything to do with encoding speed and Q value. [/B]
OK, please report the effect of bias on Q. I'd bet the higher you set it, the lower the Q. But you know, Q enforced by lower BR limits is not actually better quality, but exactly otherwise.

DDogg
23rd August 2003, 19:48
I don't yet understand what bias is really doing. DOes anybody have a good explanation?... so you lower Q but artificially. ???

r6d2
23rd August 2003, 21:04
Originally posted by DDogg
I don't yet understand what bias is really doing. DOes anybody have a good explanation? ???
AFAIK, bias is sorta "CBRness" slider. When close to 0, VBR is allowed to be loose and change rapidly from one frame to the next. When close to 100, output more like CBR is produced.

@DDogg, you remember the case of low Qs obtained by lowering the Max? Well, I think these two effects may be related. If CCE receives a high bias, it will not feel free to use all the variability available in VBR, producing more "forget Q" frames and making you believe the Q is low when actually is not.

homerjay
24th August 2003, 00:01
hi ddog & anyone else who might be reading

i have copied the [AVISYNTH_SemiAutoCropAndResize with HomiE FR QMF] and pasted it into my dvd2svcd.ini file

added all the loadplugin commands which i seem to need each time
but keep getting an error
i dont know what "ResizeMethod" means
E:\DVD2SVCD\Avisynth2.5 Plugins\autocrop\SemiAutoCropAndResize.avs, line82)
E:\DVD2SVCD\TEMP\preview.avs,line34

line 82 from SemiAutoCropAndResize.avs reads ( think might be out by a line or two )

(ResizeMethod == 4) ? SimpleResize(NewDestinationWidth, NewDestinationHeight) : NOP()

line 34 from preview.avs reads as below

Import("E:\DVD2SVCD\Avisynth2.5 Plugins\autocrop\SemiAutoCropAndResize.avs")


i did try to simplify by changing the resizemethod to 3 thinking it would eliminate two of the following parameters but it comes up with the same error so if anyone has any ideas why this is coming up with an error i would appreciate it

thanks

hj

DDogg
24th August 2003, 00:34
As said at the beginning of this thread, it is for advanced users and you must have Semi-AutoResize installed and working before trying ANY of this stuff (or posting in this thread). So let's find out if it is.

First, in the conversion tab load a source, go to the frameserver tab and select autodetectborders, go back to the conversion tab and do a preview. Do you see a picture with numbers on it? If not go to Gerti's thread and follow the installation instructions exactly and to the letter.

If you do have a preview picture, now select the standard Semi-autoResize in the Frameserver tab, go back to the conversion tab and see if you have a picture in preview. If not do as above.

Make sure you do the path in autodetect as instructed, and then exit dvd2svcd as instructed so that the path is saved. Do the same thing for the Semi-autoresize and exit again.

ONLY when you have verified you have Semi-Auto intalled properly should you attempt to add the QMF script. No shortcuts, ok? :) Oh, and BTW, don't think so much. There is not an error except in your installation. If you verify you have Semi-auto working properly, please come back and let us know how the QMF script worked for you. See you then.

jsquare
24th August 2003, 05:25
Originally posted by r6d2
OK, please report the effect of bias on Q. I'd bet the higher you set it, the lower the Q. But you know, Q enforced by lower BR limits is not actually better quality, but exactly otherwise.

I tried BIAS=1,25,50 and 100 on a testrun file from D2SRoBa just changing the BIAS value on the .ecl file, all tests came out with the same file size. So like you said "..lower Q but artificially" and in my case got it to work only once. I also tried lowering the OPV range from 300-2530 to 0-1850 and Q went down a bit but I didn't like the results.

Don't know about your guys, but as much as I want these 1-CD methods to work always get disappointed with the results, maybe because I keep comparing them with DVD or DivX quality, or most of my tests are played on a 55" HDTV and not on a standard TV. That's why I'm moving towards the idea of XSVCD(720x480) with 2-CDs, already encoded 4 titles using D2SRoba and BiCubicResize with very impressive results and they played fine on my home DVD player, only had one problem with sound when I increased the max bitrate to 3,500 and it went higher than 2,756(SVCD Standard) in some scenes. If your desktop DVD plays most of the formats and tests discussed on this forum it should have no problems with XSVCD.

homerjay
24th August 2003, 10:46
tiniest bit offended by your advanced user comment as i have been following the maf progress and posted in these threads previously but good advise so i will follow it through...

1 autodetect borders = working
2 standard semi autocrop and resize = working
3 MY_Semiautocropandresize_MA script(2.5.2) = working
4 SemiAutoCropAndResize with HomiE FR QMF = i get the same error as reported above

so without thinking ( i was going to remove script and re cut and paste) what should i do now

thanks

DDogg
24th August 2003, 13:57
homerjay, I did not mean to offend, just did not want this thread to become tech support. Tell you what, PM me the avs D2S generates that is giving you the problem. It has to be something simple. Assuming you downloaded the QMF script and removed the hyphen by renaming it and you have the right paths to it and to the semi-auto script and autocrop, it should give you no problems. I am sure we will be able to see it in your script.

homerjay
24th August 2003, 14:39
no offence was taken - i just thought you might have recognised me by now and your right it was slightly off topic so sorry ;)

but my solution which was odd was to include the loadplugex.dll at the begining of the script which i think means ive got a 2.0 plugin somwhere where i should have a 2.5

i will post a separate thread once ive found the original material regarding avisynth not needing to have loadplugin commands anymore that i thought i saw somewhere as i clearly have something set not quite right

thanks as always for looking and replying

hj :D

DDogg
24th August 2003, 15:09
I fixed the link on page one to Avalon's filter package or, better yet, go to WarpEnterprises great filter page and get 'em. http://www.avisynth.org/users/warpenterprises/

Oh, yeah, just for clarity's sake for anybody reading this, you do not need loadplugex.dll to do anything in this thread. If you do happen to use loadplugex.dll for anything else, make sure it is NOT in your 2.5 plugin directory. It has to reside in a separate directory and be hand loaded in the script. If not, all kinds of strange crashes and not so wonderful things will happen to CCE, VDub, MPlayer, etc.
http://forum.doom9.org/showthread.php?s=&threadid=49492&highlight=loadplugin+juanc

DDogg
27th August 2003, 23:31
Here is another set of params and a script to play with if anybody
is still interested (using CCE 2.67.00.1x:

CCE settings:
Video Button -
Lum - 16-235
Matrix - MUST! Either KVCD-Notch or CCE very low (Not ultra low - it seems to cause mosquito noise even though it
definately DOES make file size and Q lower (with CCE 2.67.00.11). Some may want to experiment)

Quality Button -
Quantizer Characteristics (flat panel Priority) - 30
IntraBlock DC precision - 10
Zigzag and progressive - Appropriate for your source. Both checked
if progressive.

D2S:
bitrate: Bitrate Min 0 Max 2616
Audio: Audio 128 Stereo
Encoder: Bias 20 (play with lower like 6 if you want)

http://nic.dnsalias.com/MPEG2Dec3v110.zip

Script (same as before except has BlindPP() I put it here to save you all having to renumber the script.
Hey, new version of D2S will do that automatically for you. Yeah!:

[AVISYNTH_SemiAutoCropAndResize with Homie FR QMF BlindPP]
0=BlindPP()#assumes you have Nic's mpeg2dec.dll v 10.0 See Avs devel forum
1=DetectedTop=^DetectedTop. DetectedHeight=^DetectedHeight
2=BlocksToCropHorizontal=^BlocksToCropHorizontal. BlocksToCropVertical=^BlocksToCropVertical. BlockOptimization=^BlockOptimization
3=ResizeMethod=^ResizeMethod. Bicubic_b_Value=^b_value. Bicubic_c_Value=^c_value
4=GammaCorrection=^GammaCorrection. Hue=^Hue. Saturation=^Saturation. Brightness=^Brightness. Contrast=^Contrast
5=DebugMode=^DebugMode
6=DestinationWidth=^TargetWidth
7=DestinationHeight=^TargetHeight
8=Import(!qmf15b1.avs)
9=Undot()
10=STMedianFilter(8, 32, 0, 0 ) #You may be able to rem this out for slower machines
11=# LOW MOTION FILTER FUNCTION
12=# -> STRONG TEMPORAL SMOOTHING (USING FLUXSMOOTH)
13=# -> SOFT SPATIAL SMOOTHING (USING UNFILTER)
14=function Low_Motion_Filter(clip c) { c = FluxSmooth(c,14,0) c = UnFilter(c,-10,-10) return c }
15=# MEDIUM MOTION FILTER FUNCTION
16=# -> MEDIUM TEMPORAL SMOOTHING (USING FLUXSMOOTH)
17=# -> MEDIUM SPATIAL SMOOTHING (USING FLUXSMOOTH AND UNFILTER)
18=function Medium_Motion_Filter(clip c) { c = FluxSmooth(c,7,7) c = UnFilter(c,-20,-20) return c }
19=# HIGH MOTION FILTER FUNCTION
20=# -> NO TEMPORAL SMOOTHING
21=# -> STRONG SPATIAL SMOOTHING (USING FLUXSMOOTH AND UNFILTER)
22=function High_Motion_Filter(clip c) { c = FluxSmooth(c,0,14) c = UnFilter(c,-30,-30) return c }
23=# APPLYING ADAPTATIVE SPATIO-TEMPORAL SMOOTHER (USING QMF)
24=QMF()
25=Import(!SemiAutoCropAndResize.avs)
26=undot()
27=#Deen() #Maybe for certain types of source.
28=Temporalsoften(2,3,3,mode=2,scenechange=6) #Need to check out dif settings
^DetectedTop.=0
^DetectedHeight=480
^BlocksToCropHorizontal.=2
^BlocksToCropVertical.=2
^BlockOptimization=16
^ResizeMethod.=2
^b_value.=0.0
^c_value=0.55
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0.0
^Contrast=1.0
^DebugMode=0
!qmf15b1.avs=C:\Program Files\AviSynth 2.5\plugins\QMF\qmf15b1.avs
!SemiAutoCropAndResize.avs=C:\Program Files\AviSynth 2.5\plugins\autocrop\SemiAutoCropAndResize.avs

DDogg
29th August 2003, 01:21
I wanted to add a few points of clarification for any readers of this thread. What we are trying to do is trade
off a little sharpness and some quality to allow a 90 encode on 1 80 min CDr, but still get a pretty good looking encode. The
goal is to try to get Q into the low 30s with 30-32 being judged optimum.

If any of these scripts drop your Q way under 30 then you should probably remove some of the heavier filtering as
an argument could be made that A Q 20 with all these filters would NOT look better than a Q30 without them. The Q30 would
nearly certainly look crisper/sharper and better, but it is a subjective area and ultimately has to be judged by the
eyes of the beholder.

In the script above, for example, you might want to comment out (#) or remove the Stmedian and the
Temporalsoften filters. The QMF is still actually pretty heavy stuff and does a fair bit of softening itself.

Alternately you may want to try the MFA script at the start of this thread. It works hard to keep up a crisp look.

Another couple of scripts you may find to your liking:
(this one is pretty good - LOTR 2Twrs on 2 cds @Q31)
[AVISYNTH_SemiAutoCropAndResize BlindPP with ATC]
0=blindpp()
1=DetectedTop=^DetectedTop. DetectedHeight=^DetectedHeight
2=BlocksToCropHorizontal=^BlocksToCropHorizontal. BlocksToCropVertical=^BlocksToCropVertical. BlockOptimization=^BlockOptimization
3=ResizeMethod=^ResizeMethod. Bicubic_b_Value=^b_value. Bicubic_c_Value=^c_value
4=GammaCorrection=^GammaCorrection. Hue=^Hue. Saturation=^Saturation. Brightness=^Brightness. Contrast=^Contrast
5=DebugMode=^DebugMode
6=DestinationWidth=^TargetWidth
7=DestinationHeight=^TargetHeight
8=MergeChroma(blur(^blur_chroma))
9=MergeLuma(blur(^blur_luma))
10=undot()
11=Import(!SemiAutoCropAndResize.avs)
12=ATC()
13=undot()
^DetectedTop.=60
^DetectedHeight=354
^BlocksToCropHorizontal.=2
^BlocksToCropVertical.=2
^BlockOptimization=16
^ResizeMethod.=3
^b_value.=0.0
^c_value=0.6
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0.0
^Contrast=1.0
^DebugMode=0
^blur_chroma=1.58
^blur_luma=0.1
!SemiAutoCropAndResize.avs=C:\Program Files\AviSynth 2.5\plugins\autocrop\SemiAutoCropAndResize.avs
or one of r6d2's favorites slightly modified - remove Deen() if too strong but leave the other stuff. Should be one of the faster ones
[AVISYNTH_SemiAutoCropAndResize KISS plus]
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=MergeChroma(blur(^blur_chroma))
8=MergeLuma(blur(^blur_luma))
9=undot()
10=Import(!SemiAutoCropAndResize.avs)
11=Deen()
12=undot()
^DetectedTop.=60
^DetectedHeight=354
^BlocksToCropHorizontal.=2
^BlocksToCropVertical.=2
^BlockOptimization=16
^ResizeMethod.=3
^b_value.=0.0
^c_value=0.6
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0.0
^Contrast=1.0
^DebugMode=0
^blur_chroma=1.58
^blur_luma=0.1
!SemiAutoCropAndResize.avs=C:\Program Files\AviSynth 2.5\plugins\autocrop\SemiAutoCropAndResize.avs
or, second in size reduction only to Qmf in post above with Deen()IN. Remove Deen() for a very fast script[AVISYNTH_SemiAutoCropAndResize KISS plus W BlindPP]
0=BlindPP()
1=DetectedTop=^DetectedTop. DetectedHeight=^DetectedHeight
2=BlocksToCropHorizontal=^BlocksToCropHorizontal. BlocksToCropVertical=^BlocksToCropVertical. BlockOptimization=^BlockOptimization
3=ResizeMethod=^ResizeMethod. Bicubic_b_Value=^b_value. Bicubic_c_Value=^c_value
4=GammaCorrection=^GammaCorrection. Hue=^Hue. Saturation=^Saturation. Brightness=^Brightness. Contrast=^Contrast
5=DebugMode=^DebugMode
6=DestinationWidth=^TargetWidth
7=DestinationHeight=^TargetHeight
8=MergeChroma(blur(^blur_chroma))
9=MergeLuma(blur(^blur_luma))
10=undot()
11=Import(!SemiAutoCropAndResize.avs)
12=Deen()
13=undot()
^DetectedTop.=60
^DetectedHeight=354
^BlocksToCropHorizontal.=2
^BlocksToCropVertical.=2
^BlockOptimization=16
^ResizeMethod.=3
^b_value.=0.0
^c_value=0.6
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0.0
^Contrast=1.0
^DebugMode=0
^blur_chroma=1.58
^blur_luma=0.1
!SemiAutoCropAndResize.avs=C:\Program Files\AviSynth 2.5\plugins\autocrop\SemiAutoCropAndResize.avs

manolito
19th November 2003, 23:41
It seems noone is interested in low bitrate encodes anymore. R6D2 calls himself a "Quality Guy", and DDogg hasn't posted anything about the latest filtering tricks for some time.

I have to admit that I am mainly a "Size Guy", I always try to squeeze a DVD to one CDR. I recently did some tests mainly with Avisynth scripts from DDogg's posts in this forum. Basically the results were as expected: More filtering, less crispness, lower Q, slower speed with one exception.

In one of his latest posts DDogg explained that he abandoned the QMF stuff in favor of just using the FACAR Preresize and Postresize functions with Undot, Asharp and Fluxsmooth in Preresize and Temporalsoften in Postresize. This really works very well, but I found one other filter setting that works even better for me.

I use the QMF functions of the latest FACAR with two modifications. The first modification is that I use Bilinear resize in all three motion bands in the QMFFunctions.avs. The second modification is that I changed the thresholds in the QMF15B1.avs according to a post by Jsquare.

----------------------------------------------------------------------
Changed Thresholds for QMF.AVS (by jsquare)

# SETTING MOTION LEVELS THRESHOLDS
threshold_lm = default(threshold_lm,(chroma == true) ? 1.0 : 2.0)
threshold_hm = default(threshold_hm,(chroma == true) ? 5.0 : 8.0)
# SETTING MIN/MAX SCENE CHANGE THRESHOLDS
threshold_sc_lm = default(threshold_sc_lm,(chroma == true) ? 10.0 : 20.0)
threshold_sc_mm = default(threshold_sc_mm,(chroma == true) ? 20.0 : 35.0)
threshold_sc_hm = default(threshold_sc_hm,(chroma == true) ? 35.0 : 50.0)

--------------------------------------------------------------------------

With these modifications my Q dropped by 5 compared to DDoggs Pre-and Postresize filters, and contrary to what I expected encoding speed was considerably higher. I did some test encodes with both filter settings, and the QMF encodes always looked a little better to me.


My other settings were according to DDogg's QMF Low Bitrate Benchmark post:

-----------------------------------------------------------------------------
D2S Settings:
Matrix - Bach1 (pasted in below)
Audio - 128 Stereo
Bias - 11

CCE 2.67 Settings (via Progressive template) If not mentioned then use default.
Video Tab:
M=3 N/M = 4
All unchecked except "Add sequence end code"
Luminance level 16-235
Quality Tab
All unchecked except zigzag, progressive, 10 bits, QC slider 28

-----------------------------------------------------------------------------

Maybe someone (DDogg ?) could do some tests with these settings and give me some feedback.

Another question: How good is the Bach1 (=God1) matrix compared to the KVCD notch matrix? I tried both, but I was unable to pinpoint any difference in quality.

DDogg
20th November 2003, 00:36
manolito, :goodpost:

I just got burned out and I think I burned out a lot of others :) It is good to see some of that stuff has helped somebody. I'm glad you mentioned jsquare's modification to the QMF thresholds. It was an area I had wanted to pursue when I had the energy again, but had forgotten. Seems like you have saved me a ton of digging!

OK, you got my compression juices juices going again. I'll give it a try next encode and report back to this thread. Just to save me more work, how about pasting in your Pre and Post scripts. Then I can really be lazy :)

As for as the Bach Matrix (he will kill me for even calling it that), it is all I use now for low bitrate stuff. I remember doing some freaking exhausting tests using 2% samples with nearly all the matrices. Of those, three emerged in my mind as contenders. JSquares, Kwag's Notch, and Bach's. JSquare's was a smaller file size by just a bit, but IIRC, there was something that I can't remember now that made me decide against it (for my use). Bach's was in the middle of the three size-wise and seemed the best compromise. Kwag's was good also, but filesize was slightly larger than Bach's on those test encodes.

One thing that emerged from those tests for sure was having the proper Matrix is absolutely needed for this low BR stuff (IMO). You can see that easily by doing a one or two percent sample at Q32 with all parameters exactly the same except the matrix. Then you can view each sample and make a quality judgment to compliment the filesize judgment. Smallest is not necessarily a better choice :rolleyes: You will see some fairly significant size variations. Even changing from 10 bits to 8 will cause a size variation as will the Q Characteristics.

r6d2
20th November 2003, 02:14
Originally posted by manolito
It seems noone is interested in low bitrate encodes anymore. R6D2 calls himself a "Quality Guy"
Just a precision: quality oriented guy ;) Me calling myself a "quality guy" would be presumptuous indeed.
and DDogg hasn't posted anything about the latest filtering tricks for some time.
Hehehe... He will now. The DVD2KVCD plugin got his fingers itching again :D:D:D
I am mainly a "Size Guy"
You're being presumptuous too ;)

jsoto
21st November 2003, 00:50
I am mainly a "Size Guy"
You're being presumptuous too :)

Funny.
For not Spanish speakers "manolito" means "Little Manuel"...

Sorry, we are in a serious forum.

@manolito
Wellcome to the forum. Only two until now, but very good posts.

jsoto

r6d2
21st November 2003, 02:20
When CDs where invented, they had 74 minute capacity.

With floppys, magnetic in nature, they managed to double the capacity on each generation by increasing the density of the material.

CDs are optical in nature and mechanics only allowed for some optimization on track width and thus improve capacity to 80, 90 and 99 minutes in one layer.

CDs were originally used primarily for music, and that size was quite enough for most applications. They even designed the inner hole to fit your finger. ;)

When consumer burners came out, other uses were given to CD media. Including movie encodes. One CD can fit 798-MB of video data, including headers and file system structure.

You usually cannot fit a 90 or 120 movie in 1 CD without heavy cropping (like the one done by FACAR), filtering, custom matrices and big GOP tricks. All those tricks make the movie lose quality, even though the quantization you measure afterwards may be still low, it's a quantization for a very different source than the original.

I really find it pointless to stick to the arbitrary 80 min CD sizes instead of preserving quality. If CDs would have been created as 100 min originally, all our encodes would have at least 25% more quality. I don't think we should let the music industry historical decisions to decide which quality your encodes will have. ;)

It's like if there was only small sized clothes and we would still buy and use anyway, looking terribly ridiculous when you are bigger sizes. :)

The Edge
21st November 2003, 10:31
Just reading all this last night and look forward to testing it all.
I notice the SemiAutoCropAndResize.avs is not compatible with Avisynth 2.53. Seems to work fine under 2.52. Am I correct in saying this?

I only had a few minutes to use this yesterday. The error was in line 80 of the avs which is:

(ResizeMethod == 2) ? BicubicResize(NewDestinationWidth, NewDestinationHeight, Bicubic_b_Value, Bicubic_c_Value) : NOP()

Maybe I messed up here so I'll double check later night and re-read the posts. Cheers.

Edge

Edit: typo

Crackhead
21st November 2003, 11:08
Coz I hate it to have the movie being interrupted somewhere and changing the cd...
second, what r6d2 says about quality is absolutely right, but IMHO i don't see any great difference on tv, so i think it's not worth "wasting" one more cd-r:D

but don't want to start any kind of religious discussion here:D :rolleyes: (i think we already had enough of them:D )

so @ manolito: did you apply any filters in pre and postresize.avs, cause i tried the changes you suggested and it works really great.

manolito
21st November 2003, 15:40
Thanks for the replies, I'm glad I was wrong assuming that noone is interested in low bitrate encodes anymore.

I should have done that in my first post, but here comes a BIG thank you to the people in this forum. I am not new to computers, but this DVD stuff is still quite foreign to me (got my first DVD Rom about three months ago). I tried to do my homework before posting here, and it is amazing how much I learned from reading older posts. I'm especially grateful to DDogg, r6d2 and Tylo, you guys are great!

@r6d2 and crackhead:
You both have a point, but I have to admit that I am a very lazy person, so if I can avoid changing a CD in the middle of a movie I will try to do that. And let's be honest, if our priority was to get first rate quality encodes we would all have a DVD burner and do our DVD backups with one of the "one click" programs. A few days ago I saw a + burner for a little over 90 Euros.

What got me hooked to the DVD2SVCD stuff was the challenge, trying to push the limit (getting too pathetic now....)

And a final word about this "quality vs. size" thing: Most of my former girlfriends told me that both are equally important!


Okay, let's get serious again. Last night I did a 1 CD encode of "Chocolat". The movie is 1 hour and 57 minutes long, AR is 1.85 : 1. I used FACAR's QMF functions with the two modifications described in my previous post, CCE settings also as described. I got a Q of 39, and for me it is impossible to tell the difference to the original DVD. At first I thought I could recognize the SVCD by the slight flickering of the characters during the end credits, but this was just interlace flicker which was present in the DVD also. Of course this is only true for watching the film on a regular TV set, but this is what I usually do.


@The Edge:
SemiAutoCropAndResize is obsolete, you should upgrade to FACAR. I do not know if FACAR has problems with AviSynth 2.53 (isn't 2.53 still beta?)

@Crackhead
I edited Pre- and Postresize.avs according to the following post by DDogg (I think it is in the FACAR thread):

-----------------------------------------------------------
Actually the idea behind QMF is to avoid overcompression by lightly applying the
relevant filters to the appropriate level of action. Same would be said for KWAG's MAF.
QMF or MAF is not the culprit, the overzealous use of filters in them is. But as a
matter of personal practice I quit using either because using your Pre and Post setup
is soooo nice with a light filter application like:

PreResize -
undot()
ASharp(1,4)#costs "Q", but I really like the contrast increase
Fluxsmooth(5,5)

[bilinear resizing]

PostResize -
#deen() occasionally. It actually seems to be better post resize
TemporalSoften(3,5,5,10,2) #normally use this

Helps compression greatly without it being noticable to me. If that doesn't work I
just increase space/disks.
----------------------------------------------------------------

I totally agree with DDogg that these filter settings can be used universally. Compared to using no filters at all it lowered my Q by 16, encoding speed dropped to 44% of the speed without filters.


My other favorite filter setup is the modified QMF stuff described above. It made my Q drop by 21 while encoding speed was 63%. Of course the effect of this QMF filtering depends on the kind of material you are encoding. Maybe some more tweaking the thresholds might be useful, but I think Jsquares values do work very well.


Another thing I noticed: When using the QMF filter I had to increase the "Adjust Q" value in Tylo's plugin quite a bit. For version 2.70 RC2 I could go up to 3.2 before I got any slightly oversized encodes, and for version 3.00 I use a value of 2.6 now.



OK, if anyone is interested I could post my test results with all the different filters. I tested the following scripts:

1. Reference: FACAR without filters
2. MAF script by KWAG (The official KVCD optimal script modified for FACAR)
3. MAF script by DDogg (first post in this thread, modified for FACAR)
4. Pre- and Postresize by DDogg (see above) included in FACAR
5. QMF Ultralow Benchmark 1 by DDogg (also modified for FACAR)
6. QMF functions by r6d2 and DDogg included in FACAR
a: Bilinear on medium- and high motion bands
b: Bilinear on all three bands
c: Original thresholds (Homie Fr)
d: Modified thresholds (Jsquare)
7. QMF with BlindPP with and without Deen (posted by DDogg in this thread, modified for FACAR)


IMHO the two scripts that stand out are No. 4 and No. 6bd. No. 7 with Deen is for those real hopeless encodes, but it's sure nice to have it.

Crackhead
21st November 2003, 16:00
^^ sure i'm interested about your test results!
i did some test myself these days and facar W ddogg's post/preresize-filtering w/o qmf gave me the best results, but i will try your suggestions later today and see how it goes!
Originally posted by manolito
And a final word about this "quality vs. size" thing: Most of my former girlfriends told me that both are equally important!Good to know btw, will keep this in mind:D:rolleyes: lol

r6d2
21st November 2003, 23:44
Originally posted by manolito
@r6d2 and crackhead:
You both have a point, but I have to admit that I am a very lazy person, so if I can avoid changing a CD in the middle of a movie I will try to do that.
Interesting. Then the music industry turned out defining the lazyness threshold of mankind too! Smart guys. Will they have thought of that? :D:D:D
And let's be honest, if our priority was to get first rate quality encodes we would all have a DVD burner and do our DVD backups with one of the "one click" programs.
That is the extreme lazyness indeed ;), and as you say it presents no challenge whatsoever. Actually, that has refrained me from buying a DVD burner. :)

You have a point, but I actually encode SVCDs on CDs for my portable player when I travel. I always have the originals at home.
And a final word about this "quality vs. size" thing: Most of my former girlfriends told me that both are equally important!
LOL. And what does the latter one think? :D:D:D

Wilbert
22nd November 2003, 16:07
I only had a few minutes to use this yesterday. The error was in line 80 of the avs which is:

(ResizeMethod == 2) ? BicubicResize(NewDestinationWidth, NewDestinationHeight, Bicubic_b_Value, Bicubic_c_Value) : NOP()

Apperently the nop function doesn't work in AviSynth v2.53. A work around:

http://forum.doom9.org/showthread.php?s=&threadid=65093&highlight=nop

DDogg
22nd November 2003, 18:19
Just for the record, my purpose in doing a lot of this time consuming grind testing was not for the purpose of a 1cd SVCD. Rather it was to accumulate the data and experience to establish certain personal benchmarks to be used later when putting multiple movies on a DVD of equal quality. As the OPV'ers know, equal space has nothing to do with equal quality due to the compression characteristics of the source as well as simple things like aspect ratio and length.

This predictive ability of OPV encoding seems nearly magical to me :)

One of the things most interesting to me was how much intrinsic information is available by doing just one 1% pass at Q32 Min 300 Max 2584 (or whatever your personal values are).

What I mean is, just looking at the filesize from that one pass tells me just about everything I want to know. If it is much bigger that 7250-7500 KB then I know to try additional filters up to my personal opinion of "max filtering acceptable to me". At that stage, if filesize is larger than 7250-7500 KB (in the case of an SVCD 1CD encode), I know the encode it not practical for one disk and increment/increase space.

It is important to note that those value quoted above are just those that work for me when the target is one 700/80 CD. The same thing could be established and work for a 2200kb, or whatever xx KB space, allocation for DVD.

Creating your own personal criteria is just the result of a one time set of tests, accumulating the data, and establishing your personal benchmark. After that data is finalized in your head, it is replicatable and reusable for future encodes involving that X amount of space. Things like chosen resolution, the compressibility of a particular source, length of source, aspect ratio, etc., are all automatically encompassed and do not need to be thought about. I like simple things where you need to take the time and allocate mind space to learn it just once. After that you just reuse that knowledge in a tool users manner without much thought or effort.

In the case of multiple movies on one DVD, the same method, can be used to know what space needs to be allocated for each source so that a similar Q is achieved for each. You do that by doing multiple iterations of the 1% sample with all your sources that need to be fit into the X KB of total space. Multiplying each resulting sample filesize by 100 yields an approximate space requirement for each source. Eventually, and without too much trouble, you will find a common Q that will encode each source at the same quality *and* fit the available space.

Because sampling is not 100% accurate, the last source you wish to put on the available space may require a sizing pass to shoehorn it in to that available space. In other words, if the first X sources ran over or under a bit, you use the ability of CCE to do a final resizing pass where it reuses the VAF information file created in the first pass. This ability of CCE to reuse the VAF sets it apart from other encoders and becomes very valuable in this situation. The second pass is deadly accurate and only needs to be performed on the last movie to be fit in the available space (assuming the adjustment does not break the 10% rule).

Knowing in advance this acceptable Q and the required space needed saves one hell of a lot of wasted time and effort. That's a beautiful thing to me. Yes, I do realize that makes me some kind of an encoding nerd without a life :D

Did this all make any sense, or am I rambling again? :D

Also, pardon my multiple edits. I got on a roll.

Van the man
1st December 2003, 13:57
hi!
Looks like this is a great way to do svcd's on 1cd.
But when I tried to do a svcd with the MAF,there is no picture on the final file,I can only hear the sound.Is there something I am doing wrong? and where?
the muxing and all that stuff is doing good,but when I open the file I can only hear the sound :confused:

Hope to get some help :)

Van the man

EDIT: I tried to open the file in Tmpeg.It worked fine.So is there something wrong with CCE?

Crackhead
1st December 2003, 15:02
did you try to watch it with wmp?
if so, try with powerdvd or zoomplayer or whatever player you have!
with wmp you may need a codec which isn't included in windows beforehand..

Van the man
2nd December 2003, 01:03
yeah,I tried to watch with wmp and powerdvd.But no luck.I also tried to burn the image and test on my dvd but still no picture,only sound.