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 23rd August 2003, 18:24   #1  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
New filters: SharpTools and DetailIllusion

Hi there!


More slowass filters have reached into my AVS Dumpster .

SharpTools
DetailIllusion

My filters are self-documenting now (and parameters need little explanation), so I'll keep it short.

SharpTools: 2 filters - SharpResize() and SSXSharpen(), both using XSharpening for best results ^_^. I guess this kind of explains itself. If it doesn't, here's an SSXSharpen explanation, and a Resize Comparison.

DetailIllusion: now here things are getting a little more complicated. This is an experimental filter to test out a theory, that I've been thinking of. It adds slight noise to detailed areas of the picture, so if there's a lack of detail (through smoothing or resizing) it will try to trick your subconscious into thinking there's more detail. The concept itself works okay imho, but I've noticed after encoding it works better, because the codec will compress the noise and (XviD will do this anyway) replace it by detail-approximating artifacts, one of the reasons we prefer XviD over RV9 or DivX5 . Feel free to test it yourself, this was simply a concept-test and for me it works pretty well, I'm testing it right now on a movie I've SharpResized from DVD resolution to 1024x432 (because of the resolution blowup a lot of detail (that was never there in the source) is missing). A final note, this works like turd on anime, so don't even try it ^^;.

Anyway, thanks everyone who's been using mfToon for encouraging me to write AVISynth in a way that everyone can use it.

Happy testing .
mf is offline   Reply With Quote
Old 26th August 2003, 16:22   #2  |  Link
yaz
n00b ever
 
Join Date: May 2002
Posts: 627
Re: New filters: SharpTools and DetailIllusion

@mf:
sure, i give it a try (as i rebuild my system hopelessly crashed) but ..

Quote:
Originally posted by mf
DetailIllusion: ... It adds slight noise to detailed areas of the picture, so if there's a lack of detail (through smoothing or resizing) it will try to trick your subconscious into thinking there's more detail.
- can't get it. does it add noise to detailed or to smooth area? (my english is pretty weak:-)
- what is addnoise() in the script? the only thing occurs to me is blockbuster (having this name at born) do u still use that?
- can't blockbuster be tuned to do the task or u don't like bb?
- have u tried addgrain? i like the way it goes.
- why would help a size-up for doing this trick? (presuming, there comes a heavy size-down afterwards)

i luv your concept & i've experienced a lot with selective noising (which really helps to improve the overall look). so, no blame intended here :-)

the bests
y

PS
Quote:
Originally posted by mf
... detail-approximating artifacts (one of the reasons we prefer XviD) ...
whooa ... the best expression i've ever heard. for me, it is the main reason.
yaz is offline   Reply With Quote
Old 27th August 2003, 11:42   #3  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Hi mf!

Very fine tools, indeed.

Regarding SharpTools: Well, I feel a little "out-raced" ... Some time ago, I thought "hey, I should try an area sharpener with supersampling". But just before I actually found the time to sit down, you came up with v0.1 of your SharpTools ... must be some form of morphogenetic energy?

Regarding DetailIllusion: interesting concept (but the name looks very irritating in Arial script ).
One thing I don't like about the current implementation: it acts in the form "the harder the edge, the more noise we add". This is IMHO sub-optimal (but agreed, AviSynth's lack of curve adjustments makes it a pain to simulate exactly that).
The point is, it would be better to add the "noitail" only to the not-so-hard edges, speak: to the areas of soft detail, and to leave the very hard edges alone again, just like the flat areas.
As it is by now, it sometimes just looks like mosquito noise, and areas with lots of fine detail tend to look too "nerveous".

Your permission granted, I'll come up with a modification of DetailIllusion in the next few days ... unless you do it on your own again

- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 27th August 2003, 11:50   #4  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by Didée
Hi mf!

Very fine tools, indeed.

Regarding SharpTools: Well, I feel a little "out-raced" ... Some time ago, I thought "hey, I should try an area sharpener with supersampling". But just before I actually found the time to sit down, you came up with v0.1 of your SharpTools ... must be some form of morphogenetic energy?
SSXSharpen is a VERY old idea. It dates back to more than a year ago. So, sorry .
Quote:

Regarding DetailIllusion: interesting concept (but the name looks very irritating in Arial script ).
One thing I don't like about the current implementation: it acts in the form "the harder the edge, the more noise we add". This is IMHO sub-optimal (but agreed, AviSynth's lack of curve adjustments makes it a pain to simulate exactly that).
The point is, it would be better to add the "noitail" only to the not-so-hard edges, speak: to the areas of soft detail, and to leave the very hard edges alone again, just like the flat areas.
As it is by now, it sometimes just looks like mosquito noise, and areas with lots of fine detail tend to look too "nerveous".

