Quantcast Avisynth: Latest KVCD Scripts - digitalFAQ.com Forums [Archives]
  #1  
04-03-2003, 10:32 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
Last updated on ( March 31, 2004 @15:44 GMT ):
For DVD and clean material (AviSynth 2.0x):

Code:
unfilter(50,50)
GripCrop( X, Y )
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0, 8, 32)
# SpaceDust() # Optional - for some "not so clean" DVDs.
temporalsmoother(1,2)
mergechroma(blur(1.50))
mergeluma(blur(0.2))
# Convolution3d or DCTFilter for extreme worse cases. 
GripBorders()
For DVD and clean material ( for use ONLY with AviSynth 2.5x )
## Now with Linear Motion Adaptive Filtering ##

### Last updated on March 31, 2004 @15:44 GMT ###
Code:
 ## DLL Section ##
#
LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\GripFit_YV12.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\asharp.dll")
LoadPlugin("C:\Filters25\unfilter.dll") 
LoadPlugin("C:\Filters25\undot.dll")
#
####
## Main section and static filters ###
#
Mpeg2Source("Your_D2V_Source_Here") 
#
undot()
asharp(1, 4)
GripCrop(Your_GripCrop_Parameters_Here)
GripSize(resizer="BicubicResize")
STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(1.5))
MergeLuma(blur(0.1))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) 
# This will apply variable temporalsoften
# and variable blur. 
# Both filters are active at all times, and work inversely proportional to the
# activity, measured from current frame to next frame.

ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "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)  ")

#
#
#

GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker! 

#
#
## Functions ### 

function fmin( int f1, int f2) { 
  return ( f1<f2 ) ? f1 : f2 
}
 
# 
####
For VHS and captures:

Code:
unfilter(50,50)
GripCrop( X, Y )
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0, 8, 32)
FaeryDust() # or PixieDust()
mergechroma(blur(1.50))
mergeluma(blur(0.2))
# Convolution3d or DCTFilter for extreme worse cases. 
GripBorders()
For Anime/Cartoon material:
Same as DVD clean material, but shorten the GOP to 12 frames (PAL) or 15 (NTSC)

!!! PLEASE DO NOT POST IN THIS THREAD !!!

-kwag
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  
11-21-2003, 02:53 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
Change Log:

March 31, 2004

Removed LegalClip and Limiter()
--------------------------------------------------------------------------------

November 21, 2003

Script is now 100% fully linear, with no boundary switching.
Prior versions had a boundary (treshold) that switched between temporal filtering and blurring. Now both filters are active at all times, and work inversely proportional to the activity.
--------------------------------------------------------------------------------

October 24, 2003

Changed STMedian filter values to work on a smaller radius, to clean small noise particles. Also added smallest temporal values to the filter.
---------------------------------------------------------------------------------

July 8, 2003.

Added automatic filter switch treshold calculation, to compensate for different resolutions.
Thanks Fiz
----------------------------------------------------------------------------------


July 6, 2003.

Changed scenechange detect from 0 to 1 and "Mode" from 2 to 1 on TemporalSoften parameters. The old parameters were causing some problems on Anime/Cartoon types of movies.

Changed asharp(2, 4) to asharp(1, 4) and MergeLuma(blur(0.2)) to MergeLuma(blur(0.1))
The previous stronger results are really not needed, because they were set, back when the original non-adaptive script was made. This increases compressibility even more, allowing for a higher CQ value.
----------------------------------------------------------------------------------


July 4, 2003.

Now the "radius" parameter in TemporalSoften is adaptive.
Before, a fixed radius of 4 was used. Now with variable radius, Gibbs effect is even less visible than before.
----------------------------------------------------------------------------------

July 2, 2003:

Script correction by Dialhot.
Changed script to read:
Code:
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften(4, round(1/nf) , round(3/nf) ,0, 2) ")

----------------------------------------------------------------------------------

July 1, 2003.

Changed the: nf > 2 ? To: nf >= 2 ?
Because filter switching wouldn't happen until value was actually 3 or higher.
Now applies if value is 2 or higher.

