digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Motion adaptive filtering now possible? (http://www.digitalfaq.com/archives/avisynth/3594-avisynth-motion-adaptive.html)

kwag 05-31-2003 01:02 PM

Quote:

Originally Posted by rendalunit
Quote:

Originally Posted by kwag
Right now I'm looking with Vdub at the value that is assigned to val on every scene change. It's usually above 3.

8O 8O way higher than 3 (like ~35-200). I wonder why the numbers you're talking about are so low :?: Are those numbers the YDifferenceFromPrevious divided by a constant?

btw- i'm using 528x480 in case it's because of using different resolutions

thnx,
ren

It's because of the line "ScriptClip("val=YDifferenceFromPrevious()/14.55" :) I'm testing on 704x480 resolution.
I'm getting a difference of ~3.x from previous scene to next scene on a scene change.

-kwag

Gaudi 05-31-2003 03:00 PM

I think I may be missing something.
How can I do to include this conditional filter into my script.
Should I download a new .dll?
or just using the provided optimal script will do?

Many thanks.


Gaudi

kwag 05-31-2003 03:07 PM

Quote:

Originally Posted by Gaudi
I think I may be missing something.
How can I do to include this conditional filter into my script.
Should I download a new .dll?
or just using the provided optimal script will do?

Many thanks.


Gaudi

Just install AviSynth 2.51 (Follow sh0dan's signature) and use the posted script for avisynth 2.51.
And stay tuned in this thread, because more changes WILL be coming soon ;)

-kwag

Gaudi 05-31-2003 03:18 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by Gaudi
I think I may be missing something.
How can I do to include this conditional filter into my script.
Should I download a new .dll?
or just using the provided optimal script will do?

Many thanks.


Gaudi

Just install AviSynth 2.51 (Follow sh0dan's signature) and use the posted script for avisynth 2.51.
And stay tuned in this thread, because more changes WILL be coming soon ;)

-kwag

Thanks Kwag.

You bet I will.

Gaudi

ovg64 05-31-2003 03:21 PM

What kind of changes may i ask :?:
another :?: what happen if i put the line
MergeLuma(blur(0.2)) in front of the bilinear adaptive script line?
will it work like it suppose to?

kwag 05-31-2003 04:05 PM

Quote:

Originally Posted by ovg64
What kind of changes may i ask :?:
another :?: what happen if i put the line
MergeLuma(blur(0.2)) in front of the bilinear adaptive script line?
will it work like it suppose to?

I would add mergeluma(blur(0.1) as a static filter, and leave higher values as dynamic with the adaptive function.
Go ahead and add it :!, it will then make the MIN sustained value of 0.2 instead of close to 0 as it is now.
So the script should read something like this:

Code:

MaxTreshold=1.58

UnFilter(50, 50)
BicubicResize( Your_Resize_Values_Here )
STMedianFilter(8, 32, 0, 0 )
TemporalSoften(2,7,7,3,2) # Experimental!
mergechroma(blur(1.50)) # Static filtering
mergeluma(blur(0.1)) # Static filtering
## Dynamic linear adaptive filtering ##
ScriptClip("val=YDifferenceFromPrevious()/14.55" + "val > MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( val ))")
##
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
#AddBorders( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()

Now the file size will be even smaller that before :D

Edit: The changes to come are to detect scene changes, and avoid abrupt changes in blur, which cause slight "blinks" on some sporadic frames.

-kwag

audioslave 05-31-2003 04:47 PM

Is there a way of getting rid of Gibbs in this excellent new script? Like the Dust filters... I know the Dust filters don't work in AviSynth 2.5* but are there any similar filters that work in the same way as FaeryDust for example?

ovg64 05-31-2003 05:38 PM

The only other noise filter i know other than STM for 2.51 is Deen witch is works like Convolution 3D and give you even a smaller file size when use it with STMedian. :)

Ex. deen("a3d",1,10,12)

audioslave 05-31-2003 05:47 PM

@ovg64

Thanx! I'll try it out right away! :wink:

jorel 05-31-2003 05:48 PM

8)

great news from sh0dan:
"No "Cannot locate decompressor (YV12)" messages."
and tons more with...

AviSynth 2.5.2 Released!

http://www.kvcd.net/forum/viewtopic.php?p=28135#28135

ovg64 05-31-2003 05:59 PM

Quote:

Originally Posted by jorel
8)

great news from sh0dan:
"No "Cannot locate decompressor (YV12)" messages."
and tons more with...

AviSynth 2.5.2 Released!

http://www.kvcd.net/forum/viewtopic.php?p=28135#28135

Well here we go again, time to Download again .
yet another faster version?


Thanks Jorel :wink:

jorel 05-31-2003 06:06 PM

