Quantcast Avisynth: Motion Adaptive Filtering Now Possible? - digitalFAQ.com Forums [Archives]
  #1  
05-13-2003, 01:46 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Source: http://forum.doom9.org/showthread.php?s=&threadid=52989

All I can say is

Has anyone here seen this yet? I'm currently working with this script to try to figure out just exactly how it works, but it looks pretty good. Could motion adaptive filtering be the next step in the evolution of KVCD?

From the NoMoSmooth README:
Quote:
The great thing about temporal smoothers is that they do a fantastic job getting rid of noise when you set them up just right, but they can also generate some very ugly artifacts, particularly when dealing with motion. Spatial smoothers, on the other hand, can be quite destructive to the details in your image, but are great with high-motion areas because those have few details and are moving too quickly to notice artifacts anyway. Ideally, then, one would like to apply a temporal smoother to relatively static areas and a spatial smoother to moving ones.
So it now seems that if this script works like it appears to, we can do precisely that, and more. I like to use a temporal smoother at a setting of around 2 for my VHS captures to stabilize solid areas like blue sky backgrounds, but I find that the detail is so poor to begin with in VHS sources that a temporal smoother totally kills any motion scenes. So now apparently I can use a temporal smoother on low motion scenes, and leave the rest alone since I don't want any smoothing (temporal or spatial) on motion scenes.

Ideas, anyone?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
05-13-2003, 05:32 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
This is an excelent idea We can have control, and maybe even using heavy filtering on high motion parts by adding stronger filters on action parts. Even increasing the mergeluma value on motion, because on motion there's not much detail visible anyway, we can blur much stronger
Even the actual "current script" can be used in two parts or three parts. I mean a low to medium action bracket values and a medium to high action bracket values
Actually, if it's possible, the best (and ideal!) way would be to change the filter values dynamically on a scale, where the higher the action, the higher the filter values are automatically applied
This way we get a dynamic range of values applied to the movie being encoded automatically

-kwag
Reply With Quote
  #3  
05-13-2003, 09:35 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Well, it's still a very cool filter, but there are some downsides.....

As near as I can tell, it depends on the new conditional filter function in the latest AVISynth 2.51 binaries, which according to sh0dan...
Quote:
Note that this is a completely new feature and most likely still contain bugs!
http://forum.doom9.org/showthread.php?s=&threadid=50105

It requires YV12 input, which I suppose is OK if you're ripping DVDs and aren't attached to any old YUY2 filters like dust. But I do mostly analog captures, which means that I capture in HuffYUV and that dust is pretty much a requirement for me, so I'm looking at a lot of ugly colorspace conversions.

HuffYUV -> YV12 -> Filter_Motion function -> YUY2 -> Dust -> YV12.

The script seems to work great as long as you use it as-is with all YV12 filters. But for some reason the colorspace conversions (or dust, or both) are introducing some REALLY weird stuff. Every few seconds it will insert one or two frames from a previous scene and then return to the proper point in the sequence.

I also get VDub crashes if I use anything other than 0 for the cropping values.

I've been looking at it all day, and I'm only now beginning to understand what it does a little bit. If this turns out to be the Next Big Thing(TM), it pretty much means a wholesale move to 2.51 and pure YV12 for everybody, and I don't think we're ready for that until some filter developers get on the ball with YV12 support.

[edit] I figured it out. I was using Pixiedust for high motion and FaeryDust for low and medium motion. There can only be 1 instance of dust in a script, and apparently the 3 functions were treating it like 3 instances of dust. So I guess dust can't be one of the conditional filters. And moving it up to the main script cut out a lot of those conversions.
Reply With Quote
  #4  
05-13-2003, 10:52 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
I'm still keeping away from avisynth 2.5x
It's just not stable enough
I would really like to see this filter working with the "current script", which is just mergechroma and mergeluma. Simply applying a higher value on mergeluma on high action scenes. This will lower the file size because it will really blurr the image, but the image wouldn't have any detail anyway on a high speed scene So maybe the script simplified a little, might just get us started playing with this

-kwag
Reply With Quote
  #5  
05-14-2003, 06:20 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
@ KWAG !
I just found this article .
Sounds very promissing , hah...
Did u tryed it already.
If u tryed what was a result ? Is it working as have to ???
I'll try it when I'll come back from work until then whanted some more info if it's possible
bman
Reply With Quote
  #6  
05-14-2003, 08:36 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by bman
...
Did u tryed it already.
No, and I guess someone else will have to try it, because I'm not running avisynth 2.5x
Until I see less problem reports on newer versions, I'll stick to the tried and tested 2.08

