Skip to content

Instantly share code, notes, and snippets.

@line0
line0 / RGB48YV12toRGB48Y.avsi
Last active December 29, 2015 11:49
converts RGB48YV12 to RGB48Y
function RGB48YV12toRGB48Y(clip c)
{
vers = VersionNumber()
tPref = IsFunction("FTurnLeft") ? "F" : ""
w = c.Width
h = c.Height
y = (vers < 2.60) ? c : c.ConvertToY8()
u = (vers < 2.60) ? c.UtoY() : c.UtoY8()
v = (vers < 2.60) ? c.VtoY() : c.VtoY8()
@line0
line0 / nnedi3_resize16_v3.0_gpumod.avsi
Last active December 28, 2015 18:59
nnedi3_resize16 v3.0 by mawen1250, modded to use nnedi3ocl with gpu=true
###### nnedi3_resize16 v3.0 ###### by mawen1250 ###### 2013.11.15 ######
###### from v2.8 on, nnedi3_resize16 only supports AviSynth v2.6 ######
###### Requirements: masktools v2.0a48, dither v1.24.0, nnedi3 v0.9.4, ######
###### SmoothAdjust v2.90, Contra-Sharpen mod 3.4, ######
###### FTurn v1.3.5 (not necessarily required but will improve speed) ######
###### Accept Y8, YV12, YV16, YV24 input, use nnedi3 and Dither_resize16(nr) for scaling ######
###### output format can be 8bit/16bit Y8/YV12/YV16/YV24 or RGB32/RGB24/RGB48YV12/RGB48Y ######
Function nnedi3_resize16(clip input, int "target_width", int "target_height", float "src_left", float "src_top",
@line0
line0 / StackedNto16
Last active December 27, 2015 19:49
function StackedNto16(clip c, int n)
{
Assert(8 <= n <= 15, "StackedNto16: bitdepth should be in range 8-15")
h = c.Height / 2
msb = c.Crop(0,0,0,-h)
lsb = c.Crop(0,h,0,0)
shamt = string(16-n)
msb16 = (n != 8) ? msb.mt_lutxy(lsb, "x " + shamt + " << y 8 " + shamt + " - >> +", v=3, u=3) : lsb
lsb16 = (n != 8) ? lsb.mt_lut("x " + shamt + " << 255 &u", v=3, u=3) : msb