digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Is there a filter for increasing compression even more? (http://www.digitalfaq.com/archives/avisynth/4643-avisynth-filter-increasing.html)

audioslave 07-22-2003 10:11 AM

Okay, interesting point, Dialhot! I haven't really thought about that. Think it's time for a test encode without Limiter()! :D

Dialhot 07-22-2003 10:11 AM

[quote="audioslave"]
Code:

TemporalCleaner(fmin(round(3+nf), 7), fmin(round(8+nf), 15)).VagueDenoiser(method=1, threshold=2.5, nsteps=6, chroma=true)")
No need of "fmin" in the parameter of temporalcleaner : nf is always under SwitchThreshold when we reach this part of the code, so the max value NF can have is 4.

3+nf is always below 7 and 8+nf is always below 15.

Just put :

Code:

TemporalCleaner(round(3+nf), round(8+nf)).VagueDenoiser(method=1, threshold=2.5, nsteps=6, chroma=true)")

audioslave 07-22-2003 10:13 AM

Great! Will change it at once.

Jellygoose 07-23-2003 04:26 PM

Ok, I tested this line from jorel with Temporal Cleaner:
Code:

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)")

against this one from the optimal script:

Code:

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")

and although the Temporal Cleaner sample was slightly smaller, I still prefer to use Temporal Soften. On my tests, details were a lot better preserved, while mosquito noise was eliminated almost completely by Temporal Soften, while Temporal Cleaner still left some behind...
Did I use Temporal Cleaner in the right way´ :?:

Holomatrix 07-23-2003 04:45 PM

OK, so would you recomend changing my MAScript in DVD2SVCD to the one abouve using TemporalSoften? or are they both pretty close in quality?
Thanks

Dialhot 07-23-2003 06:32 PM

They have pretty the same quality. I never had mosquitoes using temporalcleaner but it's probably a matter of quality of source and CQ used. By the way, the two have to be tested and make your own opinion on wich one you prefer.

Holomatrix 07-23-2003 09:07 PM

Ok, I'm testing some encodes now :) I want to use the SemiAutoCrop MA script by Avalon by trying to find out why the differences in the MA script compaired to the SemiAuto script, like: the MA script uses a different Mpeg2Dec3, Gripfit, scd_trigger and the scriptClip line is way different than the SemiAuto script. Does it matter?

Dialhot 07-24-2003 03:41 AM

No the semiauto script has different scripClip line because Avalon uses an old, crappy and unefficient script from 18th june. Go to the "optimal script" forum and see the changelog in "last script". You will see why everything is different between the two scripts.

BTW, the semiAutoCrop script doens't have big interest as Grifit does a FullAutoCrop !

Holomatrix 07-24-2003 08:19 AM

Oh, ok, so if I have a 4:3 movie or 16:9, all I need to do is change the Gripcrop animorphic= true/false line in the MA script, right?

Dialhot 07-24-2003 09:30 AM

Right.

Holomatrix 07-24-2003 09:48 AM

Cool, thanks :)

Holomatrix 07-24-2003 10:13 AM

Ok, I tried the regular MA script I downloaded, results were good. Now I'll try the script above with temporalCleaner and see what happens. And what about Limiter? should I use it?

jorel 07-24-2003 11:07 AM

holomatrix

try the script like i post in the first page of this thread.
http://www.kvcd.net/forum/viewtopic.php?t=5202&start=0

don't use legalclip,
test this script without changes and post your results.

:wink:

Holomatrix 07-24-2003 11:43 AM

Ok, I'll try that script. What's the letterbox line for?

I tried this script and my CQ dropped from 56 to 50 on DIE ANOTHER DAY;

