VirtualDub II

From Avisynth wiki
Jump to: navigation, search

This is the second part of vdub_filters.avsi:

###################################################################
# Logo by Donald Graft, v1.3b4                                    #
#                                                                 #
# In the filter configuration dialog box, enter the input file.   #
# If the specified bitmap file cannot be found, or if it is not   #
# a bitmap file, or if it is of the wrong depth (depth must be 24 #
# bit), the output frame will be all black.                       #
#                                                                 #
# See "simplified_versions.avs" for some examples.                #
###################################################################

function VD_Logo(clip clip, int "x", int "y", int "alpha", int "transparent",
  \  int "xr", int "xg", int "xb", int "tolerance", string "filename",
  \  bool "animate", int "start", int "duration", int "loops",
  \  int "fadeinlen", int "fadeoutend", int "fadeoutlen")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\logo.vdf", "_VD_Logo", 1)
  return clip._VD_Logo(default(x,0), default(y,0), default(alpha,128),
    \  default(transparent,1), default(xr,0), default(xg,0), default(xb,255),
    \  default(tolerance,0), default(filename,VirtualDub_plugin_directory+"\logo.bmp"), 
    \  default(animate,false)?1:0, default(start,0), default(duration,0), default(loops,0),
    \  default(fadeinlen,0), default(fadeoutend,200), default(fadeoutlen,0))
}

# example1 (static logo):
# ConvertToRGB()
# VD_logo(0, 0, 128, 1, 0, 0, 255, 0, VirtualDub_plugin_directory+"\logo2.bmp", false, 100, 200, 0, 10, 180, 10)
# ConvertToYUY2()

# example2 (animated logo):
# ConvertToRGB()
# VD_Logo(33, 33, 128, 1, 0, 0, 0, 0, "G:\Recu0001.bmp", true, 0, 1, 20, 0, 0, 0)
# ConvertToYUY2()


###########################################
# Smart Smoother HiQ by Klaus Post, v2.11 #
#                                         #
# On Donald Grafts homepage there is a    #
# link to a version of Smoother HiQ (also #
# made by Klaus) that works directly in   #
# YUV-space.                              #
#                                         #
# diameter (3-13, odd),                   #
# threshold (1-200), amount (1-254)       #
# mode = "average" or "weighted"          #
###########################################

function VD_SmartSmoothHiQ(clip clip, int "diameter", int "threshold", int "amount", string "mode",
  \  bool "weighted_difference", int "maintain_diffweight", bool "visualize_blur", bool "greyscale")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\SmoothHiQ.vdf", "_VD_SmartSmoothHiQ")
  mode = default(mode, "weighted")
  mode = (mode=="average") ? 0 : (mode=="weighted") ? 1 : -1 
  Assert(mode>=0, """VD_SmartSmoothHiQ: "mode" parameter must be "average" or "weighted"""")
  return clip._VD_SmartSmoothHiQ(default(diameter,5), default(threshold,50), default(visualize_blur,false)?1:0, default(amount,254),
    \  mode, default(greyscale,false)?1:0, default(weighted_difference,true)?1:0, default(maintain_diffweight,0))
}

# example:
# ConvertToRGB()
# VD_SmartSmoothHiQ(5, 50, 254, "weighted")
# ConvertToYUY2()


###########################################
# Smart Smoother IQ by Tim Park, v0.5     #
#                                         #
# diameter (3-11, odd), threshold (1-200) #
#                                         #
# For some reason the results in VDub and #
# AviSynth are very different. The latter #
# is blurred a lot more.                  #
###########################################

function VD_SmartSmoothIQ(clip clip, int "diameter", int "threshold", bool "interlaced")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\smoothIQ.vdf", "_VD_SmartSmoothIQ")
  return clip._VD_SmartSmoothIQ(default(diameter,5), default(threshold,25), default(interlaced,false)?1:0)
}

# example:
# ConvertToRGB()
# VD_SmartSmoothIQ(5, 25, false)
# ConvertToYUY2()


##############################################
# DeinterlaceAreaBased by Gunar Thalin, v1.3 #
#                                            #
# mode = "interpolate" or "blend"            #
# threshold (), edge_detect ()               #
# interlaced_area (0-100)                    #
##############################################

