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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th June 2006, 22:26   #201  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Hi Manao,
it's again me --- the troublemaker.

I have a suggestion of new feature. Of course, it comes from what I do and I need and I know neither how many other users will appreciate it, nor how difficult to add this feature.

And as you are the judge, I only show what I have in mind.

IDEA: Sometimes there are more values calculated than necessary. Example: I want to calculate range value per each 8x8 block. When I do it with
Code:
mt_luts("range",mt_freerectangle(0,0,7,7)...)
there is calculated 64x more values than necessary, because I need only the first pixel in every block.

SUGGESTION: How about adding another optional common parameter or pair of parameters where would be set which pixels the operation should be applied to. When I should present the maximalistic version, there could be defined repeating cycle in each axis, list of pixels within the cycles to be processed and logical operator between h and v axis.

EXAMPLES:Calculating range for each 8x8 block
Code:
mt_luts("range",mt_freerectangle(0,0,7,7),applyto="h % 8 = (0) & v % 8 = (0)",...)
Calculating avg of 8x8 pixels every 4 pixels horizontaly
Code:
mt_luts("range",mt_freerectangle(0,0,7,7),applyto="h % 4 = (0)",...)
First half of deblock_qed looks like "block, block...". It could look like:
Code:
original.mt_lut(y=-255).mt_lut("0",applyto="h % 8 =(0,7) | v % 8 =(0,7)")
well..sorry for bothering...
redfordxx is offline   Reply With Quote
Old 3rd December 2006, 02:20   #202  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Hi Manao,
today I'll be brief. Would you consider adding a "bias" parameter for mt_convolution like in GeneralConvolution?
Would be useful in cases like
Code:
mt_convolution("0 -1 1","1",bias=128...)
until then I share for those might find useful...

Code:
function rd_convolution(clip o, string "horizontal", string "vertical", bool "saturate", float "total", int "bias", int "y", int "u", int "v")
{
bias=default(bias,0)
rdhorizontal=default(horizontal,"1 1 1")
rdvertical=default(vertical,"1 1 1")
rdsaturate=default(saturate,true)
rdtotal=default(total,1.0)
rdy=default(y,3)
rdu=default(u,1)
rdv=default(v,1)
p=o.mt_convolution(rdhorizontal, rdvertical, bias==0 ? rdsaturate : true, rdtotal, rdy, rdu, rdv)
a=	bias==0 ? p : mt_convolution(o, rdhorizontal, rdvertical, false, rdtotal, rdy, rdu, rdv)
	bias==0 ? p : mt_lutxy(rdsaturate==true ? p : a, a, "x y == y 0 y - ? " + String(bias) + " +",y=rdy,u=rdu,v=rdv)
}

Last edited by redfordxx; 3rd December 2006 at 03:03.
redfordxx is offline   Reply With Quote
Old 16th January 2007, 14:47   #203  |  Link
martino
masktools2 (ab)user
 
martino's Avatar
 
