sumawo13
28th February 2013, 21:32
function slr(clip c,float par,float dar,int resx,int resy,float left,float top,float right,float bottom){
modx=isrgb(c)?1:2
mody=isrgb(c)||isyuy2(c)||isyv16(c)?1:2
lr=round((((c.height()*dar)-(c.width()*par))/2)/float(modx))*modx
tb=round(((((c.width()*par)/dar)-c.height())/2)/float(mody))*mody
c.addborders(lr,tb,lr,tb).bicubicresize(resx,resy,0,1,left,top,right,bottom)}
I'm working on a function to automate the process of converting the aspect ratio and frame size of Blu-ray material to DVD and back. I'm thinking of adding options for NNEDI and other HQ resamplers and possible even incorporating QTGMC and various IVTC filters into the function.
Right now the DAR, PAR and resolution are set directly, but I'm going to improve that with options for 'NTSC/PAL/HD720/HD1080', et cetera.
I have a lot of plans but I'm starting out small. I'd appreciate advisory on best practices, what I can do to improve my code, and any other criticism.
modx=isrgb(c)?1:2
mody=isrgb(c)||isyuy2(c)||isyv16(c)?1:2
lr=round((((c.height()*dar)-(c.width()*par))/2)/float(modx))*modx
tb=round(((((c.width()*par)/dar)-c.height())/2)/float(mody))*mody
c.addborders(lr,tb,lr,tb).bicubicresize(resx,resy,0,1,left,top,right,bottom)}
I'm working on a function to automate the process of converting the aspect ratio and frame size of Blu-ray material to DVD and back. I'm thinking of adding options for NNEDI and other HQ resamplers and possible even incorporating QTGMC and various IVTC filters into the function.
Right now the DAR, PAR and resolution are set directly, but I'm going to improve that with options for 'NTSC/PAL/HD720/HD1080', et cetera.
I have a lot of plans but I'm starting out small. I'd appreciate advisory on best practices, what I can do to improve my code, and any other criticism.