function VD_AreaBasedDeinterlace(clip clip, bool "deinterlaced_only", string "mode", int "threshold", 
  \  int "edge_detect", bool "log_frames", int "interlaced_area")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\DeinterlaceAreaBased.vdf", "_VD_DeinterlaceAreaBased")
  mode = default(mode, "blend")
  mode = (mode=="interpolate") ? 0 : (mode=="blend") ? 1 : -1 
  Assert(mode>=0, """VD_DeinterlaceAreaBased: "mode" parameter must be "interpolate" or "blend"""")
  return clip._VD_DeinterlaceAreaBased(default(deinterlaced_only,false)?1:0, mode, default(threshold,27), 
    \  default(edge_detect,25), default(log_frames,false)?1:0, string(default(interlaced_area,0)))
}

# example:
# ConvertToRGB()
# VD_AreaBasedDeinterlace(false, "blend", 27, 25, false, 0)
# ConvertToYUY2()


########################################################################
# DeLogo by Karel Suhajda, v1.2.1                                      #
#                                                                      #
# If the logo is (partially) located in the black bars you might want  #
# to consider the filter LogoAway by Krzysztof Wojdon.                 #
#                                                                      #
# Before this script can be used we need to do some preprocessing      #
# in Virtual Dub to obtain the following pictures:                     #
# filename2 = photo_deblend.bmp                                        #
# filename3 = photo_alpha.bmp                                          #
# filename4 = photo_color.bmp                                          #
# filename5 = photo_repair.bmp                                         #
#                                                                      #
# 1) Open the avi in Virtual Dub and select a frame where the logo     #
# is clearly visible. Set video and audio on direct stream copy        #
# and select a range of 100 frames in which the logo is contained.     #
# Make a new avi of this and open it in Virtual Dub.                   #
#                                                                      #
# 2) Select the frame of (1) and copy it to the clipboard. Open        #
# your favourite graphics program and load the frame from the          #
# clipboard. Paint an rectangle in which the logo fits "easily"        #
# located red (255,0,0), the rest of the frame blue (0,0,255) leaving  #
# a small stroke unpainted between the red and blue part. Save this    #
# picture as a 24 RGB BMP file, say photo.bmp.                         #
#                                                                      #
# 3) Return to the unclosed Virtual Dub and load the filter.           #
# Press "load" next to "Analyse" in "Mask properties" and load         #
# the BMP file. Fill in the "repair properties". Press "Show preview", #
# "Sample video" and "all frames". Finally make the desired files:     #
# filename2 = photo_deblend.bmp                                        #
# filename3 = photo_alpha.bmp                                          #
# filename4 = photo_color.bmp                                          #
# filename5 = photo_repair.bmp                                         #
# by using the "Save as" button corresponding to deblend, alpha,       #
# color and repair.                                                    #
#                                                                      #
# range = "100-200, 300-400"; or whole clip range = ""                 #
# pixel aspect ratio: par_X (1-16), par_Y (1-16)                       #
# depth (1.0 - 8.0), power (0.0 - 16.0)                                #
########################################################################

function VD_DeLogo(clip clip, bool "on_frames", string "range", string "file_deblend", string "file_alpha", 
  \  string "file_color", string "file_repair", float "depth", float "power", int "par_X", int "par_Y", bool "interlaced")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\delogo.vdf", "_VD_DeLogo")
  X = round(10*depth)
  Y = round(10*power)
  # theoretically: z = 100*log10(par_X/par_Y), as approximation I took a minimax-approximation (calculated with Maple):
  v = - 48.96556825 + 63.18825967*par_X - 16.00966389*par_X*par_X + 2.473556539*par_X*par_X*par_X - .2133268695*par_X*par_X*par_X*par_X
    \  + .009456579673*par_X*par_X*par_X*par_X*par_X - .0001675297934*par_X*par_X*par_X*par_X*par_X*par_X
  w = - 48.96556825 + 63.18825967*par_Y - 16.00966389*par_Y*par_Y + 2.473556539*par_Y*par_Y*par_Y - .2133268695*par_Y*par_Y*par_Y*par_Y
    \  + .009456579673*par_Y*par_Y*par_Y*par_Y*par_Y - .0001675297934*par_Y*par_Y*par_Y*par_Y*par_Y*par_Y
  z = round(v) - round(w)
  return clip._VD_DeLogo(default(on_frames,false)?1:0, default(range,""), default(file_deblend,""), default(file_alpha,""), 
    \  default(file_color,""), default(file_repair,""), default(X,15), default(Y,40), default(interlaced,false)?1:0, z)
}

# example1:
# ConvertToRGB()
# VD_DeLogo(false, "", "F:\photo_deblend.bmp", "F:\photo_alpha.bmp", "F:\photo_color.bmp", "F:\photo_repair.bmp", 1.5, 4.0, 1, 1, false)
# ConvertToYUY2()

