digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Reason for GripCrop and GripSize location in optimal script? (http://www.digitalfaq.com/archives/avisynth/4369-avisynth-reason-gripcrop.html)

FredThompson 07-07-2003 12:38 AM

Reason for GripCrop and GripSize location in optimal script?
 
Is there a specific reason the GripCrop and GripSize lines are in the middle of image processing in the optimal script?

My assumption is the filtering after them is to reduce visible artifacts from resizing. Is that true?

kwag 07-07-2003 12:48 AM

Re: Reason for GripCrop and GripSize location in optimal scr
 
Quote:

Originally Posted by FredThompson
Is there a specific reason the GripCrop and GripSize lines are in the middle of image processing in the optimal script?

My assumption is the filtering after them is to reduce visible artifacts from resizing. Is that true?

There are three filters on top of it:
undot()
Limiter()
asharp(1, 4)

The reason is this. undot cleans the source somewhat. Limiter truncates (limits) the chroma/luma levels. Then asharp is applied to over emphasize detalis. Then resizing happens, followed by spatial filtering (STMedian) and heavy MergeChroma to kill the over emphasized details that asharp produced. Then further softening by mergeluma, which kills almost all visible mosquitoes left :)
After that, the adaptive filters do their act on what's left :D

-kwag

Holomatrix 07-27-2003 08:07 PM

Re: Reason for GripCrop and GripSize location in optimal scr
 
Quote:

Originally Posted by kwag
Quote:

Originally Posted by FredThompson
Is there a specific reason the GripCrop and GripSize lines are in the middle of image processing in the optimal script?

My assumption is the filtering after them is to reduce visible artifacts from resizing. Is that true?

There are three filters on top of it:
undot()
Limiter()
asharp(1, 4)

The reason is this. undot cleans the source somewhat. Limiter truncates (limits) the chroma/luma levels. Then asharp is applied to over emphasize detalis. Then resizing happens, followed by spatial filtering (STMedian) and heavy MergeChroma to kill the over emphasized details that asharp produced. Then further softening by mergeluma, which kills almost all visible mosquitoes left :)
After that, the adaptive filters do their act on what's left :D

-kwag

1) "Then asharp is applied to over emphasize detalis"
2) "heavy MergeChroma to kill the over emphasized details that asharp produced"

Then why use asharp at all? There is no need for Undot if the source is already clean, right?

3) "which kills almost all visible mosquitoes left"

Isn't this where Undot should be then?

jorel 07-27-2003 08:15 PM

Holomatrix,
is easy to know why use asharp and MergeChroma.
encode a sample with the MA script and
another removing asharp and mergeluma using the same source.
compare the results, the answer is there.
you will see big differences :!:

about undot:
if your source is very clean, just remove it from the script
cos it don't will work in very clean sources.

:wink:

Holomatrix 07-27-2003 09:21 PM

I didn't see any difference removing Undot and Asharp from the begining. I did select the 'Output as YUV data....' in TMPEG and noticed a little difference.

Import("D:\MOVIEE~3\RESAMP~1.AVS")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\AVISYN~1.5PL\Mpeg 2dec\MPEG2D~1.DLL")
mpeg2source("D:\MOVIEE~3\DVD2AV~1.D2V")
nf=0
Limiter()
GripCrop(480,480,overscan=1,source_anamorphic=fals e)
GripSize(resizer="LanczosResize")
Levels(0,1.3,255,0,255)
STMedianFilter(8,32,0,0)
MergeChroma(blur(1.58))
MergeLuma(blur(0.1))
SwitchThreshold=(Width<=352)?4:(Width<=480)?3:2
ScriptClip("nf=round(YDifferenceToNext())"+chr(13) +"nf>=SwitchThreshold?unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))):TemporalCleaner(6+nf,11+nf)")
GripBorders()
Limiter()
function fmin(int f1,int f2){return(f1<f2)?f1:f2}
Deen()

Dialhot 07-28-2003 04:01 AM

You won't see any difference in anything by using "deen" at the end of the script : deen removes everything, including details !

Holomatrix 07-28-2003 08:22 AM

I realized that just now. Can I replace STMedianFilter(8,32,0,0) with Deen() ? I want to keep Deen because of the great compression it gives which allows for increased Q. Can I use Undot() at the end? I still see artifacts, seems like mosquito, around peoples heads in distance.
Thanks

jorel 07-28-2003 08:41 AM

as i told you my friend Holomatrix
nothing is better than tests.

the MA script posted is the result of the evolution from months of our tests.
deen can encrease the CQ but maybe don't give the same quality.
i like deen and mipsmoother too, great filters but too slow!

do some tests,your eyes will choose the best!

see the best scripts:

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

Phil change temporalsoften to temporalcleaner as posted.
choose what is better for you.

:wink:

Holomatrix 07-28-2003 09:14 AM

Ok, thanks, back to the testing board :) What problems will increasing the Max Average bitrate do? I'm thinking that if, since I'm going to leave well enough alone and go back to the MA Script and gain Q points, then will increasing the Max Av bitrate help?

jorel 07-28-2003 09:26 AM

"What problems will increasing the Max Average bitrate do?"

maybe you got errors in your dvd player.
need tests too,some player works another don't works.
encode little samples and burn in cdrw, test in your player but
MAX 2000 to 2500 for mpeg1 is cool,no need more!
:wink:

Dialhot 07-28-2003 09:29 AM

For answering all your questions :

1/ yes you can use Deen insteed of STMedianFilter
2/ you can use Undot at the end, but I would try FluxSmooth (that is not the same family of filter, I know, but... just try).
3/ You can raise the Bitrate. The only problem is that the file prediction becomes more complicated (the more is the Min-MAx range, the more a sample encoding gives random file size).

Holomatrix 07-28-2003 09:50 AM

Quote:

Originally Posted by Dialhot
For answering all your questions :

1/ yes you can use Deen insteed of STMedianFilter
2/ you can use Undot at the end, but I would try FluxSmooth (that is not the same family of filter, I know, but... just try).
3/ You can raise the Bitrate. The only problem is that the file prediction becomes more complicated (the more is the Min-MAx range, the more a sample encoding gives random file size).

I used to use Fluxsmooth and Liked it, will try again.
Ok, I'll just leave Max Av bitrate at 1150 because I find the file size prediction very good the way it is.

@jorel - are you talking Max or Max Average bitrate?

Dialhot 07-28-2003 10:09 AM

I'm responding for Jorel : we are talking about MAX bitrate. Max Average isn't relevent in CQ mode. It's only for 2 pass VBR. I've misundertood your previous question.

jorel 07-28-2003 10:13 AM

encreasing Max AV Bitrate too much,maybe will encrease the file size too
and Max bitrate2000 to 2500 to mpeg1 is good Holomatrix,
more than 2500 can give problems in your player!
sorry for my incomplete or confused answer.
:wink:

@ Phil:
you i can change STMedianFilter to Deen,
what parameters i choose in Deen to do some samples and compare?

:)

Dialhot 07-28-2003 10:49 AM

Quote:

Originally Posted by jorel
you i can change STMedianFilter to Deen,
what parameters i choose in Deen to do some samples and compare?

:)

The only tests I did with deen were when someone talk about it weeks ago, using "a3d" matrix as paremeter. I took exactky the same ones.

The thread is there :

http://www.kvcd.net/forum/viewtopic....ight=a3d#28134

jorel 07-28-2003 11:42 AM

oh thanks Phil,
i remember that link and did some test too but
i don't did tests using Deen in the MA script.

:)


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