Skip to content

Commit

Permalink
Released v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryx93 committed Dec 29, 2015
1 parent 6f60f04 commit a9b79b8
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 26 deletions.
14 changes: 10 additions & 4 deletions README.md
@@ -1,4 +1,4 @@
# AviSynth Shader v1.3
# AviSynth Shader v1.3.2

<a href="https://github.com/mysteryx93/AviSynthShader/releases">Download here >></a>

Expand Down Expand Up @@ -87,7 +87,7 @@ Precision: 1 to execute with 8-bit precision, 2 to execute with 16-bit precision
OutputPrecision: 1 to get an output clip with BYTE, 2 for UINT16, 3 for half-float. Default=2


#### SuperRes(Input, Passes, Strength, Softness, UpscaleCommand, MatrixIn, MatrixOut, Convert, lsb_in, lsb_upscale, lsb_out)
#### SuperRes(Input, Passes, Strength, Softness, UpscaleCommand, MatrixIn, MatrixOut, FormatOut, Convert, lsb_in, lsb_upscale, lsb_out)

In Shaders\SuperRes\SuperRes.avsi. Thanks to Shiandow for writing this great code!

Expand All @@ -107,12 +107,14 @@ UpscaleCommand: An upscaling command that must contain offset-correction. Ex: ""

MatrixIn/MatrixOut: The input and output color matrix (601 or 709). This can be used for color matrix conversion. Default="709" for both

FormatOut: The output format. Default = same as input.

Convert: Whether to call ConvertToShader and ConvertFromShader within the shader. Default=true

lsb_in, lsb_upscale, lsb_out: Whether the input, result of UpscaleCommand and output are to be converted to/from DitherTools' Stack16 format. Default=false


#### Super-xBR(Input, EdgeStrength, Sharpness, ThirdPass, Convert, lsb_in, lsb_out)
#### Super-xBR(Input, EdgeStrength, Sharpness, ThirdPass, FormatOut, Convert, lsb_in, lsb_out)

In Shaders\Super-xBR\super-xbr.avsi. Thanks to Shiandow for writing this great code!

Expand All @@ -128,12 +130,14 @@ Sharpness: Value between 0 and 1.5 specifying the weight. Default=1.

ThirdPass: Whether to run a 3rd pass. Default=true.

FormatOut: The output format. Default = same as input.

Convert: Whether to call ConvertToShader and ConvertFromShader within the shader. Default=true

lsb_in, lsb_out: Whether the input and output are to be converted to/from DitherTools' Stack16 format. Default=false


#### ColorMatrixShader(input, MatrixIn, MatrixOut)
#### ColorMatrixShader(input, MatrixIn, MatrixOut, FormatOut)

In Shaders\ColorMatrix\ColorMatrix.avsi

Expand All @@ -143,6 +147,8 @@ Arguments:

MatrixIn/MatrixOut: The input and output color matrix (601 or 709). Default="709" for both

FormatOut: The output format. Default = same as input.



Shiandow provides many other HLSL shaders available here that can be integrated into AviSynth.
Expand Down
Binary file added Release/AviSynthShader-1.3.2.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions Release/ChangeLog.txt
@@ -1,3 +1,9 @@
Version 1.3.2: December 28th 2015
- Added FormatOut to all scripts to set output format
- Fixed SuperRes when using lsb_out
- Removed bogus "info" in Super-xBR


