digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: New MA script Version? (http://www.digitalfaq.com/archives/avisynth/6801-avisynth-ma-script.html)

jorel 11-21-2003 11:24 AM

hy all !

in Mon Oct 27, 2003 i post some tests and was waiting (but no one came)
your coments.....please,see what i got using and removing some filters!
(was needed more than a week to do this tests)

http://www.kvcd.net/forum/viewtopic.php?t=7095

if you do some tests(chapters or samples) maybe help to find better results for use in the optimal scripts!

:!:

audioslave 11-21-2003 07:13 PM

So, should we change the last parameters for TemporalSoften to 2,2 instead of 1,1 as it is now? :roll: And what's the difference between the two (2,2 and 1,1)?

incredible 11-21-2003 07:15 PM

@Kwag

I just did a small mod. on the new MA (as metioned in my first 2nd post in here)....
So it performs a permanent Unfiltering like already done in Kwag's new vers. but TempSoften will only perform on static scenes. Just for testing ...
Until now I didn't compared the final size output and Speed on full encoding tests. But a little Sampler based encoding test gave me these results:

- Old MA Script: 12409 Kbyte - 00:03:24

- New MA Script: 12042 Kbyte - 00:03:41

- The modified new MA Script below: 12136 kbyte - 00:03:29
(more filesize but sharper image cause of deleted Merge.. Lines.



Code:

## Main section and static filters ###
nf=0
#
Mpeg2Source("xxxxxxxxxxxxx.d2v")
#
Limiter()
asharp(1, 4)
GripCrop(xxx,yyy)
GripSize(resizer="BicubicResize")
STMedianFilter(3, 3, 1, 1 )
#
#
## Linear Motion Adaptive Filtering ##
#
## Permanent active Unfiltering
## Threshold based Temporasoftening only on static scenes
#
Ts = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
#
ScriptClip("nf = YDifferenceToNext()" +chr(13)+
\"unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)))"+
\"nf <= Ts ? TemporalSoften(round(2/nf), round(1/nf) , round(3/nf) , 15, 2): Undot()")
#
## Adding Borders & Letterboxing
#
GripBorders()
LetterBox(0,0,16,16) 
Limiter()
#
#
## Functions ###
#
function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}

Maybe in this case it would be better to rise the "Ts" Values a bit so TempSoften also will handle scenes which are a bit "more than static"??!

Kwag, I recognised this evening the following: ...Why did you perform in the past and in your script now the fmin function on Tempsoften ... as in my opinion 2/nf never will result in more than 2!

TemporalSoften( fmin( round(2/nf), 6) .....

so the Threshold-"int f2" in the function set to a threshold value by 6 will never be reached?! Maybe on the other hand I'm really confused cause its already late ????

And whats about the comment of Digitall.doc?
That a rounded 2/5 could result as 0 radius on tempsoften??

Could this help?
Code:

....
...
...
TemporalSoften( fmax( round(2/nf), 1)......
.......

And therefore also adding below the script another function like this which will keep the radius at least at 1??
Code:

function fmax( int f1, int f2) {
  return ( f1<f2 ) ? f2 : f1
}

Well in a case if I would rise the threshold which refers to the start of tempsoften to 5!

And thats also Digitall.doc what I see now when typing these lines!
As the threshold was set to not more than 4 in the old version this means
a max nf of 4 and therefore 2/nf as send as the radius value to tempsoften would be round(0.5)! And a rounded 0.5 will result in 1,.... so the Radius will at least set to 1.

:)

PS: @ Audioslave

TemporalSoften(int clip, int radius, int luma_threshold, int chroma_threshold [, int scenechange] [, int mode])

Quote:

Originally Posted by Avisynth.org
int scenechange = Using this parameter will avoid blending across scene changes. 'n' defines the maximum average pixel change between frames. Good values for 'n' are between 5 and 30. Requires ISSE

int mode = An optional mode=2 parameter: It has a new and better way of blending frame and provides better quality. It is also much faster. mode=1 is default operation, and works as always.

And as we are using AVS in a version >= 2.51 its useful to switch to mode 2

audioslave 11-21-2003 07:36 PM

@Incredible

Hi there!
I will try your modified script with my nemesis :evil: - The Matrix Reloaded. You know I've been having difficulties with fitting this movie on one CD-R. Hopefully I will have better luck with this new script. :wink: Will get back with my results!

incredible 11-21-2003 07:59 PM

Audioslave ...

Well ...

Quote:

Old MA Script: 12409 Kbyte - 00:03:24

- New MA Script: 12042 Kbyte - 00:03:41

- The modified new MA Script below: 12136 kbyte - 00:03:29
As you see this won't end up in a real compression peak,
so I think there should be other opportunities which could give you your desired results?

BUT look closer... Kwags new MA version gives you more compression! But on the other hand a softer image (if still the "merge...." lines are added).

audioslave 11-21-2003 08:09 PM

Yes, hopefully there is options to gain more compression but I'm lost. I don't know what to use (or where or how...). :cry: I really want to squeeze this movie onto one 80 min disc!

kwag 11-21-2003 08:22 PM

Quote:

Originally Posted by incredible
@Kwag
So it performs a permanent Unfiltering like already done in Kwag's new vers. but TempSoften will only perform on static scenes.

This is exactly what I want to avoid 8O
The ON/OFF switching of filters :!:

-kwag

incredible 11-21-2003 08:23 PM

I thought you want to avoid blur kick-ins?? 8O

kwag 11-21-2003 08:24 PM

Quote:

Originally Posted by incredible
I thought you want to avoid these blur kick-ins?? 8O

Please read this :arrow: http://www.kvcd.net/forum/viewtopic....ght=hysteresis

That case was caused by FFdshow, but I've seen the behaviour happen on some wierd "almost still" scenes with some solid moving objects. It can happen :!:

-kwag

incredible 11-21-2003 08:33 PM

Quote:

Originally Posted by Kwag
UNLESS, that specific scene is right at the border of the treshold of the MA script filter switching point, and you are seeing a fast oscilation between TemporalSmoother and unfilter kicking in and out at a very high speed. The best analogy to this is "Histheresis" effect:

I see Kwag but as I can't download his sample I assume he got problems with oscillating "blur kick ins", ... do I see this right??

And thats why I left the unfiltering untouched ....
Or did "his" problem result by edgy Threshold-Tempsoften oscillation?

kwag 11-21-2003 08:37 PM

Quote:

Originally Posted by incredible

Kwag, I recognised this evening the following: ...Why did you perform in the past and in your script now the fmin function on Tempsoften ... as in my opinion 2/nf never will result in more than 2!

NO :!:
nf can go down to ~.2, so 1/.2 = 5 :!:
Quote:


And whats about the comment of Digitall.doc?
That a rounded 2/5 could result as 0 radius on tempsoften??
So :?:
That's exactly what I want :!:
If the value of radius results as zero, it means that it's a high action scene, and I don't want TemporalSoften to work :!:
So radius will be zero and so will the strength values. Thus rendering the temporal filter useless on action scenes, which is the exact effect I want, but WITHOUT turning the filter off :!:

-kwag

kwag 11-21-2003 08:41 PM

Quote:

Originally Posted by incredible
I see Kwag but as I can't download his sample I assume he got problems with oscillating "blur kick ins", ... do I see this right??

No. It's not related to scene changes. It's related to "Hysteresis" effect, where it can cause fast oscillations on a specific point of a movie, by the quick "turning on/turning off" filters on that boundary. It's very rare, but it can happen.

-kwag

audioslave 11-21-2003 08:50 PM

@kwag

Good ev'nin'!
Sorry to barge in like this but I was wondering about the TempSoft parameters. Do you have a suggestion for a new line or should I use the line incredible posted?:
Quote:

TemporalSoften(round(2/nf), round(1/nf), round(3/nf), 15, 2)
Just curious... :wink:

EDIT: Or maybe just change the last two parameters in the new MA script (1, 1) to 15, 2? I'm clueless...

incredible 11-21-2003 08:52 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by incredible

Kwag, I recognised this evening the following: ...Why did you perform in the past and in your script now the fmin function on Tempsoften ... as in my opinion 2/nf never will result in more than 2!

NO :!:
nf can go down to ~.2, so 1/.2 = 5 :!:

As I said, maybe I'm/was confused at these hours, therefore: :banghead:
Quote:

Quote:


And whats about the comment of Digitall.doc?
That a rounded 2/5 could result as 0 radius on tempsoften??
So :?:
That's exactly what I want :!:
If the value of radius results as zero, it means that it's a high action scene, and I don't want TemporalSoften to work :!:
Sorry misunderstanding this was refered to the old script where the filter on/off's based on thresholds.
Quote:

So radius will be zero and so will the strength values. Thus rendering the temporal filter useless on action scenes, which is the exact effect I want, but WITHOUT turning the filter off :!:

-kwag
Everything clear! Trash the mod. script above! I think I have to get some sleep ;-)

@Audioslave

NO!

Dont use the tempsoften line without the fmin call!!! As you can see the explanation why in here ---- I thought wrong! Shure nf can go below 1 as I already knew ... Im an idiot *lol*!!
Use the one kwag used but with mode set to 2

Edit: As I see now you edited it in your post too.

audioslave 11-21-2003 08:56 PM

Oki-dokie :D :!:

kwag 11-21-2003 08:59 PM

Quote:

Originally Posted by incredible
Everything clear! Trash the mod. script above! I think I have to get some sleep ;-)

Drink a cold beer so you can feel the "temporal" effect, and then drink a second beer and you'll see how you go "linear" to bed. Then your "ratio" will be set to "zero", until you wake up :mrgreen:
Happy dreams ;)

-kwag

incredible 11-21-2003 09:01 PM

Right!... but anyhow ... this try and error is where everything is based on :lol:
Now Ill really dream motion adaptive ... and I hope not oscillating! ;-)

good night!

audioslave 11-21-2003 09:02 PM

@kwag

No offence, but I think you've forgotten to include the "nf=0" in the latest optimal script post... :roll:

kwag 11-21-2003 09:16 PM

Quote:

Originally Posted by audioslave
@kwag

No offence, but I think you've forgotten to include the "nf=0" in the latest optimal script post... :roll:

Not needed.
The value of nf will be assigned on the first instance of "ScriptClip(" nf = YDifferenceToNext()"...... ;)

-kwag

audioslave 11-21-2003 09:19 PM

OK, sorry. My mistake. :oops: Damn, I really must learn this programming business! Didn't mean to step on your toes... :wink:


All times are GMT -5. The time now is 10:43 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.