Changed line:
ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf > 2 ? \
To:
ScriptClip("nf = round(YDifferenceToNext()+1)"+chr(13)+ "nf > 2 ? \

Original line caused "divide by zero" errors.

Changed function:
Code:
function fmin(float f1, float f2) {
return (f1<f2) ? f1 : f2

To:
Code:
function fmin(int f1, int f2) {
return (f1<f2) ? f1 : f2


Which were part of Dialhot's changes. I forgot to update the function parameter types

Code optimization by Dialhot on adaptive script:
Code:
ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf > 2 ? \
unfilter( -(fmin(nf*2, 100)), -(fmin(nf*2, 100)) ) : \
TemporalSoften(4, round(1/nf) , round(3/nf) ,0, 2) ")


Thanks Dialhot
----------------------------------------------------------------------------------

June 29-30, 2003.

Corrected dynamic luma and chroma values.
Previous values were just too strong, and caused bleeding on chroma.
Thanks to all that reported the problem
----------------------------------------------------------------------------------

June 29, 2003.

Small fix.
Had a "0" instead of "1" on scenechange field of TemporalSoften filter. Caused some ghosting on frames before scene changes.
----------------------------------------------------------------------------------


June 29, 2003.

Script is now adaptive in the TemporalSmoother filter too.
Changed the chroma portion of the filter [ round(2/nf)*50 ] to vary 25 times more that the luma part [ round(2/nf)*2 ].
Changed the boundary treshold from 2.5 to 2. This means that the unfilter line will kick in at a slight lower value, and again, we gain compression without any visual loss in quality.
Also with a radius of 4, the Gibbs effect (mosquito noise) is almost completely removed!
----------------------------------------------------------------------------------

June 27, 2003.

Removed "asharp" and changed to "unfilter" in the adaptive portion of the script.
( Thanks Jellygoose )
----------------------------------------------------------------------------------


June 22, 2003.

Removed line:
conditionalfilter( last, asharp(-1,0), last, "nf", ">", "scd_trigger" )

It's not needed, because we already blur a max value of -1.0 on scene changes in the line:
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf > 2.5 ? asharp( -(fmin((nf/30), 1)), 0 ) : \
TemporalSoften(2,7,7,3,2) ")
----------------------------------------------------------------------------------

June 21, 2003:

Changed:
conditionalfilter( last, asharp(-2,0), last, "nf", ">", "scd_trigger" )
To:
conditionalfilter( last, asharp(-1,0), last, "nf", ">", "scd_trigger" )

The -2 value caused a heavy shift on chroma/luma? in the frame after scene change, which actually shifts the picture and instead of saving space, it produces larger encode size and throws off prediction. This was not noticeable while watching a movie. Only if you stepped frame by frame with Vdub, etc.
----------------------------------------------------------------------------------

June 18, 2003:

Small correction:
conditionalfilter( last, asharp(-2,0), last, "nf", ">", "scd_trigger" )
----------------------------------------------------------------------------------

Changed function
From:
ScriptClip("nf > scd_trigger ? asharp( -2,0) : last ")
To:
conditionalfilter(last,sharp,last, "nf",">", "scd_trigger")
(Thanks sh0dan )
----------------------------------------------------------------------------------

June 18, 2003:

Changed function
From:
ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp(0,0) ")
To:
ScriptClip("nf > scd_trigger ? asharp( -2,0) : last ")
----------------------------------------------------------------------------------

June 16, 2003:
Changed script to use GripFit.
----------------------------------------------------------------------------------

June 14, 2003:
Changed value of scd_trigger to 30 to avoid falsing on glitches, instead of actual scene changes.
----------------------------------------------------------------------------------


-kwag
Closed Thread




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Need help with the latest scripts Nobody Avisynth Scripting 38 08-05-2004 01:24 AM
DVD2SVCD: Latest optimal scripts for DVD2SVCD Dialhot Video Encoding and Conversion 0 07-10-2004 07:45 AM
Avisynth: STMedianFilter in the Latest Scripts For VHS and captures? dongxu Avisynth Scripting 3 02-26-2004 09:51 AM
Avisynth: Latest Scripts Thread EvilFactor Avisynth Scripting 3 06-16-2003 11:53 PM
Avisynth: Latest KVCD script please! syk2c11 Avisynth Scripting 1 04-02-2003 10:03 AM

Thread Tools



 
All times are GMT -5. The time now is 01:57 AM  —  vBulletin Jelsoft Enterprises Ltd