Join Date: Oct 2006
Location: PAL-I :(
Posts: 235
I keep getting "there is no function named DEdgeMask" when trying to use LimitedSharpen and "there is no function named YV12LUTxy" when using aWarpSharpDering.

What am I doing wrong?
martino is offline   Reply With Quote
Old 16th January 2007, 19:14   #204  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Not having both masktools 1 and 2. (Those functions are part of v1.)
foxyshadis is offline   Reply With Quote
Old 16th January 2007, 23:19   #205  |  Link
martino
masktools2 (ab)user
 
martino's Avatar
 
Join Date: Oct 2006
Location: PAL-I :(
Posts: 235
So I need to have both installed...

d'oh
martino is offline   Reply With Quote
Old 22nd March 2007, 21:23   #206  |  Link
AssassiNBG
Registered User
 
Join Date: Mar 2005
Location: Pleven, Bulgaria, Europe.
Posts: 45
Quote:
Originally Posted by martino View Post
So I need to have both installed...

d'oh
You just have to load both dlls into your script. (1.5.8 and 2.0a30)

And now onto my question. I have a function that uses edgemask() from masktools version 1.5.8. Since it is conflicting with fft3dgpu, I would like to modify this function to use mt_edge instead (from mt 2.0a30) I had a look at the documentation, but I couldn't understand much. I've never written a function before, or have paid much attention to the ones I copied from the board.

I hope at least the developer of masktools could help me out.

You can see the fft3dgpu development thread for reference about the problem.
AssassiNBG is offline   Reply With Quote
Old 29th March 2007, 17:26   #207  |  Link
tsp
Registered User
 
tsp's Avatar
 
Join Date: Aug 2004
Location: Denmark
Posts: 807
is mt_polish broken in 2.0a30? It's complaining that spirit parser is not available with this script:
Code:
blackness().converttoyv12()
subtitle(mt_polish("x+y"))
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/

Last edited by tsp; 6th April 2007 at 23:19.
tsp is offline   Reply With Quote
Old 6th April 2007, 22:16   #208  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
masktools 1,2 bugs

colorbars(pixel_type="YV12")
yv12lut() returns a bright green image (expected original image).

mt_lut(yexpr="x 161 = 0 x ?",uexpr="128",vexpr="128",y=3,u=3,v=3)
doesn't work, no test is true for equality. != does work and can be used as a workaround.
jmac698 is offline   Reply With Quote
Old 6th April 2007, 23:17   #209  |  Link
krieger2005
Registered User
 
krieger2005's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 377
equal-sign changed from "=" to "=="
krieger2005 is offline   Reply With Quote
Old 7th April 2007, 04:46   #210  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
agreed, but 1.5.8 still has a bug, but I guess that's irrelevant now.
jmac698 is offline   Reply With Quote
Old 7th April 2007, 06:43   #211  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
By default, yv12lut trash the chroma planes, so their values is random. It's not a bug.

Tsp : noted, next version will have mt_polish back ( i must have disabled it because it was so slow to compile ).

redfordxx : noted too
__________________
Manao is offline   Reply With Quote
Old 12th April 2007, 02:32   #212  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Manao
noted
noted too
Oh, while you're holding the pencil anyway ...

Proposal: New mode for mt_LutS: masking of "pixel's extremity"

Explanation: in a pixel's neighborhood, there's a darkest and a brightest pixel. Then ...

Method1: extremity = abs((pixel-min)/(max-min)-0.5)*2*255
(In the very middle between max and min, extremity is zero. At min and at max, extremity is maximal.)
(Used that several times.)

Method2: extremity = (pixel-min)/(max-min)*255
(Zero extremity gives mask=128. mask=0 means "pixel has 100% extremity @ dark". mask=255 means "pixel has 100% extremity @ bright".)
(Never used this one, but seems feasable, for completeness.)

Several times I found this useful during toying-around, but it's rather laborious to script with the current filters: three values are needed for computing, the complete list goes: one (or 2 or 3) inpand's, one (or 2 or 3) expand's, and three instances of LutXY: a=lutxy(min,max), b=lutxy(pixel,min), mask=lutxy(a,b). A good bunch of filter instances that is.

So I thought, perhaps(!) it is easier(?) when integrated into mt_LutS ... A new mode, "extremity1/2" or whatever, and via "pixels=" one can define the neighborhood that is to search for the local min and max.


Not earthbreaking, not of major importance. Just an idea.
__________________
- 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 23rd April 2007, 16:56   #213  |  Link
Dr.Khron
Registered User
 
Dr.Khron's Avatar
 
Join Date: Oct 2006
Location: Gotham City, USA
Posts: 389
Not sure if this thread is the correct place for this, but here I go...
Been fooling around with VMtoon. (the anime sites tend to rave about its predecessor, MFToon).

Got it all set up and it produced a horrible result: it turned most of the black outlines into white pixels! Hopefully, I'm doing something wrong.



Turning down the power with VMtoon(strength=20) reduced the effect, but then it didn't sharpen either.
Here is my script:
Quote:
LoadPlugin("C:\Program Files\AviSynth 2.5\MyPlugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\MyPlugins\WarpSharp.dll")

import("C:\Program Files\AviSynth 2.5\MyPlugins\vmToon-v0.74.avsi")

#import Mpeg video and correct colors
DGDecode_mpeg2source("D:\Ripping\D2V.d2v")

#De-interlace
edeintted = AssumeTFF().SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted,order=1)
tfm(order=1,clip2=tdeintted).tdecimate(hybrid=1)

#crop
crop( 8, 0, -8, 0)

#Resize
LanczosResize(640,480) # Lanczos (Sharp)

#noise filter
FluxSmoothST(7,9)

vmtoon()
Dr.Khron is offline   Reply With Quote
Old 23rd April 2007, 17:19   #214  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
A few things to test, to see what eliminates the effect.

Remove resizing: ssw=0 & ssh=0
Remove xsharpen: xstren=0
Remove thinning: thinning=0
Remove darkening: strength=0

If only one is missing the white, that'll quickly narrow it down; if it's more, it could be tougher.
foxyshadis is offline   Reply With Quote
Old 24th April 2007, 00:13   #215  |  Link
Dr.Khron
Registered User
 
Dr.Khron's Avatar
 
Join Date: Oct 2006
Location: Gotham City, USA
Posts: 389
vmtoon(ssw=0)
vmtoon(ssh=0)
vmtoon(ssw=0, ssh=0)
Using any of thse returns the same error:
"Resize: Width must be bigger then or equal to 4."

vmtoon(xstren=0)
Result: fixes the problem.

vmtoon(thinning=0)
Seems to make the problem slightly worse.

vmtoon(strength=0)
Seems to fix the problem, but makes the sharpening wierd: the black edge lines break up a little.
Dr.Khron is offline   Reply With Quote
Old 24th April 2007, 08:57   #216  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by Dr.Khron View Post
vmtoon(ssw=0)
vmtoon(ssh=0)
vmtoon(ssw=0, ssh=0)
Using any of thse returns the same error:
"Resize: Width must be bigger then or equal to 4."
I guess using 1 instead of 0 here would be the "do nothing" option...
__________________
now playing: [artist] - [track] ([album])
Leak is offline   Reply With Quote
Old 24th April 2007, 13:53   #217  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Ooops, ss has to be 1, not 0. >.>

So Xsharpen might be overflowing? Hrm. I'll see if I can get that to happen here.
foxyshadis is offline   Reply With Quote
Old 24th April 2007, 16:27   #218  |  Link
Dr.Khron
Registered User
 
Dr.Khron's Avatar
 
Join Date: Oct 2006
Location: Gotham City, USA
Posts: 389
I've now confirmed that:
vmtoon(ssw=1)
vmtoon(ssh=1)
vmtoon(ssw=1, ssh=1)

Do not fix the problem, they only make it worse.

Thanks for all the help, let me know if you need a few frames to check it out.
Would posting screen shots of the output with those different settings help?
Dr.Khron is offline   Reply With Quote
Old 24th April 2007, 22:20   #219  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
I wasn't able to reproduce, but I'm not sure I have the right source to do so. If you could replace vmtoon() with ImageWriter(file="x:\wherever\sample",start=x,end=y,type="ebmp") where x to y are representative frames, and then zip them up, I can try to find out where it's overflowing.
foxyshadis is offline   Reply With Quote
Old 24th April 2007, 23:38   #220  |  Link
Dr.Khron
Registered User
 
Dr.Khron's Avatar
 
Join Date: Oct 2006
Location: Gotham City, USA
Posts: 389
Here you go:

http://www.mytempdir.com/1307532

It only 3 frames, I wasn't sure if that was enough.
Anyway, if you couldn't reproduce it, its probably somehting to do with my set up. I just did a clean install of everything though, and I was careful to get the latest DLLs...

EDIT:
I tried using an older version, mftoon2 (mfToon-v0.54.avsi), but it keeps telling me that the "Unsharpmask" function cannot be found... I can't this function anywhere. Is it part of an older package I might be missing?

Last edited by Dr.Khron; 25th April 2007 at 03:24.
Dr.Khron 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 17:54.


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