Log in

View Full Version : SixLineResizer; DVD<->BD Conversion script


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.

Jenyok
16th March 2013, 06:17
There is no good way to add borders to video.
There is no good way to use any resizers, if upscaling video to 2 or more times, instead of NNEDI, NNEDI2, NNEDI3.
.
Maybe you will use function Panorama(...) instead of AddBorders(...) function, when converting 4:3 -> 16:9 or 16:9 -> 4:3, see web link.
http://forum.doom9.org/showthread.php?t=165911
.
.
http://forum.ixbt.com/topic.cgi?id=29:33007-9
.
This is a very good description of DAR, PAR, SAR with examples and pictures, see web link upper, but in Russian.
.

scharfis_brain
16th March 2013, 12:48
also there is warpedresize() out there, which lets you specify any arbitrary warping-factor for aspect-ratio conversion.

Poutnik
16th March 2013, 15:53
also there is warpedresize() out there, which lets you specify any arbitrary warping-factor for aspect-ratio conversion.

Exactly. One can also try these my ugly and probably not usable functions .. :) --> 4:3 to 16:9 -> PanoramaWR / PanoramaWR2 (http://forum.doom9.org/showthread.php?p=1619798#post1619798)