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 3rd January 2011, 15:03   #381  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Luckily I only need an 8bit random number today.
At some point, the thing you really need is a compiler.
__________________
- 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 3rd January 2011, 15:59   #382  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
lol, true, true
It's a long term thing, steep learning curve. I find scripting more productive in general, because of the write/test cycle.
A compiler can't keep up with the rate I generate ideas - you're inspired for a week, and that's all you got to get something done.

Last edited by jmac698; 3rd January 2011 at 16:05.
jmac698 is offline   Reply With Quote
Old 3rd January 2011, 18:15   #383  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
If you want a rand, use mt_lutxy(clip, clip.addgrain).
__________________
Manao is offline   Reply With Quote
Old 3rd January 2011, 19:11   #384  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Quote:
Originally Posted by jmac698 View Post
I'm working on dithering.
Maybe you would be interested by my dithering package? See my signature below.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 3rd January 2011, 22:08   #385  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Remember when dealing with "random" elements in frame data the frame data must be the same every time you generate that frame.

Very early versions of addgrain() just grabbed a new random sequence for every GetFrame(N) call independant of N. This caused strange behaviour when accessing the same frames multiple times and only some were able to be cached. The fix was to remember the random key for each frame N, such that whenever frame N was rendered the exact same results could be returned.

Manao's solution, mt_lutxy(clip, clip.addgrain), is a good one because addgrain() is now well behaved and you get different randomness for each frame, but a given frame is always the same.

Remember all the mt_lux* are using static Look Up Tables that are created once in the filter constructor (compile time) and reused very fast in the GetFrame calls (run time). So having rand in the expression would still have the same LUT for every frame, which I suspect would be not quite what would be wanted. And as an added bonus for confusion repeated runs of the same script might produce different random results.
IanB is offline   Reply With Quote
Old 19th January 2011, 03:33   #386  |  Link
Mini-Me
Registered User
 
Join Date: Jan 2011
Posts: 121
Hey, can anyone point me to the documentation for mt_lutspa? It's not in the Readme with masktools-v2.0a48, and it's not at http://manao4.free.fr/MaskTools.htm or http://manao4.free.fr/mt_masktools.html. I've done a search on this forum, but the most I've found is a debate in this thread over placement of the "relative" parameter.

EDIT: I've pretty much figured it out now, but it'd still be nice to see the documentation so I can learn some more of the options.

Last edited by Mini-Me; 19th January 2011 at 06:22. Reason: To cut out some of the crap
Mini-Me is offline   Reply With Quote
Old 19th January 2011, 08:23   #387  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
There's an up to date mt_masktools.htm bundled in the zip package, in the directory masktools/documentation. I'll take care to place it in the root directory in the next releases.
__________________
Manao is offline   Reply With Quote
Old 19th January 2011, 08:43   #388  |  Link
Mini-Me
Registered User
 
Join Date: Jan 2011
Posts: 121
Quote:
Originally Posted by Manao View Post
There's an up to date mt_masktools.htm bundled in the zip package, in the directory masktools/documentation. I'll take care to place it in the root directory in the next releases.
Thanks, Manao!
Mini-Me is offline   Reply With Quote
Old 9th February 2011, 18:57   #389  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
with mt_edge, how can I shift one pixel without degrading chroma?

I use:
Code:
move = "
0 0 0 
0 0 0 
0 0 1 1"
mt_edge(move,0,255,0,255,U=3,V=3)
But chroma misaligns.

Also there is a possibility that mt_edge would leave black pixels when shifted?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 9th February 2011, 19:33   #390  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
If you want to do it with mt_edge, do
Code:
move_luma = "
0 0 0 
0 0 0 
0 0 1 1"
move_chroma = "
0 0 0
0 1 1
0 1 1 4"
mt_edge(move_luma,0,255,0,255,Y=3,U=2,V=2).mt_edge(move_chroma,0,255,0,255,Y=2,U=3,V=3)
You could also use one of the resize function of avisynth (they have crop parameters that ought to do what you want too).
__________________
Manao is offline   Reply With Quote
Old 9th February 2011, 19:45   #391  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Thanks! it was worth asking as I see. Im mainly doing so to avoid resizing.
Now its aligned but I guess degrading can't be avoided.

