// Copyright 2008 Matt Sandstršm/Too Much Too Soon // Magic Numbers courtesy of Lee Wilson and DC Gear // http://www.dc-gear.com/d90/ // This script is freeware, meaning you may copy and // distribute it free of charge, as long as it's kept intact, // including this message. Feel free to use the code as // inspiration for your own scripts, but don't steal. // Email me at mattias@beauty.se if you have any questions. // Thank you. Have fun. filter "D90 Upscaler" group "TMTS Video" FullFrame RenderEachFrameWhenStill InformationFlag("YUVaware") input theclip, "Source Clip", clip; input apply, "Mode", Popup, 1, "Native 1280x801", "Fit to fill" code float i; float kern[3][3]; point sp[4], dp[4] float magicnumbers[82]; float srcy=0, desty=0; float w,h,sw,sh,dur,offsetTC; dimensionsof(dest,w,h); image buf0[w][h],buf1[1280][802],buf2[1280][802] dest = src1; getLimits(theclip, dur, offsetTC); magicnumbers = {7,9,9,8,9,9,9,9,9,8,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9,8,9,9,9,9,9,8,9,9,7} channelfill(buf1,0,0,0,0); if dur > 0 getVideo(theclip, frame+offsetTC, buf0); else buf0 = src1 end if; for i = 0 to 81 MakeRect(dp, -640, desty-401, 1280, magicnumbers[i]) MakeRect(sp, -640, srcy-360, 1280, magicnumbers[i]) blitrect(buf0,sp,buf1,dp); srcy = srcy + magicnumbers[i]; desty = desty + magicnumbers[i] + 1; next; kern = { 0,1,0,0,0,0,0,1,0 }; convolve(buf1,buf2,kern,2,0); matte(buf1, buf2, buf2, 1, kalpha); MakeRect(sp, -640, -401, 1280, 801) if apply == 1 then w = 1280; h = 801; end if; MakeRect(dp, -w/2, -h/2, w, h) blitrect(buf2,sp,dest,dp);