# example2:
# ConvertToRGB()
# VD_DeLogo(true, "100-200, 300-400", "F:\photo_deblend.bmp", "F:\photo_alpha.bmp", "F:\photo_color.bmp", "F:\photo_repair.bmp")
# ConvertToYUY2()


################################################
# GeneralConvolution3D v1.1, by Gunnar Thalin  #
#                                              #
# The last matrix (matrix for frame prior to   #
# previous) has to be inserted manually (only  #
# when one of its arguments is non-zero)       #
# since a function can have 60 arguments at    #
# maximum.                                     #
#                                              #
# 1) matrix entries: (0-256)                   #
#                                              #
# 2) matrix for current frame: a11-a55         #
#                                              #
# 3) matrix for previous frame: b11-b55        #
#                                              #
# 4) The matrix entries have to be inserted in #
# hexadecimal notation. Thus for example:      #
# 51 decimal = 3*16^1 + 3*16^0 hexadecimal =   #
# = 33 hexadecimal.                            #
#                                              #
# 5) a33 = 256 decimal = 1*16^2 hexadecimal    #
# = 100 hexadecimal leaves the clip unchanged. #
#                                              #
# 6) The matrix entries must be a three digit  #
# number, insert zeros from the left when      #
# necessary.                                   #
################################################

function VD_GeneralConvolution3D(clip clip, string "mode", string "a11", string "a12", string "a13", string "a14",
  \  string "a15", string "a21", string "a22", string "a23", string "a24", string "a25", string "a31", string "a32",
  \  string "a33", string "a34", string "a35", string "a41", string "a42", string "a43", string "a44", string "a45",
  \  string "a51", string "a52", string "a53", string "a54", string "a55", string "b11", string "b12", string "b13",
  \  string "b14", string "b15", string "b21", string "b22", string "b23", string "b24", string "b25", string "b31",
  \  string "b32", string "b33", string "b34", string "b35", string "b41", string "b42", string "b43", string "b44",
  \  string "b45", string "b51", string "b52", string "b53", string "b54", string "b55")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\GeneralConvolution3D.vdf", "_VD_GeneralConvolution3D", 1)
  mode = default(mode, "input")
  mode = (mode=="input") ? 0 : (mode=="output") ? 1 : -1
  Assert(mode>=0, """VD_GeneralConvolution3D: "mode" parameter must be "input" or "output"""")
  a11 = default(a11, "000")
  a12 = default(a12, "000")
  a13 = default(a13, "000")
  a14 = default(a14, "000")
  a15 = default(a15, "000")
  a21 = default(a21, "000")
  a22 = default(a22, "000")
  a23 = default(a23, "000")
  a24 = default(a24, "000")
  a25 = default(a25, "000")
  a31 = default(a31, "000")
  a32 = default(a32, "000")
  a33 = default(a33, "046")
  a34 = default(a34, "000")
  a35 = default(a35, "000")
  a41 = default(a41, "000")
  a42 = default(a42, "000")
  a43 = default(a43, "000")
  a44 = default(a44, "000")
  a45 = default(a45, "000")
  a51 = default(a51, "000")
  a52 = default(a52, "000")
  a53 = default(a53, "000")
  a54 = default(a54, "000")
  a55 = default(a55, "000")
  b11 = default(b11, "000")
  b12 = default(b12, "000")
  b13 = default(b13, "000")
  b14 = default(b14, "000")
  b15 = default(b15, "000")
  b21 = default(b21, "000")
  b22 = default(b22, "000")
  b23 = default(b23, "000")
  b24 = default(b24, "000")
  b25 = default(b25, "000")
  b31 = default(b31, "000")
  b32 = default(b32, "000")
  b33 = default(b33, "000")
  b34 = default(b34, "000")
  b35 = default(b35, "000")
  b41 = default(b41, "000")
  b42 = default(b42, "000")
  b43 = default(b43, "000")
  b44 = default(b44, "000")
  b45 = default(b45, "000")
  b51 = default(b51, "000")
  b52 = default(b52, "000")
  b53 = default(b53, "000")
  b54 = default(b54, "000")
  b55 = default(b55, "000")
  # "matrix for frame prior to previous" elements:
  c11 = "000"
  c12 = "000"
  c13 = "000"
  c14 = "000"
  c15 = "000"
  c21 = "000"
  c22 = "000"
  c23 = "000"
  c24 = "000"
  c25 = "000"
  c31 = "000"
  c32 = "000"
  c33 = "000"
  c34 = "000"
  c35 = "000"
  c41 = "000"
  c42 = "000"
  c43 = "000"
  c44 = "000"
  c45 = "000"
  c51 = "000"
  c52 = "000"
  c53 = "000"
  c54 = "000"
  c55 = "000"
  str = "8"+a11+"8"+b11+"8"+c11 + "8"+a12+"8"+b12+"8"+c12 + "8"+a13+"8"+b13+"8"+c13 + "8"+a14+"8"+b14+"8"+c14 +
    \  "8"+a15+"8"+b15+"8"+c15 + "8"+a21+"8"+b21+"8"+c21 + "8"+a22+"8"+b22+"8"+c22 + "8"+a23+"8"+b23+"8"+c23 +
    \  "8"+a24+"8"+b24+"8"+c24 + "8"+a25+"8"+b25+"8"+c25 + "8"+a31+"8"+b31+"8"+c31 + "8"+a32+"8"+b32+"8"+c32 +
    \  "8"+a33+"8"+b33+"8"+c33 + "8"+a34+"8"+b34+"8"+c34 + "8"+a35+"8"+b35+"8"+c35 + "8"+a41+"8"+b41+"8"+c41 +
    \  "8"+a42+"8"+b42+"8"+c42 + "8"+a43+"8"+b43+"8"+c43 + "8"+a44+"8"+b44+"8"+c44 + "8"+a45+"8"+b45+"8"+c45 +
    \  "8"+a51+"8"+b51+"8"+c51 + "8"+a52+"8"+b52+"8"+c52 + "8"+a53+"8"+b53+"8"+c53 + "8"+a54+"8"+b54+"8"+c54 +
    \  "8"+a55+"8"+b55+"8"+c55
  return clip._VD_GeneralConvolution3D(0, mode, str)
} 