Version 1.3.1: December 6th 2015
- Added support to convert to/from DitherTools' Stack16 format
- All Precision parameters are now 2 by default to avoid confusion
Expand Down
5 changes: 3 additions & 2 deletions Release/ColorMatrix/ColorMatrix.avsi
@@ -1,14 +1,15 @@
# Performs color matrix conversion with 16 bit depth to avoid banding
function ColorMatrixShader(clip input, string "MatrixIn", string "MatrixOut") {
function ColorMatrixShader(clip input, string "MatrixIn", string "MatrixOut", string "FormatOut") {
MatrixIn = default(MatrixIn, "709")
MatrixOut = default(MatrixOut, "709")
FormatOut = default(FormatOut, "")

Assert(MatrixIn == "601" || MatrixIn == "709", "MatrixIn must be 601 or 709")
Assert(MatrixOut == "601" || MatrixOut == "709", "MatrixOut must be 601 or 709")
Assert(MatrixIn != MatrixOut, "MatrixIn and MatrixOut must be different")

input
sourceFormat = IsYV12 ? "YV12" : IsYV24 ? "YV24" : ""
sourceFormat = FormatOut != "" ? FormatOut : IsYV12 ? "YV12" : IsYV24 ? "YV24" : ""
Assert(sourceFormat != "", chr(10) + "Source must be YV12 or YV24" + chr(10))

input = ConvertToShader(1)
Expand Down
13 changes: 9 additions & 4 deletions Release/ReadMe.txt
@@ -1,4 +1,4 @@
AviSynthShader by Etienne Charland
AviSynthShader v1.3.2 by Etienne Charland
Provides a bridge between AviSynth and HLSL pixel shaders for high bit depth processing on the GPU.
http://forum.doom9.org/showthread.php?t=172698

Expand All @@ -12,7 +12,7 @@ ConvertFromShader(2, "YV12")



#### SuperRes(Input, Passes, Strength, Softness, UpscaleCommand, MatrixIn, MatrixOut, Convert, lsb_in, lsb_upscale, lsb_out)
#### SuperRes(Input, Passes, Strength, Softness, UpscaleCommand, MatrixIn, MatrixOut, FormatOut, Convert, lsb_in, lsb_upscale, lsb_out)

Enhances upscaling quality.

Expand All @@ -30,12 +30,14 @@ UpscaleCommand: An upscaling command that must contain offset-correction. Ex: ""

MatrixIn/MatrixOut: The input and output color matrix (601 or 709). This can be used for color matrix conversion. Default="709" for both

FormatOut: The output format. Default = same as input.

Convert: Whether to call ConvertToShader and ConvertFromShader within the shader. Default=true

lsb_in, lsb_upscale, lsb_out: Whether the input, result of UpscaleCommand and output are to be converted to/from DitherTools' Stack16 format. Default=false


#### Super-xBR(Input, EdgeStrength, Sharpness, ThirdPass, Convert, lsb_in, lsb_out)
#### Super-xBR(Input, EdgeStrength, Sharpness, ThirdPass, FormatOut, Convert, lsb_in, lsb_out)

Doubles the size of the image. Produces a sharp result, but with severe ringing.

Expand All @@ -49,19 +51,22 @@ Sharpness: Value between 0 and 1.5 specifying the weight. Default=1.

ThirdPass: Whether to run a 3rd pass. Default=true.

FormatOut: The output format. Default = same as input.

Convert: Whether to call ConvertToShader and ConvertFromShader within the shader. Default=true

lsb_in, lsb_out: Whether the input and output are to be converted to/from DitherTools' Stack16 format. Default=false


#### ColorMatrixShader(input, MatrixIn, MatrixOut)
#### ColorMatrixShader(input, MatrixIn, MatrixOut, FormatOut)

Converts the color matrix with 16 bit depth to avoid banding. Source can be YV12, YV24, RGB24 or RGB32.

Arguments:

MatrixIn/MatrixOut: The input and output color matrix (601 or 709). Default="709" for both

FormatOut: The output format. Default = same as input.



Expand Down
10 changes: 5 additions & 5 deletions Release/Super-xBR/super-xbr.avsi
@@ -1,9 +1,10 @@
function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "ThirdPass", bool "Convert", bool "lsb_in", bool "lsb_out")
function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "ThirdPass", string "FormatOut", bool "Convert", bool "lsb_in", bool "lsb_out")
{
EdgeStrength = default(EdgeStrength, 1)
Sharpness = default(Sharpness, 1)
ThirdPass = default(ThirdPass, true)
Convert = default(Convert, true)
FormatOut = default(FormatOut, "")
lsb_in = default(lsb_in, false)
lsb_out = default(lsb_out, false)

Expand All @@ -16,9 +17,9 @@ function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "Thi
#convertYuv = convert && !IsRGB()
PrecisionIn = Convert && !lsb_in ? 1 : 2
PrecisionOut = Convert && !lsb_out ? 1 : 2
sourceFormat = IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : "RGB32"
sourceFormat = FormatOut != "" ? FormatOut : IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : "RGB32"

Input = convert ? ConvertToShader(Precision=PrecisionIn, lsb=lsb_in) : last
Input = convert ? ConvertToShader(PrecisionIn, lsb=lsb_in) : last

Input
InputWidth = Width / PrecisionIn
Expand Down Expand Up @@ -46,8 +47,7 @@ function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "Thi
#convertYuv ? Shader("GammaToYuv.cso") : nop
last.ExecuteShader(Input, Precision=2, Clip1Precision=PrecisionIn, OutputPrecision=PrecisionOut)

convert ? ConvertFromShader(Format=sourceFormat, Precision=PrecisionOut, lsb=lsb_out) : last
info
convert ? ConvertFromShader(PrecisionOut, Format=sourceFormat, lsb=lsb_out) : last

!ThirdPass && convert ? spline36resize(2*InputWidth, 2*InputHeight, -.5, -.5, 2*InputWidth, 2*InputHeight) : last
}
7 changes: 4 additions & 3 deletions Release/SuperRes/SuperRes.avsi
@@ -1,10 +1,11 @@
function SuperRes(clip Input, int "Passes", float "Strength", float "Softness", string "UpscaleCommand", string "MatrixIn", string "MatrixOut", bool "Convert", bool "lsb_in", bool "lsb_upscale", bool "lsb_out")
function SuperRes(clip Input, int "Passes", float "Strength", float "Softness", string "UpscaleCommand", string "MatrixIn", string "MatrixOut", string "FormatOut", bool "Convert", bool "lsb_in", bool "lsb_upscale", bool "lsb_out")
{
Passes = default(Passes, 1)
Strength = default(Strength, 1)
Softness = default(Softness, 0)
MatrixIn = default(MatrixIn, "709")
MatrixOut = default(MatrixOut, "709")
FormatOut = default(FormatOut, "")
Convert = default(Convert, true)
lsb_in = default(lsb_in, false)
lsb_upscale = default(lsb_upscale, false)
Expand All @@ -24,7 +25,7 @@ function SuperRes(clip Input, int "Passes", float "Strength", float "Softness",
PrecisionUpscale = Convert && !lsb_upscale ? 1 : 2
PrecisionOut = Convert && !lsb_out ? 1 : 2
ConvertYuv = convert && !IsRGB()
sourceFormat = IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : IsRGB32 ? "RGB32" : ""
sourceFormat = FormatOut != "" ? FormatOut : IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : IsRGB32 ? "RGB32" : ""
Assert(sourceFormat != "", chr(10) + "Source must be YV12, YV24, RGB24 or RGB32" + chr(10))

Original = convert ? ConvertToShader(PrecisionIn, lsb=lsb_in) : last
Expand All @@ -36,7 +37,7 @@ function SuperRes(clip Input, int "Passes", float "Strength", float "Softness",
Passes > 2 ? SuperResPass(Input, Original, Strength, Softness, 3, Passes, ConvertYuv, Convert, PrecisionIn, PrecisionUpscale, MatrixIn, MatrixOut) : nop

ExecuteShader(last, Input, Original, Precision=3, Clip1Precision=PrecisionUpscale, Clip2Precision=PrecisionIn, OutputPrecision=PrecisionOut)
convert ? ConvertFromShader(1, format=sourceFormat, lsb=lsb_out) : last
convert ? ConvertFromShader(PrecisionOut, format=sourceFormat, lsb=lsb_out) : last
}

function SuperResPass(clip cmd, clip Input, clip Original, float Strength, float Softness, int Pass, int Passes, bool ConvertYuv, bool Convert, int PrecisionIn, int PrecisionUpscale, string MatrixIn, string MatrixOut)
Expand Down
5 changes: 3 additions & 2 deletions Shaders/ColorMatrix/ColorMatrix.avsi
@@ -1,14 +1,15 @@
# Performs color matrix conversion with 16 bit depth to avoid banding
function ColorMatrixShader(clip input, string "MatrixIn", string "MatrixOut") {
function ColorMatrixShader(clip input, string "MatrixIn", string "MatrixOut", string "FormatOut") {
MatrixIn = default(MatrixIn, "709")
MatrixOut = default(MatrixOut, "709")
FormatOut = default(FormatOut, "")

Assert(MatrixIn == "601" || MatrixIn == "709", "MatrixIn must be 601 or 709")
Assert(MatrixOut == "601" || MatrixOut == "709", "MatrixOut must be 601 or 709")
Assert(MatrixIn != MatrixOut, "MatrixIn and MatrixOut must be different")

input
sourceFormat = IsYV12 ? "YV12" : IsYV24 ? "YV24" : ""
sourceFormat = FormatOut != "" ? FormatOut : IsYV12 ? "YV12" : IsYV24 ? "YV24" : ""
Assert(sourceFormat != "", chr(10) + "Source must be YV12 or YV24" + chr(10))

input = ConvertToShader(1)
Expand Down
2 changes: 1 addition & 1 deletion Shaders/ColorMatrix/Test.avs
@@ -1,7 +1,7 @@
PluginPath="C:\GitHub\NaturalGroundingPlayer\NaturalGroundingPlayer\bin\Debug\Encoder\"
LoadPlugin("C:\GitHub\AviSynthShader\Src\Release\Shader.dll")
#LoadPlugin(PluginPath+"Shader.dll")
LoadPlugin(PluginPath+"ColorMatrix.dll")
#LoadPlugin(PluginPath+"ColorMatrix.dll")
Import("ColorMatrix.avsi")

AviSource("F:\AVSMeter\Preview.avi", audio=false, pixel_type="YV12")
Expand Down
6 changes: 3 additions & 3 deletions Shaders/Super-xBR/super-xbr.avsi
@@ -1,9 +1,10 @@
function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "ThirdPass", bool "Convert", bool "lsb_in", bool "lsb_out")
function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "ThirdPass", string "FormatOut", bool "Convert", bool "lsb_in", bool "lsb_out")
{
EdgeStrength = default(EdgeStrength, 1)
Sharpness = default(Sharpness, 1)
ThirdPass = default(ThirdPass, true)
Convert = default(Convert, true)
FormatOut = default(FormatOut, "")
lsb_in = default(lsb_in, false)
lsb_out = default(lsb_out, false)

Expand All @@ -16,7 +17,7 @@ function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "Thi
#convertYuv = convert && !IsRGB()
PrecisionIn = Convert && !lsb_in ? 1 : 2
PrecisionOut = Convert && !lsb_out ? 1 : 2
sourceFormat = IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : "RGB32"
sourceFormat = FormatOut != "" ? FormatOut : IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : "RGB32"

Input = convert ? ConvertToShader(PrecisionIn, lsb=lsb_in) : last

Expand Down Expand Up @@ -47,7 +48,6 @@ function SuperXBR(clip Input, float "EdgeStrength", float "Sharpness", bool "Thi
last.ExecuteShader(Input, Precision=2, Clip1Precision=PrecisionIn, OutputPrecision=PrecisionOut)

convert ? ConvertFromShader(PrecisionOut, Format=sourceFormat, lsb=lsb_out) : last
info

!ThirdPass && convert ? spline36resize(2*InputWidth, 2*InputHeight, -.5, -.5, 2*InputWidth, 2*InputHeight) : last
}
5 changes: 3 additions & 2 deletions Shaders/SuperRes/SuperRes.avsi
@@ -1,10 +1,11 @@
function SuperRes(clip Input, int "Passes", float "Strength", float "Softness", string "UpscaleCommand", string "MatrixIn", string "MatrixOut", bool "Convert", bool "lsb_in", bool "lsb_upscale", bool "lsb_out")
function SuperRes(clip Input, int "Passes", float "Strength", float "Softness", string "UpscaleCommand", string "MatrixIn", string "MatrixOut", string "FormatOut", bool "Convert", bool "lsb_in", bool "lsb_upscale", bool "lsb_out")
{
Passes = default(Passes, 1)
Strength = default(Strength, 1)
Softness = default(Softness, 0)
MatrixIn = default(MatrixIn, "709")
MatrixOut = default(MatrixOut, "709")
FormatOut = default(FormatOut, "")
Convert = default(Convert, true)
lsb_in = default(lsb_in, false)
lsb_upscale = default(lsb_upscale, false)
Expand All @@ -24,7 +25,7 @@ function SuperRes(clip Input, int "Passes", float "Strength", float "Softness",
PrecisionUpscale = Convert && !lsb_upscale ? 1 : 2
PrecisionOut = Convert && !lsb_out ? 1 : 2
ConvertYuv = convert && !IsRGB()
sourceFormat = IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : IsRGB32 ? "RGB32" : ""
sourceFormat = FormatOut != "" ? FormatOut : IsYV12 ? "YV12" : IsYV24 ? "YV24" : IsRGB24 ? "RGB24" : IsRGB32 ? "RGB32" : ""
Assert(sourceFormat != "", chr(10) + "Source must be YV12, YV24, RGB24 or RGB32" + chr(10))

Original = convert ? ConvertToShader(PrecisionIn, lsb=lsb_in) : last
Expand Down

0 comments on commit a9b79b8

Please sign in to comment.