[AVISYNTH_MA Script (2.5.2) AudioslaveMods]
0=LoadPlugin(!Mpeg2Dec3.dll)
1=LoadPlugin(!StMedianfilter.dll)
2=LoadPlugin(!Asharp.dll)
3=LoadPlugin(!Undot.dll)
4=LoadPlugin(!Unfilter.dll)
5=LoadPlugin(!Gripfit_preview.dll)
6=LoadPlugin(!dctfilter.dll)
7=MaxTreshold=^max_threshold
8=nf=0
9=undot()
10=Limiter()
11=asharp(1,4)
12=GripCrop(^Breite,^Hoehe,overscan=^overscan,sour ce_anamorphic=^source_ana)
13=GripSize(resizer="BicubicResize")
14=STMedianFilter(^stm1,^stm2,0,0)
15=MergeChroma(blur(^max_threshold))
16=MergeLuma(blur(0.1))
17=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
18=ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
19=Unfilter(-(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100))) : \
20=TemporalCleaner(round(3+nf), round(8+nf)).VagueDenoiser(method=1, threshold=2.5, nsteps=6, chroma=true)")
21=DCTFilter(1, 1, 1, 1, 1, 1, 0.5, 0)
22=GripBorders()
23=Limiter()
24=function fmin( int f1, int f2) {
25=return ( f1<f2 ) ? f1 : f2
26=}
!Mpeg2Dec3.dll=C:\Filters25\MPEG2Dec3.dll
!StMedianfilter.dll=C:\Filters25\STMedianFilter.dl l
!Asharp.dll=C:\Filters25\asharp.dll
!Undot.dll=C:\Filters25\UnDot.dll
!Unfilter.dll=C:\Filters25\Unfilter.dll
!Gripfit_preview.dll=C:\Filters25\GripFit_YV12.dll
!dctfilter.dll=C:\filters25\dctfilter.dll
^max_threshold=1.50
^Breite=480
^Hoehe=480
^overscan=1
^source_ana=true
^stm1=8
^stm2=32
?=
?asharp=
?f1=

Trying this now;
[AVISYNTH_jorel]
0=LoadPlugin(!Mpeg2Dec3.dll)
1=LoadPlugin(!StMedianfilter.dll)
2=LoadPlugin(!Asharp.dll)
3=LoadPlugin(!Undot.dll)
4=LoadPlugin(!Gripfit_preview.dll)
5=nf=0
6=GripCrop(480,480,overscan=1,source_anamorphic=Tr ue)
7=GripSize(resizer="BiCubicResize")
8=Undot()
9=Asharp(1,4)
10=STMedianFilter(8,32,0,0)
11=MergeChroma(blur(1.50))
12=MergeLuma(blur(0.1))
13=SwitchThreshold=(Width<=352)?4:(Width<=480)?3:2
14=ScriptClip("nf=round(YDifferenceToNext())"+chr( 13)+"nf >=SwitchThreshold?unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))):TemporalCleaner(6+nf,11+nf)")
15=GripBorders()
16=function fmin(int f1,int f2){return(f1<f2)?f1:f2}
!Mpeg2Dec3.dll=C:\Filters25\MPEG2Dec3.dll
!StMedianfilter.dll=C:\Filters25\STMedianFilter.dl l
!Asharp.dll=C:\Filters25\asharp.dll
!Undot.dll=C:\Filters25\UnDot.dll
!Gripfit_preview.dll=C:\Filters25\GripFit_YV12.dll

I don't think this is working out :( Now my calculated CQ by DVD2SVC is 44 but if I use:
[AVISYNTH_MA Script (2.5.2)]
0=LoadPlugin(!Mpeg2Dec3.dll)
1=LoadPlugin(!StMedianfilter.dll)
2=LoadPlugin(!Asharp.dll)
3=LoadPlugin(!Undot.dll)
4=LoadPlugin(!Gripfit_preview.dll)
5=MaxTreshold=^max_threshold
6=scd_trigger=^scd_trigger
7=nf=0
8=undot()
9=Limiter()
10=asharp(2,4)
11=GripCrop(^Breite,^Hoehe,overscan=^overscan,sour ce_anamorphic=^source_ana)
12=GripSize(resizer="BicubicResize")
13=STMedianFilter(^stm1,^stm2,0,0)
14=MergeChroma(blur(^max_threshold))
15=MergeLuma(blur(0.2))
16=ScriptClip("nf=YDifferenceToNext()"+chr(13)+"nf >2.5 ? asharp(-(fmin((nf/30),1)),0):TemporalSoften(2,7,7,3,2)")
17=ScriptClip("nf >scd_trigger?asharp(-2,0):asharp(0,0)")
18=GripBorders()
19=Limiter()
20=function fmin(float f1,float f2){return(f1<f2)?f1:f2}
!Mpeg2Dec3.dll=C:\Filters25\MPEG2Dec3.dll
!StMedianfilter.dll=C:\Filters25\STMedianFilter.dl l
!Asharp.dll=C:\Filters25\asharp.dll
!Undot.dll=C:\Filters25\UnDot.dll
!Gripfit_preview.dll=C:\Filters25\GripFit_YV12.dll
^max_threshold=1.50
^scd_trigger=30
^Breite=480
^Hoehe=480
^overscan=1
^source_ana=true
^stm1=8
^stm2=32
?=
?asharp=
?f1=