# example:
# ConvertToRGB()
# VD_GeneralConvolution3D("output", "000", "000", "000", "000", "000",
#   \ "000", "000", "033", "000", "000",
#   \ "000", "033", "034", "033", "000",
#   \ "000", "000", "033", "000", "000",
#   \ "000", "000", "000", "000", "000")
# ConvertToYUY2()


############################################
# DeinterlaceSmooth by Gunnar Thalin, v1.0 #
#                                          #
# mode = "interpolate" or "blend"          #
# threshold (), edge_detect ()             #
# interlaced_area (0-100)                  #
############################################

function VD_DeinterlaceSmooth(clip clip, bool "deinterlaced_only", string "mode", bool "alternate_field_order",
  \  int "threshold", int "edge_detect", bool "log_frames", int "interlaced_area")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\deinterlacesmooth.vdf", "_VD_DeinterlaceSmooth")
  mode = default(mode, "interpolate")
  mode = (mode=="interpolate") ? 0 : (mode=="blend") ? 1 : -1 
  Assert(mode>=0, """VD_DeinterlaceSmooth: "mode" parameter must be "interpolate" or "blend"""")
  return clip._VD_DeinterlaceSmooth(default(deinterlaced_only,false)?1:0, mode,
    \  default(alternate_field_order,false)?1:0, default(threshold,24), default(edge_detect,20),
    \  default(log_frames,false)?1:0, string(default(interlaced_area,0)))
}

# example (video is converted to 50/60 frames a second before applying the filter by using SeparateFields):
# ConvertToRGB()
# SeparateFields()
# VD_DeinterlaceSmooth(false, "interpolate", false, 24, 20, false, 0)
# ConvertToYUY2()


###################################################
# Time Based DeInterlacer by Uwe Freese, v1.1     #
#                                                 #
# textpixel_dist (-), color_threshold (0-255),    #
# pixel_threshold (0-100), scene_dist (0-100),    #
# interpolate_field (0-100)                       #
# mode = scene_det_off/scene_det_on/bar_graph     #
#   /scene_changes                                #
# mode_spat = inter_bottom/inter_top              #
# mode_temp_delay_top = inter_top/inter_bottom    #
# mode_temp_delay_bottom = inter_bottom/inter_top #
###################################################

