A very handy little function, but it (first version anyway) doesn't incorporate overscan (edit: sorry, not overscan;
nominal analogue blanking). It should scale up to a target of 702x576 (PAL) or 704x480 (NTSC) [these dimensions define the 4:3/16:9 box], then addborders to 720 (or 704, which is also legal for DVD).
David