-kwag
Reply With Quote
  #7  
05-14-2003, 09:07 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Guys !
We have new challenge in here !
Who is running Avisynth 2.5 ? Could u try this script and see if it's working as promissed ?
Cuz there is french forum
http://atlas2.tgv.net/~media-video/f...pic.php?t=2267
and there is ( I don't speack French but assume ) more advanced script that looks interesting too .
Someone with AVS v2.5
bman
Reply With Quote
  #8  
05-14-2003, 08:04 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, I have tried it with dust and C3D on analog captures, and it seems to work exactly as advertised.

However, I'm having some trouble implementing the KVCD script because 2.5 stmedianfilter has different paramaters than the 2.0x version, there is no temporal smoother in 2.5, and I can't get the syntax right to put mergechroma and mergeluma in the functions. If you guys will help me get the YV12 equivalent of the current script, I will be the guinea pig.

This is what I'm using right now:

Quote:
##### Set Variables #####
# Source: Path to the source
# Top: Pixels to crop from the top
# Bottom: Pixels to crop from the bottom
# Left: Pixels to crop from the left
# Right: Pixels to crop from the right
# Width: Target width
# Height: Target height
# Start: First frame
# End: Last frame


Source = "Z:\Planet of the Apes.d2v"

threshold_sm = 5
threshold_hm = 15

Top = 0
Bottom = 0
Left = 0
Right = 0

Width = 544
Height = 480

Start = 0
End = 0

##### Main Script #####
clip = Mpeg2Source(Source)
clip = LanczosResize(clip, Width, Height)
clip = Crop(clip, Left, Top, -Right, -Bottom)
clip = Trim(clip, Start, End)
clip = STMedianFilter(clip, 10, 30, 0, 0)
clip = unfilter(clip, 50,50)
clip = TemporalSoften(clip, 2,3,3,scenechange=10,mode=2)
clip = Filter_Motion( clip, Width, Height, threshold_sm, threshold_hm)
clip = AddBorders(clip, Left, Top, Right, Bottom)
clip = Limiter(clip)

return clip

####################
##### Functions #####
####################

### High motion filtering
function Motion_High( clip High, float X, float Y)
{
High = mergechroma(High, blur(1.50))
High = mergeluma(High, blur(0.2))
Return High
}

### Medium motion filtering
function Motion_Medium( clip Medium, float X, float Y)
{
Medium = mergechroma(Medium, blur(1.50))
Medium = mergeluma(Medium, blur(0.2))

Return Medium
}

### Low motion filtering
function Motion_Low( clip Low, float X, float Y)
{
Low = mergechroma(Low, blur(1.50))
Low = mergeluma(Low, blur(0.2))
Return Low
}

### Detect high, medium, or low motion
function Detect_Motion( clip detect, clip Low, clip Medium, clip High, float threshold_sm, float threshold_hm)
{
global Courant_fr = detect
global Next_fr = detect.trim(1,0)
output1 = Conditionalfilter( Courant_fr, Low, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", "<", "threshold_sm", false)
output2 = Conditionalfilter( Next_fr, output1, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", "<", "threshold_sm", false)
output3 = Conditionalfilter( Courant_fr, High, output2, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", ">", "threshold_hm", false)
output4 = Conditionalfilter( Next_fr, output3, output2, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", ">", "threshold_hm", false)
return output4
}

### Filter the scene based on motion
function Filter_Motion( clip filter, float X, float Y, float threshold_sm, float threshold_hm)
{
Low = Motion_Low( filter, X, Y)
Medium = Motion_Medium( filter, X, Y)
High = Motion_High( filter, X, Y)
output = Detect_Motion( filter, Low, Medium, High, threshold_sm, threshold_hm)
return output
}
As you can see, I have the same mergeluma and mergechroma values in all the functions. I want to get it working before I start playing with the values. Using this script, I get an error about illegal options in the blur functions. I have also tried it with the following syntaxes:

Medium = mergechroma(Medium, blur(Medium, 1.50))

Medium = mergechroma(blur(Medium, 1.50))

So what's wrong with my mergeluma and mergechroma functions?
Reply With Quote
  #9  
05-14-2003, 08:47 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi sbin,

Maybe you have to change all the functions to read like this:

Code:
### High motion filtering
function Motion_High( clip High, float X, float Y)
{
High = mergechroma(blur(1.50))
High = mergeluma(blur(0.2))
Return High
}


-kwag
Reply With Quote
  #10  
05-14-2003, 09:06 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Oh yeah... I guess I should have mentioned that was the first way I tried it.

No matter how I set it, I get

Quote:
AVISynth open failure:
Script error: Invalid arguments to function "blur"
On lines 67, 87, and 37.

Man, where is sh0dan when you need him. I think I will post this over at Doom9 since most of the heavy-duty AVIsynth people are there. I just registered an account, but I have to wait 3 days to post.
Reply With Quote
  #11  
05-14-2003, 09:36 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sbin

Man, where is sh0dan when you need him.
Send him a PM here

-kwag
Reply With Quote
  #12  
05-14-2003, 09:57 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
After analyzing this filtering logic, this is going to be a SLOOOOOOOOOOOOOOOWWWWW process
This scheme works on a frame-by-frame basis, and in theory it will work, but it's going the slowest encode of all times
I'm not so sure if it's worth it

-kwag
Reply With Quote
  #13  
05-15-2003, 01:01 AM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
I had thought so too, but it's actually surprisingly quick. Just for comparison purposes, I did a little test with Planet of the Apes TV series at 544x480 full frame. I created an intermediate AVI file with VDub using fast recompress to HuffYUV just to see how fast the script is. When I comment out the line

clip = Filter_Motion( clip, Width, Height, threshold_sm, threshold_hm)

in the main script above and use no conditional filtering at all, it runs at about 19/20 fps on my Athlon T-bird 1.3.

For the conditional filtering test, since I can't get the blurring syntax right, I substituted the C3D values given in the script posted at Doom9. I figure C3D is a reasonably fair comparison for speed purposes. With conditional C3D filtering, it runs at 13/14 fps. Using conditional filtering with empty motion filter functions, it runs at about 17fps. So the actual conditional filtering hit appears to be pretty small.

Using dust in an old-style script gives me about 5/6 fps. So I think this is certainly within the realm of acceptability. At least for me.
Reply With Quote
  #14  
05-15-2003, 08:43 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sbin
So I think this is certainly within the realm of acceptability. At least for me.
Yes it is I thought it was going to be slower. I guess the problem with the mergeX functions is that you can't have multiple instances running
Similar to the xDust filters. I guess I should read more on the AviSynth's web site
I guess it all boils down to the function family "XDifferenceFromPrevious" that is available on AviSynth 2.5x
If it was available on 2.0x, we could use it just by adding it to the current script. I guess I'll take a look at this today, by switching to avisynth 2.51 and trying this out. This really opens up a world of possibilities
Just like I had conditional filter strength calculated for BlockBuster filter depending on the resolution to be used, this could also be automated to apply BlockBuster "noise" to low lit scenes, but lower the noise value if there's movement . Really a "Dynamic" avisynth script

-kwag
Reply With Quote
  #15  
05-15-2003, 10:47 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Quote:
Originally Posted by sbin
So I think this is certainly within the realm of acceptability. At least for me.
Yes it is I thought it was going to be slower. I guess the problem with the mergeX functions is that you can't have multiple instances running
Similar to the xDust filters. I guess I should read more on the AviSynth's web site
I guess it all boils down to the function family "XDifferenceFromPrevious" that is available on AviSynth 2.5x
If it was available on 2.0x, we could use it just by adding it to the current script. I guess I'll take a look at this today, by switching to avisynth 2.51 and trying this out. This really opens up a world of possibilities
Just like I had conditional filter strength calculated for BlockBuster filter depending on the resolution to be used, this could also be automated to apply BlockBuster "noise" to low lit scenes, but lower the noise value if there's movement . Really a "Dynamic" avisynth script

-kwag
OK , Now u are talking !!!
That's the spirit and bacause of that we are here master KWAG !
bman
Reply With Quote
  #16  
05-15-2003, 03:43 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, gang. After a false start earlier today, I now have a working script that does motion adaptive luma and chroma blurring and some preliminary results to report. It's not the prettiest script, but it does work.

Quote:
##### Set Variables #####
# Source: Path to the source
# Top: Pixels to crop from the top
# Bottom: Pixels to crop from the bottom
# Left: Pixels to crop from the left
# Right: Pixels to crop from the right
# Width: Target width
# Height: Target height
# Start: First frame
# End: Last frame


Source = "Z:\SPYLVESE\spy.d2v"

threshold_sm = 5
threshold_hm = 15

Top = 0
Bottom = 0
Left = 0
Right = 0

Width = 544
Height = 480

Start = 0
End = 0

##### Main Script #####
clip = Mpeg2Source(Source)
clip = LanczosResize(clip, 544,368,5,0,710,480)
clip = Crop(clip, Left, Top, -Right, -Bottom)
clip = Trim(clip, Start, End)
clip = STMedianFilter(clip, 10, 30, 0, 0)
clip = unfilter(clip, 50,50)
clip = TemporalSoften(clip, 2,3,3,scenechange=10,mode=2)
#clip = mergechroma(clip,blur(clip, 1.50))
#clip = mergeluma(clip,blur(clip, .20))
clip = Filter_Motion( clip, Width, Height, threshold_sm, threshold_hm)
clip = AddBorders(clip, 0,56,0,56)
clip = Limiter(clip)
clip = Sampler(clip, length=24)

return clip

#####################
##### Functions #####
#####################

### High motion filtering
function Motion_High( clip High, float X, float Y)
{
High = mergechroma(High,blur(High,1.50))
High = mergeluma(High,blur(High,.60))
Return High
}

### Medium motion filtering
function Motion_Medium( clip Medium, float X, float Y)
{
Medium = mergechroma(Medium ,blur(Medium,1.50))
Medium = mergeluma(Medium ,blur(Medium,.40))
Return Medium
}

### Low motion filtering
function Motion_Low( clip Low, float X, float Y)
{
Low = mergechroma(Low ,blur(Low,1.50))
Low = mergeluma(Low ,blur(Low,.20))
Return Low
}

### Detect high, medium, or low motion
function Detect_Motion( clip detect, clip Low, clip Medium, clip High, float threshold_sm, float threshold_hm)
{
global Courant_fr = detect
global Next_fr = detect.trim(1,0)
output1 = Conditionalfilter( Courant_fr, Low, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", "<", "threshold_sm", false)
output2 = Conditionalfilter( Next_fr, output1, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", "<", "threshold_sm", false)
output3 = Conditionalfilter( Courant_fr, High, output2, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", ">", "threshold_hm", false)
output4 = Conditionalfilter( Next_fr, output3, output2, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", ">", "threshold_hm", false)
return output4
}

### Filter the scene based on motion
function Filter_Motion( clip filter, float X, float Y, float threshold_sm, float threshold_hm)
{
Low = Motion_Low( filter, X, Y)
Medium = Motion_Medium( filter, X, Y)
High = Motion_High( filter, X, Y)
output = Detect_Motion( filter, Low, Medium, High, threshold_sm, threshold_hm)
return output
}
My sample was The Spy Who Loved Me DVD. First, for a control sample, I commented out all conditional filtering and used mergechroma and mergeluma in the main body of the script with the current script values(1.50 and .2, respectively). File size was 15,217k.

Then I removed luma and chroma blurring from the main script and used motion adaptive luma and chroma filtering with the current script values for all three levels to test that the script still worked exactly the same. It did. File size was 15,217k. So I know the script is right and it works properly. Time to play with the values.

Going with Kwag's suggestion earlier, the only value I changed was luma blurring. At high .40, medium .30, and low .20, the file size was 14,979k. Not spectatular, but at least it establishes that it does work.

At higher values of high .60, medium .40, and low .20, file size was 14,808k. Again, not spectacular, but significant. All samples are visually indistinguishable to my eye.
Reply With Quote
  #17  
05-15-2003, 03:53 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sbin

At higher values of high .60, medium .40, and low .20, file size was 14,808k. Again, not spectacular, but significant. All samples are visually indistinguishable to my eye.
That's perfect
Now try a value for luma of 0.2 for LOW, 0.75 for MEDIUM, and 1.5 for HIGH.
See how the file shrinks

-kwag
Reply With Quote
  #18  
05-15-2003, 05:18 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Well, I changed some values in my script and a couple of minor things in TMPGEng, so I can't compare these samples to the ones I did earlier. I changed from Lanczos to Bilinear, did some different cropping, and used a different GOP (I was inadvertently using the KDVD template before).

The control sample with current script values was 13,406k.

The sample with your suggested values was 12,651k.
Reply With Quote
  #19  
05-15-2003, 06:31 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks sbin
Here's a cleaned up (with more to be cleaned!) working script, with the suggested values.

Code:
LoadPlugin("C:\Filters_avisynth25\MPEG2Dec.dll")
LoadPlugin("C:\Filters_avisynth25\STMedianFilter.dll")
LoadPlugin("C:\Filters_avisynth25\UnFilter.dll")


######### Set Variables #########
# Source: Path to the source
# Width: Target width. Take value from resizer line !!! - kwag 05/15/2003
# Height: Target height. Take value from resizer line !!! // -kwag - kwag 05/15/2003
#################################

Source = "K:\DVDbot\DEATH_TO_SMOOCHY\VIDEO_TS\smoochie.d2v"

threshold_sm = 5
threshold_hm = 15
Width = 528
Height = 366

##### Main Script #####

clip = Mpeg2source( Source )
clip = ConvertToYV12( clip )
clip = BicubicResize( clip, 496, 336, 0, 0.6, 6, 0, 708, 480)
clip = STMedianFilter( clip, 10, 30, 0, 0 )
clip = unfilter( clip, 50,50 )
clip = TemporalSoften( clip, 2, 3, 3, scenechange=10, mode=2 )

# Apply filtering depending on motion detection.
clip = Filter_Motion( clip, Width, Height, threshold_sm, threshold_hm)

clip = AddBorders( clip, 16, 72, 16, 72)
clip = Limiter( clip )
#clip = Sampler( clip, length=24 )
return clip

##### End of main script #####

#####################
##### Functions #####
#####################

### High motion filtering ###
function Motion_High( clip High, float X, float Y) {
High = mergechroma(High,blur(High,1.50))
High = mergeluma(High,blur(High, 1.50))
Return High
}

### Medium motion filtering ###
function Motion_Medium( clip Medium, float X, float Y) {
Medium = mergechroma(Medium ,blur(Medium,1.50))
Medium = mergeluma(Medium ,blur(Medium, 0.75))
Return Medium
}

### Low motion filtering ###
function Motion_Low( clip Low, float X, float Y) {
Low = mergechroma(Low ,blur(Low,1.50))
Low = mergeluma(Low ,blur(Low,.20))
Return Low
}

### Detect high, medium, or low motion ###
function Detect_Motion( clip detect, clip Low, clip Medium, clip High, float threshold_sm, float threshold_hm) {
global Current_fr = detect
global Next_fr = detect.trim(1,0)
output1 = Conditionalfilter( Current_fr, Low, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + 

VDifferenceFromPrevious()", "<", "threshold_sm", false)
output2 = Conditionalfilter( Next_fr, output1, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + 

VDifferenceFromPrevious()", "<", "threshold_sm", false)
output3 = Conditionalfilter( Current_fr, High, output2, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + 

VDifferenceFromPrevious()", ">", "threshold_hm", false)
output4 = Conditionalfilter( Next_fr, output3, output2, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + 

VDifferenceFromPrevious()", ">", "threshold_hm", false)
return output4
}

### Filter the scene based on motion ###
function Filter_Motion( clip filter, float X, float Y, float threshold_sm, float threshold_hm) {
Low = Motion_Low( filter, X, Y)
Medium = Motion_Medium( filter, X, Y)
High = Motion_High( filter, X, Y)
output = Detect_Motion( filter, Low, Medium, High, threshold_sm, threshold_hm)
return output
}
I changed some values in the width an height, so that it matches the values of BilinearResize, or whatever resizer is being used. Also, I removed the top, bottom, left and right variables, because we can use the resize, addborders and letterbox for that. Same for the "start" and "end" frame. Those variables and the Crop(clip, Left, Top, -Right, -Bottom) are really verbose. The original script was working on the full frame, so it was actually working on black bars the way it was
Now I'm going to optimize this thing, and see how to automate the blur strength in a linear fashion, instead of three steps (Low, Medium, High). This way, there won't be sharp cut-off transitions between the three areas being worked on. So the "blur" value will work on a linear range between 0.2 to 1.50, depending on the frame activity

Edit: This was tested with AviSynth version 2.51 Build May 15, 2003

-kwag
Reply With Quote
  #20  
05-15-2003, 06:40 PM
sbin sbin is offline
Free Member
 
Join Date: May 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
The original script was working on the full frame, so it was actually working on black bars the way it was
Yeah, that was the cropping issue I mentioned that I changed.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Dynamic Linear Adaptive Filtering and Scene Change Detection supermule Avisynth Scripting 3 09-15-2006 01:45 AM
Avisynth: Message from linear motion adaptive filtering? holgerschlegel Avisynth Scripting 7 08-27-2003 04:08 AM
Avisynth: Help with Linear Motion Adaptive Filtering pitoman Avisynth Scripting 2 08-05-2003 12:51 PM
Avisynth: Motion adaptive filtering good enough? bicho_visacoso Avisynth Scripting 6 06-15-2003 06:30 AM
Avisynth: AVS 2.5x Script, Motion Adaptive Filtering problems? Bchteam Avisynth Scripting 15 05-31-2003 12:38 PM

Thread Tools



 
All times are GMT -5. The time now is 12:12 PM  —  vBulletin © Jelsoft Enterprises Ltd