function VD_DeInterlaceTimeBased(clip clip, string "mode", int "textpixel_dist", int "color_threshold", 
  \  int "pixel_threshold", int "scene_dist", bool "detect_scene", int "interpolate_field", string "mode_spat", 
  \  string "mode_temp_delay_bottom", string "mode_temp_delay_top")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\tbdi.vdf", "_VD_DeInterlaceTimeBased", 1)
  mode = default(mode, "scene_det_on")
  mode = (mode=="scene_det_off") ? 0 : (mode=="scene_det_on") ? 1 : (mode=="bar_graph") ? 2 : (mode=="scene_changes") ? 3 : -1 
  Assert(mode>=0, """VD_DeInterlaceTimeBased: "mode" parameter must be "scene_det_off", "scene_det_on", "bar_graph" or "scene_changes"""")
  mode_spat = default(mode_spat, "inter_bottom")
  mode_spat = (mode_spat=="inter_bottom") ? 0 : (mode_spat=="inter_top") ? 1 : -1 
  Assert(mode_spat>=0, """VD_DeInterlaceTimeBased: "mode_spat" parameter must be "inter_bottom" or "inter_top"""")
  mode_temp_delay_top = default(mode_temp_delay_top, "inter_top")
  mode_temp_delay_top = (mode_temp_delay_top=="inter_top") ? 0 : (mode_temp_delay_top=="inter_bottom") ? 1 : -1 
  Assert(mode_temp_delay_top>=0, """VD_DeInterlaceTimeBased: "mode_temp_delay_top" parameter must be "inter_top" or "inter_bottom"""")
  mode_temp_delay_bottom = default(mode_temp_delay_bottom, "inter_bottom")
  mode_temp_delay_bottom = (mode_temp_delay_bottom=="inter_bottom") ? 0 : (mode_temp_delay_bottom=="inter_top") ? 1 : -1 
  Assert(mode_temp_delay_bottom>=0, """VD_DeInterlaceTimeBased: "mode_temp_delay_bottom" parameter must be "inter_bottom" or "inter_top"""")
  return clip._VD_DeInterlaceTimeBased(mode_temp_delay_bottom, mode_temp_delay_top, mode, default(textpixel_dist,1000), 
    \  default(color_threshold,15), default(pixel_threshold,55), default(scene_dist,5), default(detect_scene,false)?1:0, 
    \  default(interpolate_field,0), mode_spat)
}

# example:
# ConvertToRGB()
# VD_DeInterlaceTimeBased("scene_det_on", 1000, 15, 55, 5, true, 50, "inter_bottom")
# ConvertToYUY2()


#########################################
# Spatial Smoother by Dividee, v1.0     #
#                                       #
# diameter (3-11, odd), strength (0-18) #
#########################################

function VD_SpatialSmoother(clip clip, int "diameter", int "strength")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\ssmooth.vdf", "_VD_SpatialSmoother")
  return clip._VD_SpatialSmoother(default(diameter,5), default(strength,3))
}

# example:
# ConvertToRGB()
# VD_SpatialSmoother(5, 3)
# ConvertToYUY2()


###############################################
# Denoise by tHE fISH, v1.0                   #
#                                             #
# The output of this filter is 100% identical #
# to the output of the deflicker filter with  #
# a window size of 1 !                        #
#                                             #
# softening (0-?)                             #
###############################################

function VD_Denoise(clip clip, int "softening")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\Denoise.vdf", "_VD_Denoise", 10)
  return clip._VD_Denoise(default(softening,10))
}

# example:
# ConvertToRGB()
# VD_Denoise(10)
# ConvertToYUY2()


#####################################
# PicFix by Gabest, v1.04           #
#                                   #
# threshold (0-16), error_cor (0-4) #
#####################################

function VD_PicFix(clip clip, int "threshold", int "error_cor") 
{ 
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\picfix.dll", "_VD_PicFix") 
return clip._VD_PicFix(default(threshold,6), default(error_cor,3)) 
} 

# example: 
# ConvertToRGB() 
# VD_PicFix(6, 3)
# ConvertToYUY2()


#########################################
# CNR Filter by Gilles Mouchard, v1.1   #
#                                       #
# luma_m, luma_n, Chroma1_X, Chroma1_Y, #
# Chroma2_X, Chroma2_Y (0-100),         #
# Chroma_shift (-10..10)                #
#########################################

function VD_CNR(clip clip, bool "luma_wide", int "luma_X", int "luma_Y",
  \  bool "chroma1_wide", int "chroma1_X", int "chroma1_Y", bool "chroma2_wide", 
  \  int "chroma2_X", int "chroma2_Y", int "chroma_shift")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\cnr.vdf", "_VD_CNR", 1)
return clip._VD_CNR(default(luma_wide,true)?1:0, default(round(2.56*luma_X),192), default(round(2.24*luma_Y),35),
  \  default(chroma1_wide,false)?1:0, default(round(2.56*chroma1_X),256), default(round(2.24*chroma1_Y),47),
  \  default(chroma2_wide,false)?1:0, default(round(2.56*chroma2_X),256), default(round(2.24*chroma2_Y),47),
  \  default(chroma_shift,0))
}


