Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th May 2003, 12:57   #1  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
New anime filter: mfToon

Ok, so some of you might have heard of this by reading the AVISynth development forum, however not all of you do, so I'm posting here, now that I reckon I won't be doing much about it anymore.

I have mfToon v0.32 ready, and I think it's good enough for normal usage now. You can follow development from v0.1 onward here.

The script (it's a function, not a real filter dll) can be found here.

What does it do: in default operation, it performs line darkening, Xsharpening, and warp sharpening. Sharpening is slow, and because of that I've made it optional.
Because of colorspace conversions, most of the operations are done on luma only. Warp sharpening can be done either on luma only or on luma and chroma (chroma linked to luma). Input requires to be YV12, this is not checked, it's probably safe to use other colorspaces but the output will always be YV12. I'm not responsible for what happens if you use something other than YV12 .

Usage and parameters:

Code:
Import("mfToon-v0.32.avs")
AVISource/MPEG2Source/WhateverSource("file")
mfToon()

Normal parameters:
  • type param - description - range - default
  • int strength - line darkening strength - 0-255 - 255
  • bool sharpen - sharpening - on/off - true
  • bool cwarp - chroma warp - on/off - true
  • float wdepth - warping depth - ?-? - 16.0
  • int wblur - warping blur level - ?-? - 2
  • float wthresh - warping threshold - 0.0-1.0 - 0.5
  • int ssw - supersample factor horizontally - 0-inf - 4
  • int ssh - supersample factor vertically - 0-inf - 4

Advanced parameters, you're not likely to be tweaking these:
  • type param - description - range - default
  • int xstren - xsharpening strength - 0-255 - 255
  • int xthresh - xsharpening threshold - 0-255 - 255
  • float ublur - unsharp mask blur level - 0.0-1.58 - 1.58
  • int ustren - unsharp mask strength - 0-255
  • int urange - unsharp mask range - 0-255 - 115
  • float uboost - unsharp mask boost - 0.0-10.0 - 1.0
  • int dstren - detail strength - 0-255 - 255
  • int drange - detail range - 0-255 - 64
  • float dboost - detail boost - 0.0-10.0 - 10.0
  • int dlimit - detail limiter - 0-255 - 30

Explanation of advanced parameters: mfToon uses masks, and these parameters influence them. Strength means opacity of the effect, range means the value compression, boost means an opaque/transparency boost, where a value below 1.0 is negative, and limiter means the final range compression.

Yeah, these are quite some parameters, but I love configurability .

Initially I wanted to hide the drawbacks, and let you figure them out (they're hardly noticable), but nahh .
Drawbacks: Sometimes a strange "dark edge" effect on seemingly low-detail surfaces, and a VERY slight darkening along non-line edges (this is the effect you get from sharpeners ala MSharpen and aSharp, so you probably won't notice it).

Dependencies are:
Special(!) Warp Sharp package
MaskTools
aWarpSharp

Thanks go to:
Anonymous author of the new WarpSharp package
neuron2 (for the original XSharpen)
Kurosu
Marc FD
The whole forum and its users

Have fun!

PS: Just for fun, here's a nice challenge. I just noticed I accidentally made one obsolete parameter. See if you can spot it .

Last edited by mf; 14th May 2003 at 13:03.
mf is offline   Reply With Quote
Old 14th May 2003, 13:12   #2  |  Link
digitize
Registered User
 
digitize's Avatar
 
Join Date: Aug 2002
Posts: 142
For all of those who have not tried this filter.... well you're missing out ^^. It is directed towards anime... not sure how and if it'd really work with live action stuff. Anyway, it is able to darken lines and sharpen the picture very well. The one drawback atm is the speed, but speed isn't of the largest concern, quality is, and that's where this filter does well. Well done mf
digitize is offline   Reply With Quote
Old 14th May 2003, 14:20   #3  |  Link
jarthel
plebian
 
Join Date: Nov 2001
Posts: 775
another drawback: slow even on my overclocked system but quality is good.
jarthel is offline   Reply With Quote
Old 15th May 2003, 07:27   #4  |  Link
zeus163
Registered User
 
Join Date: Apr 2002
Posts: 134
(OK, I just re-read some of the txt files and it appears that I need to install 2.51). I'll try that tomorrow and get back to you.
Does this work with 2.08? I'm trying to use it and it errors out every time I pull it into CCE. It doesn't say an error, just a picture with an exclamation error. I just tried to open the script in VDub and it states there is a script error: There is no function named Edge Mask.I took all the downloadable files from this page and just can't seem to get them set up right. I must be doing something wrong. My sample script is below.

Import("C:\Program Files\AviSynth2\plugins\mfToon-v0.32.avs")
AVISource("F:\anime\naruto episodes\naruto test.avi")
mfToon()
BicubicResize(704,440)
AddBorders(8,20,8,20)
ResampleAudio(44100)

I can't wait to try this. It looks cool. Especially since I've been converting Naruto fansubs to DVD!

Last edited by zeus163; 15th May 2003 at 08:40.
zeus163 is offline   Reply With Quote
Old 15th May 2003, 11:51   #5  |  Link
digitize
Registered User
 
digitize's Avatar
 
Join Date: Aug 2002
Posts: 142
@zeus
You need to load all the dll's that you downloaded:
awarpsharp
warpsharp
MaskTools

Load all of those into the avs, and it should work.
digitize is offline   Reply With Quote
Old 15th May 2003, 13:39   #6  |  Link
dvd2svcd
Moderator
 
dvd2svcd's Avatar
 
Join Date: Oct 2001
Location: On top of the world!
Posts: 1,837
Here's a funny thing. If you put the 3 above plugins into the Avisynth 2.51 Plugin folder, dvd2svcd fails when using the native VFW routines of Windows (used by preview and frameselection). I haven't gone into depth with the issue, but if anybody cares I can investigate further.
__________________
Cheers,
dvd2svcd
dvd2svcd is offline   Reply With Quote
Old 15th May 2003, 14:10   #7  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,354
Quote:
Here's a funny thing. If you put the 3 above plugins into the Avisynth 2.51 Plugin folder, dvd2svcd fails when using the native VFW routines of Windows (used by preview and frameselection). I haven't gone into depth with the issue, but if anybody cares I can investigate further.
Problem is already known (and described in both AviSynth faq's). The problem is warpsharp.dll, and the solution is to put it _not_ in the AviSynth plugindir, but somewhere else.
Wilbert is offline   Reply With Quote
Old 15th May 2003, 14:11   #8  |  Link
dvd2svcd
Moderator
 
dvd2svcd's Avatar
 
Join Date: Oct 2001
Location: On top of the world!
Posts: 1,837
Sorry, my bad. Note to self "use the freaking search button"

However, I find it funny that mf apparently doesn't need to load warpsharp manually. (if you look in the mfToon function it isn't loaded anywhere and therefore mf should get the same problem when previewing an avs in MediaPlayer 6.4)
__________________
Cheers,
dvd2svcd

Last edited by dvd2svcd; 15th May 2003 at 14:16.
dvd2svcd is offline   Reply With Quote
Old 15th May 2003, 15:27   #9  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by dvd2svcd
Sorry, my bad. Note to self "use the freaking search button"

However, I find it funny that mf apparently doesn't need to load warpsharp manually. (if you look in the mfToon function it isn't loaded anywhere and therefore mf should get the same problem when previewing an avs in MediaPlayer 6.4)
Actually, I load them before I do Import() .
mf is offline   Reply With Quote
Old 15th May 2003, 16:00   #10  |  Link
Defiler
Asker of Questions
 
Join Date: Oct 2001
Location: Florida
Posts: 433
I didn't need to explicitly load any plugins to make this work. Thanks for the script.
I'm encoding a 90 minute anime to one CD right now. I'll reply with my results if they are interesting. I'm also using the latest XviD features, like Trellis, etc.. so it will be a while. Heh.
__________________
"The real trick to optimizing color space conversions is of course to not do them." --trbarry, April 2002
Defiler is offline   Reply With Quote
Old 15th May 2003, 18:02   #11  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
So, nobody spotted the obsolete parameter yet?
mf is offline   Reply With Quote
Old 15th May 2003, 18:08   #12  |  Link
Sorrow
Registered User
 
Join Date: Oct 2001
Posts: 21
I'll take a shot... is the obsolete parm

int urange - unsharp mask range - 0-255 - 115


hehe wild guess here.
Sorrow is offline   Reply With Quote
Old 15th May 2003, 18:13   #13  |  Link
Defiler
Asker of Questions
 
Join Date: Oct 2001
Location: Florida
Posts: 433
That's my guess as well.
__________________
"The real trick to optimizing color space conversions is of course to not do them." --trbarry, April 2002
Defiler is offline   Reply With Quote
Old 15th May 2003, 19:17   #14  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by Sorrow
int urange - unsharp mask range - 0-255 - 115
Nope .
mf is offline   Reply With Quote
Old 15th May 2003, 19:36   #15  |  Link
Defiler
Asker of Questions
 
Join Date: Oct 2001
Location: Florida
Posts: 433
I give up. I just read through the script like 10 times, and every defined parameter seems like it is used in a function that actually passes data to one of the three clips that is used for the final output. 18 "independent" parameters, 18 are defined, 18 are documented.

Can we get a hint?
__________________
"The real trick to optimizing color space conversions is of course to not do them." --trbarry, April 2002
Defiler is offline   Reply With Quote
Old 15th May 2003, 20:01   #16  |  Link
zeus163
Registered User
 
Join Date: Apr 2002
Posts: 134
I loaded all the plug-in's into my script and that did not solve the problem. Although the error it reported was something like screen size not accepted. I'm at work so don't remember what it says. I think I have to install avisynth 2.51, but whenever I do that I seem to have problems modifying my working scripts for fielddeinterlace (i think it's something to do with mpeg2dec that I'm trying to use). When I get home, I'll try this again and upgrade to 2.51 and see if I can get it to work.
zeus163 is offline   Reply With Quote
Old 15th May 2003, 20:11   #17  |  Link
Defiler
Asker of Questions
 
Join Date: Oct 2001
Location: Florida
Posts: 433
zeus: You did read this, right?
Quote:
Input required to be YV12, this is not checked, it's probably safe to use other colorspaces but the output will always be YV12. I'm not responsible for what happens if you use something other than YV12
__________________
"The real trick to optimizing color space conversions is of course to not do them." --trbarry, April 2002
Defiler is offline   Reply With Quote
Old 15th May 2003, 20:14   #18  |  Link
Mr_Khyron
Member
 
Mr_Khyron's Avatar
 
Join Date: Nov 2002
Posts: 197
zeus163: Try the new MPEG2Dec3 v1.04 and AviSynth 2.5.1 RC 3.1
Mr_Khyron is offline   Reply With Quote
Old 15th May 2003, 20:37   #19  |  Link
Dreassica
Registered User
 
Join Date: May 2002
Posts: 384
detail limiter - 0-255 - 30
maybe? :P
Dreassica is offline   Reply With Quote
Old 15th May 2003, 20:41   #20  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by Defiler
I give up. I just read through the script like 10 times, and every defined parameter seems like it is used in a function that actually passes data to one of the three clips that is used for the final output. 18 "independent" parameters, 18 are defined, 18 are documented.

Can we get a hint?
Well actually, there are two parameters that do the same, and you can use either one of them and get the same effect .

Quote:
Originally posted by Dreassica
detail limiter - 0-255 - 30
maybe? :P
Nope .
mf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:26.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.