Your permission granted, I'll come up with a modification of DetailIllusion in the next few days ... unless you do it on your own again

- Didée
Well, I've had an idea when I first tested it (before I released it, yes ), to subtract the amplified (you can see I run a few sharpens before I make the edgemask, to amplify small edges) mask with the normal mask, to give hard edges a harder time (lame pun alert ), but seeing that'd slow it down even more, I didn't do it. I could add it later .
mf is offline   Reply With Quote
Old 27th August 2003, 12:46   #5  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Re: Re: New filters: SharpTools and DetailIllusion

Quote:
Originally posted by yaz
@mf:

- can't get it. does it add noise to detailed or to smooth area? (my english is pretty weak:-)
- what is addnoise() in the script? the only thing occurs to me is blockbuster (having this name at born) do u still use that?
- can't blockbuster be tuned to do the task or u don't like bb?
- have u tried addgrain? i like the way it goes.
- why would help a size-up for doing this trick? (presuming, there comes a heavy size-down afterwards)
- It adds noise to detailed areas. If it added noise to flat areas, it would just look like film grain.
- AddNoise is one of SansGrip's filters - they were the only ones I could find when I looked for a noise filter.
- SansGrip's filter page is quite confusing. It looked like all filters did the same thing, so I just grabbed one randomly.
- I've just heard of it today, and I think I'll make a version 0.2 that uses it instead of AddNoise (AddNoise is legacy 2.0x anyway, so that's a good reason for not using it).
- You misinterpreted my words . I meant that it works good if you're trying to make a small source bigger (like say you have a low-res VCD, and want to blow it up to DVD resolution, DetailIllusion might make it look better).
Quote:

PS
whooa ... the best expression i've ever heard. for me, it is the main reason.
Thanks . But it's not about the expression, it's about the effect .
mf is offline   Reply With Quote
Old 27th August 2003, 13:59   #6  |  Link
yaz
n00b ever
 
Join Date: May 2002
Posts: 627
Re: Re: Re: New filters: SharpTools and DetailIllusion

@mf
thx! it's getting clear:-)

blockbuster: leave sansgrip's h.p., he's away:-(( the avs2.5 compliant version is at www.avisynth.org/~warpenterprises. it does really worth a try. last night i tried to implement your idea with it (& wout masking which is hella slow) it made sg but it was too late for a thorough test.
addgrain: trbarry's released a bugfix for that, see his h.p.!

the bests
y

Last edited by yaz; 27th August 2003 at 14:04.
yaz is offline   Reply With Quote
Old 14th September 2003, 15:21   #7  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
OK, since ppl don't seem to be so interested in my sharptools, I'll show you a nice horny screenshot of SharpResize() in action. This is as you might be able to recognize from Onegai Twins.
http://mf.creations.nl/hornyresize.png

Now is that nice or nice .
mf is offline   Reply With Quote
Old 16th September 2003, 23:40   #8  |  Link
APF_Gandalf
Registered User
 
Join Date: Mar 2003
Location: France
Posts: 47
I'll be interested if I could download it ;p
seems all the nabeshin.ddo.jp... links are dead.
APF_Gandalf is offline   Reply With Quote
Old 17th September 2003, 11:08   #9  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Oh yeah. Find them on http://mf.creations.nl/avs/functions/.
mf is offline   Reply With Quote
Old 17th September 2003, 18:56   #10  |  Link
APF_Gandalf
Registered User
 
Join Date: Mar 2003
Location: France
Posts: 47
thanks, I'll give it a try on my next encode
APF_Gandalf is offline   Reply With Quote
Old 23rd September 2003, 10:10   #11  |  Link
killerhis
ENcODeR
 
killerhis's Avatar
 
Join Date: Mar 2003
Posts: 93
OK I've tested those filters.. dahm why didn't I do it before

Detailillusion.. don't like it yet.. not getting much detail back for that filesize.... sharpresize looks impressive, but still liking bilinearresize.. but SSXSharpen() whooo

Gives better results then awarpsharp and xsharp combined (my settings) and filesize is like only 0.5% bigger then with awarpsharp and xsharp... and as far I can see.. no more sharping artifacts on the edges..... I LOVE THIS FILTER.. maybe you get a new update soon.. with more paramerters and options

Maybe you can also get detailillusion working nice at lower bitrate

keep the job MF
killerhis is offline   Reply With Quote
Old 23rd September 2003, 19:32   #12  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
I just tried the sharpresize and I must say, it's amazing! I doubt I will ever have a use for it, because I haven't seen low resolution files in ages, but still, its amazing
There's GOT to be some way to speed up the supersampling process though... or perhaps build an efficient supersampling method directly into xsharpen... or maybe some smart coder out there could find a way to reproduce the results of this without having to resort to supersampling. This is a powerful filter, I hope someone could look into it some more.
Zarxrax is offline   Reply With Quote
Old 24th September 2003, 11:48   #13  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by Zarxrax
I just tried the sharpresize and I must say, it's amazing! I doubt I will ever have a use for it, because I haven't seen low resolution files in ages, but still, its amazing
There's GOT to be some way to speed up the supersampling process though... or perhaps build an efficient supersampling method directly into xsharpen... or maybe some smart coder out there could find a way to reproduce the results of this without having to resort to supersampling. This is a powerful filter, I hope someone could look into it some more.
There is an idea floating around for this (it was Gldm's idea). It's called the "piecemeal supersampler", which basically speeds up supersampling by sizing small pieces of the frame at a time, that fit into the processor cache. Moving around 7MB frames through the CPU is the main culprit for the slow speed. The pieces overlap for image quality. However, nobody's been interested in coding it.
mf is offline   Reply With Quote
Old 24th September 2003, 14:19   #14  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
... In fact, I started scripting this weeks ago, by the time I shouted to do something about detailIllusion.
In the meantime, I got heavily side-tracked by "Restore24". However, already with a simple 2*2 tiling, I got something like a 8% speed-up on my old Athlon700.
The problem is, the smaller you make the tiles, together with overlapping & additional function calls, the more overhead is produced at the same time.
Is overlapping really necessary? Depends on how XSharpen processes the borders - I didn't test that thoroughly.

- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 24th September 2003, 16:41   #15  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
I don't really think you can script this effectively in AVISynth. I'd like to know how you managed to do it though, as I'd say you need loops, which AVS doesn't have.
mf is offline   Reply With Quote
Old 24th September 2003, 17:02   #16  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
... with a simple 2*2 tiling ...
...and 4*4 tiling I tried as well, this is no magic at all: define the number of tiles, and with some calculations, do the cropping, upsizing, filtering, downsizing, and stacking.
Even a recursive function could be done, if you were thinking of something like that.
But you're perfectly right: It is not efficient to do all that by scripting, this should definetly be done by a nifty little plugin.
By scripting you will, from a certain point, loose more time through overhead than you are gaining from reducing the active processed frame size.
However, it was plain fun to try it - and as I said, it got indeed somewhat faster. Not by much, but if you send your PC to a 100-hours-encoding-journey, 8% gain are as much as one day office work (And I do prefer the days I am NOT in office.)

- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 25th November 2003, 13:01   #17  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Diggin' out this thread


@ mf

Technical question about XSharpen (WarpSharp.dll):

Do you know if it works just the same way as Donald's XSharpen for Vdub? 'Cause in my experience, these three XSharpens: *Vdub, *WarpSharp.dll, *ffdshow -- they all behave somewhat different...

My concern is: what size is the "window" that's running over the frame? Do you have any clue?

- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 25th November 2003, 13:26   #18  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
I believe the only differences (I can't code so I can't check out the source) between the different versions is:
VDub's XSharpen: works in RGB so the luma conversion might be different.
Japanese Warpsharp.dll: Works in YV12 only but is closest to the VDub version.
sh0dan's Warpsharp.dll: Has an assembly bug somewhere causing unoptimal results.
ffdshow's XSharpen: Don't know much, but I have a feeling this is the same one as sh0dan's warpsharp.dll.
mf is offline   Reply With Quote
Old 25th November 2003, 20:22   #19  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
What exactly is the difference between SSXSharpen and mfToon? Also, when is it better to use one over the other (barrying speed reasons)?

I don't seem to be able to view the resize comparison, how much sharper than lanczos is SSXResize? How do they compare speedwise?
Chainmax is offline   Reply With Quote
Old 25th November 2003, 21:36   #20  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Resizecomparison is now up here:
http://mf.creations.nl/resizecomparison.png

mfToon is better when cartoon lines are vague and less-defined.
As for speed, try it yourself.
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 16:57.


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