of course my friend,
see some ...

Optimizations:
* Added MMX RGB24->YUY2 conversion.
* Minor changes to existing RGB32 -> YUY2 MMX.
* Minor speedup to ISSE limiter.
* Added SoftWire dynamic compiled horizontal resizer.
Approximately 10-15% faster - maybe even more on P4.

:)

*otimizations copied from shOdan post

http://www.kvcd.net/forum/viewtopic.php?p=28135#28135

kwag 05-31-2003 10:04 PM

Motion Adaptive Filtering with Scene Change Detection Done!
 
Enjoy :D

Code:

## DLL Section ##
#
LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\UnFilter.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.58
scd_trigger = 1.0 # Scene change trigger value.
cf = 0 # Current frame.
lf = 0 # Last frame
#
####

## Main section and static filters ###
#
Mpeg2Source("Your_D2V_Source_Here")
UnFilter(50, 50)
BicubicResize( Your_Resize_Values_Here )
STMedianFilter(8, 32, 0, 0 )
TemporalSoften(2,7,7,3,2) # Experimental!
MergeChroma(blur(1.50))
MergeLuma(blur( 0.1))
#
####

## Dynamic linear adaptive filters and scene change detection ##
#
FrameEvaluate("lf = YDifferenceFromPrevious()/16")
FrameEvaluate("cf = YDifferenceToNext()/16")
ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0.1 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
#AddBorders( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()
#
####

Sample here: www.kvcd.net/new-scene-change.mpg
Load it in vdub, and you'll see the show :mrgreen:
"Flashes" are now permanently gone bye bye 8)

*** PLEASE, TEST THIS, SO I CAN UPDATE THE CURRENT SCRIPT !!! ***
I won't update it until I get more feedback, and that it's all working right for you too 8)
Then we can go on and build more filteres "hocked" into this :!:

-kwag

ovg64 05-31-2003 10:34 PM

Y just tried it K and it works find .

Good Deal 8)

kwag 05-31-2003 10:38 PM

Quote:

Originally Posted by ovg64
Y just tried it K and it works find .

Good Deal 8)

Try it again. I forgot to add a line: ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")
I just edited the post :!:

-kwag

rendalunit 05-31-2003 10:43 PM

Hi kwag,

The scene change detection was perfect in your 'city by the sea' sample :D
Do you still have the script that will add those subtitles? I'd like to do some testing too and those subs would be very helpful- i tested a script with evaluation of next frame yesterday and the encoding time doubled! 8O I'm going to try this one now 8)

Thanks!
ren

kwag 05-31-2003 10:47 PM

You bet ren :D

Code:

LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\UnFilter.dll")
LoadPlugin("C:\Filters25\BlockBuster.dll")

MaxTreshold=1.58
scd_trigger = 1.0
scd="!!!!Scene Change Detected!!!!"
noscd="Normal Frame"
cf=0
lf=0

Mpeg2Source("K:\DVDbot\CITY_BY_THE_SEA\VIDEO_TS\sea.d2v")

UnFilter(50, 50)
BicubicResize(672, 448, 0, 0.6, 0, 0, 720, 480)
STMedianFilter(8, 32, 0, 0 )
TemporalSoften(2,7,7,3,2) # Experimental!
MergeChroma(blur(1.50))
MergeLuma(blur( 0.1))

## Dynamic linear adaptive filtering ##
FrameEvaluate("lf = YDifferenceFromPrevious()/16")
FrameEvaluate("cf = YDifferenceToNext()/16")
ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0.1 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")

ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? Subtitle(noscd,1,60) : Subtitle(scd,1,60)")
ScriptClip("Subtitle(String(cf),1,30)")

I didn't use add borders because I wanted to see the full frame 8)

-kwag

kwag 05-31-2003 10:51 PM

It's beer time :mrgreen: :drink:

ovg64 05-31-2003 10:53 PM

Just did a 501 frame clip output 4697Kbs same size looks as well
I must be too tire to see any difference :tongue2:

Good Deal man

Aren't you going to update that sucker up there K?, i mean the Optimal cript. :wink:

jorel 05-31-2003 11:05 PM

Quote:

Originally Posted by kwag
It's beer time :mrgreen: :drink:

one more beer for you dear friend.

i did using ToK:
Total Frames: 1001
Total Time : 00:00:33

Encoding... CQ : 65,000
Final Encoded Size: 5.725.261
Total Time (all operations): 00:01:50

my system is "tired", long time without reboot,
but the result is cool with clear details, very sharp.
:D

i download the sample too and i'm impressed with
the quality, the color of skin face, the "tunnel",
the broken glasses in the floor and
the "dimension" along the stairs. 8O

8)

yes, it's beer time :!:
:wink:


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

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.