# example: 
# ConvertToRGB() 
# VD_CNR(true, 75, 16, false, 100, 21, false, 100, 21, 0) 
# ConvertToYUY2()


#############################################
# Shadow smoother by Valentim Batista, v0.7 #
# threshold (0-8), strength (1-23),         #
# difference (0-6)                          #
#############################################

function VD_ShadowSmoother(clip clip, int "threshold", int "strength", 
  \  int "difference", bool "pixellock", bool "noiselock", bool "postsmooth") 
{ 
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\shadowsmoother07.vdf", "_VD_ShadowSmoother") 
return clip._VD_ShadowSmoother(default(threshold,4), default(strength,15), default(difference,2), 
  \  default(pixellock,false)?1:0, default(noiselock,false)?1:0, default(postsmooth,false)?1:0) 
}

# example: 
# ConvertToRGB() 
# VD_ShadowSmoother(4, 15, 2, false, false, false) 
# ConvertToYUY2()


#####################################################
# DeinterlacePALMovie Filter by Gunnar Thalin, v1.1 #
#                                                   #
#####################################################

function VD_DeinterlacePALMovie(clip clip, bool "swapfieldfirst")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\DeinterlacePALMovie.vdf", "_VD_DeinterlacePALMovie", 1)
return clip._VD_DeinterlacePALMovie(default(swapfieldfirst,false)?1:0)
}

# example: 
# ConvertToRGB() 
# VD_DeinterlacePALMovie(true)
# ConvertToYUY2()


##########################################################
# WNR (Wavelet Noise Reduction) filter by thejam79, v0.1 #
# Only for PC's using SSE instructions (like pentiums).  #
#                                                        #
# all values (0-255). This filter is also a native       #
# AviSynth filter.                                       #
##########################################################

function VD_WNR(clip clip, int Y_X0, int Y_Y0, int Y_X1, int Y_Y1, int Y_X2, int Y_Y2, 
  \  int Cb_X0, int Cb_Y0, int Cb_X1, int Cb_Y1, int Cb_X2, int Cb_Y2, 
  \  int Cr_X0, int Cr_Y0, int Cr_X1, int Cr_Y1, int Cr_X2, int Cr_Y2)
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\wnr.vdf", "_VD_WNR", 0)
return clip._VD_WNR(Y_X0*256+Y_Y0, Y_X1*256+Y_Y1, Y_X2*256+Y_Y2, Cb_X0*256+Cb_Y0, Cb_X1*256+Cb_Y1, 
  \  Cb_X2*256+Cb_Y2, Cb_X0*256+Cr_Y0, Cr_X1*256+Cr_Y1, Cr_X2*256+Cr_Y2)
}

# example: 
# ConvertToRGB() 
# VD_WNR(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 255, 0, 255, 0)
# ConvertToYUY2()


############################################
# Pseudocolor filter by Donald Graft, v1.0 #
#                                          #
############################################

function VD_Pseudocolor(clip clip, string "filename")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\Pseudocolor.vdf", "_VD_Pseudocolor", 0)
return clip._VD_Pseudocolor(default(filename, VirtualDub_plugin_directory+"\palettes\topo.map"))
}

# example1:
# AviSource("C:\Program Files\VirtualDub\plugins\palettes\grayramp.avi")
# ConvertToRGB() 
# VD_Pseudocolor("G:\topo.map")
# ConvertToYUY2()

# example2:
# AviSource("G:\DivX\anestacia-paid_my_dues(divx412).avi").Greyscale
# ConvertToRGB() 
# VD_Pseudocolor("G:\topo.map")
# ConvertToYUY2()

##################################################################
# Tweaker filter by Christopher P. LaRosa, v1.1                  #
#                                                                #
# download: http://www.geocities.com/cplarosa/video/tweaker.htm  #
##################################################################

function VD_Tweaker(clip clip,  string "filename")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\tweaker.vdf", "_VD_Tweaker", 1)
return clip._VD_Tweaker(filename)
}

# example:
# AviSource("j:\spirited.avi")
# ConvertToRGB()
# VD_Tweaker("g:\tmp\script.fts")
# ConvertToYUY2()
Personal tools