What about the black border?


EDIT: upss! the chroma subsampling, got it.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 9th February 2011 at 20:00.
Dogway is offline   Reply With Quote
Old 13th February 2011, 19:38   #392  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
İs it possible to add the laplacian-gaussian edge detection method in mt_edge function ?
Nephilis is offline   Reply With Quote
Old 13th February 2011, 23:52   #393  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Code:
blur(1).mt_edge("laplace")
__________________
- 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 16th February 2011, 01:11   #394  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Manao View Post
I've added trunc, ceil, floor (round already existed), left & right shifts (signed and unsigned), and @ can be used instead of °.
None of these new operators seem to be recognised by mt_polish().
trunc, ceil and floor are also missing from the body of the documentation (but are mentioned in the changelog).
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 16th February 2011, 13:30   #395  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
horizontal line mask creation

Hi all!

Please advice how create mask. If one pixel in horizontal line true (255) all pixel line could be true (255).

yup.
yup is offline   Reply With Quote
Old 16th February 2011, 13:39   #396  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Does this work? (Can't try it right now...)

Code:
mask1 = whatever  #  this' the mask with some 255-white pixels in it

mask2 = mask1.mt_lut(Y=-255)
black = mask1.mt_lut(Y=0)

v1=interleave(mask1,black).assumefieldbased.assumetff.weave
v2=interleave(mask2,black).assumefieldbased.assumetff.weave

mt_hysteresis(v1,v2)
separatefields.selecteven.assumeframebased
__________________
- 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 17th February 2011, 07:23   #397  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Quote:
Originally Posted by Didée View Post
Does this work? (Can't try it right now...)

Code:
mask1 = whatever  #  this' the mask with some 255-white pixels in it

mask2 = mask1.mt_lut(Y=-255)
black = mask1.mt_lut(Y=0)

v1=interleave(mask1,black).assumefieldbased.assumetff.weave
v2=interleave(mask2,black).assumefieldbased.assumetff.weave

mt_hysteresis(v1,v2)
separatefields.selecteven.assumeframebased
Didée
It is work.
I am not find full description mt_hysteresis.
Please advice.
yup.

Last edited by yup; 17th February 2011 at 08:28.
yup is offline   Reply With Quote
Old 17th February 2011, 12:56   #398  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Hehe, I never have used mt_hysteresis before. Now, by actually trying it, I get an all-white screen from the above script. Seems that mt_hysteresis forces full expansion for any pixel that's not exactly black. (?)

Code:
thresh = 254  # only pixels brighter than "thresh" will be considered
mask1 = whatever  #  this' the mask with some 255-white pixels in it
mask1a = mask1.mt_binarize(thresh)

mask2 = mask1.mt_lut(Y=-255)
black = mask1.mt_lut(Y=0)

v1=interleave(mask1a,black).assumefieldbased.assumetff.weave
v2=interleave(mask2,black).assumefieldbased.assumetff.weave

mt_hysteresis(v1,v2)
separatefields.selecteven.assumeframebased
Now it gives the expected result.
__________________
- 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 18th February 2011, 14:40   #399  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Didée!
My mask contain 0 or 255 value after call
Code:
SDIad=mt_lutxy(SDI,SDIavg,"x "+THAVG+" y * > x 128 > & 255 0 ?",U=-128,V=-128)
Though I see gray pixel.
yup.
yup is offline   Reply With Quote
Old 18th February 2011, 17:04   #400  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
But my test gave correct result.

Wait - colorspace? Scanline masking smells like VHS capture. VHS capture smells like YUY2. My test was with YV12 video, in Avisynth 2.5.8.
__________________
- 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
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 21:11.


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