My Calculated CQ is 56, which gave me a file size of 810meg.

Am I doing somthing wrong?

EDIT: I see what's going on, when I change the motion search to High rather than Fast I get a higher CQ value. That's what I did yesturday which gave me 56. Why would going to FAST drop my CQ ??
Thanks

Dialhot 07-24-2003 12:48 PM

It's not a matter of going fast or slow ;-)

The two method use completly different algorythm, that's why they differ so much in time and... result !

Holomatrix 07-24-2003 01:10 PM

If I use the same MA script twice and get 1) CQ 56 using High and 2) CQ 46 using Fast wouldn't the CQ 56 using High give me better quality? The recommendation from Avalon is to use Fast.
Thanks

Dialhot 07-24-2003 04:39 PM

With such low value (and such big difference between the two result), the higher is the better.

But, normally (so not in your present case) the Fast method gives better result even if the CQ is a little bit smaller.

Holomatrix 07-24-2003 04:45 PM

Quote:

Originally Posted by Dialhot
I used Dup(threshold=1,blend=true) a couple of time. It does a good work but the effects are sometimes visible during travelling movements of the camera. Don't use the default parameters as they are too high !

You can use also DCTFilter(1,1,1,1,1,1,0.5,0)

Else did you try to use an overscan of 2 before adding any filter ?

Where in the MA script (2.5.2) would I put this line DCTFilter(1,1,1,1,1,1,0.5,0) ?
Thanks

jorel 07-24-2003 05:56 PM

Holomatrix my friend
:wink:

the script posted is not mine :!:
my credits are the results. :lol:
this script is from Kwag and Phil :!:
that's why i call as "Adaptative KARLvcd PHILter"

[AVISYNTH_Adaptative KARLvcd PHILter]
0=nf=0
1=GripCrop(^TargetWidth,^TargetHeight+^BorderTop+^ BorderBottom,overscan=^overscan,source_anamorphic= ^source_ana,dest_anamorphic=^dest_ana)2=GripSize(r esizer="BiCubicResize")
3=Undot()
4=Asharp(1,4)
5=STMedianFilter(^S_FilterThreshHold,^S_EdgeThresh Hold,0,0)
6=MergeChroma(blur(^blur_chroma))
7=MergeLuma(blur(^blur_luma))
8=SwitchThreshold=(Width<=352)?4:(Width<=480)?3:2
9=ScriptClip("nf=round(YDifferenceToNext())"+chr(1 3)+"nf>=SwitchThreshold?unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))):TemporalCleaner(6+nf,11+nf)")
10=GripBorders()
11=function fmin(int f1,int f2){return(f1<f2)?f1:f2}
^overscan=1
^source_ana=false
^dest_ana=false
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.58
^blur_luma=0.1

if all filters are in plugins folder of avisynth
then they will "auto load" :!:
no need to use.... loadplugin...bla,bla... :wink:

i use letterbox in my script cos i need.
my source have a strange thin gray line on the left size.

i think that the better place to use DCTFilter
is in the end of the script...
wait for Kwag,Phil or Jell recomendations.

:wink:

Dialhot 07-24-2003 06:19 PM

The DCTFilter should be always the last line before adding the borders. So in you script it should be line #9.5 :-)


All times are GMT -5. The time now is 12:29 AM  —  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.