Let's say you have some deleted scenes you want to edit back into the main movie. The problem is, the deleted scenes are in 4:3, but your main feature is in 16:9 widescreen.

Geometry of 4:3 source
The standard options for dealing with this problem are:
a) Pillarbox the 4:3 frame into a 16:9 frame. You end up with black bars either side of the 4:3 frame.

4:3 image pillarboxed into 16:9 frame
b) Zoom in on a 16:9 frame within the 4:3 frame. You end up cropping the top and bottom of the image.

4:3 image cropped and zoomed to make it 16:9
c) Stretch the 4:3 frame out horizontally to make it 16:9. You end up with a distorted aspect ratio.

4:3 image stretched to make it 16:9
This AviSynth function gives you a 4th option. The idea came from the manufacturers of widescreen TVs. Many sets give you the option to display 4:3 material in a mode that stretches the image differentially; the central area where the most important action occurs is not stretched as much as the image towards the edges of the screen (which is normally just background).

Panoramically stretched 4:3 image. No cropping, no black bars,
and central portion of image is not too stretched
When using the Panorama() function you have a choice of 4 strength settings:
1. A weak effect - not much different to a uniform horizontal stretch.
2. Medium - still stretched, although a little more natural looking at the centre, minor bit of distortion towards the edges.
3. Strong - not much of a stretch at the centre, noticeable distortion at the image edges.
4. Very strong - aspect ratio of central portion is almost correct, but there are large distortions at the edges.
Please remember that I am not an AviSynth guru; there are probably neater/better ways to do this. I would welcome any suggestions for improvement.
Here is the function:
function Panorama(clip clp, int "strength")
{
# function for converting 4:3 full frame clips to simulated 16:9
# source vid should be 720x480 or 720x576 and have display AR of 4:3
# script by Moth3r - originaltrilogy.com
ht=clp.height
a=(strength==1)?clp.lanczos4resize(256,ht,0,0,-660,0): \
(strength==2)?clp.lanczos4resize(284,ht,0,0,-660,0): \
(strength==3)?clp.lanczos4resize(308,ht,0,0,-660,0): \
clp.lanczos4resize(332,ht,0,0,-660,0)
b=(strength==1)?clp.lanczos4resize(248,ht,60,0,-600,0): \
(strength==2)?clp.lanczos4resize(260,ht,60,0,-600,0): \
(strength==3)?clp.lanczos4resize(272,ht,60,0,-600,0): \
clp.lanczos4resize(284,ht,60,0,-600,0)
c=clp.lanczos4resize(240,ht,120,0,-540,0)
d=(strength==1)?clp.lanczos4resize(236,ht,180,0,-480,0): \
(strength==2)?clp.lanczos4resize(228,ht,180,0,-480,0): \
(strength==3)?clp.lanczos4resize(220,ht,180,0,-480,0): \
clp.lanczos4resize(212,ht,180,0,-480,0)
e=(strength==1)?clp.lanczos4resize(232,ht,240,0,-420,0): \
(strength==2)?clp.lanczos4resize(216,ht,240,0,-420,0): \
(strength==3)?clp.lanczos4resize(204,ht,240,0,-420,0): \
clp.lanczos4resize(192,ht,240,0,-420,0)
f=(strength==1)?clp.lanczos4resize(456,ht,300,0,-300,0): \
(strength==2)?clp.lanczos4resize(424,ht,300,0,-300,0): \
(strength==3)?clp.lanczos4resize(392,ht,300,0,-300,0): \
clp.lanczos4resize(360,ht,300,0,-300,0)
g=(strength==1)?clp.lanczos4resize(232,ht,420,0,-240,0): \
(strength==2)?clp.lanczos4resize(216,ht,420,0,-240,0): \
(strength==3)?clp.lanczos4resize(204,ht,420,0,-240,0): \
clp.lanczos4resize(192,ht,420,0,-240,0)
h=(strength==1)?clp.lanczos4resize(236,ht,480,0,-180,0): \
(strength==2)?clp.lanczos4resize(228,ht,480,0,-180,0): \
(strength==3)?clp.lanczos4resize(220,ht,480,0,-180,0): \
clp.lanczos4resize(212,ht,480,0,-180,0)
i=clp.lanczos4resize(240,ht,540,0,-120,0)
j=(strength==1)?clp.lanczos4resize(248,ht,600,0,-60,0): \
(strength==2)?clp.lanczos4resize(260,ht,600,0,-60,0): \
(strength==3)?clp.lanczos4resize(272,ht,600,0,-60,0): \
clp.lanczos4resize(284,ht,600,0,-60,0)
k=(strength==1)?clp.lanczos4resize(256,ht,660,0,0,0): \
(strength==2)?clp.lanczos4resize(284,ht,660,0,0,0): \
(strength==3)?clp.lanczos4resize(308,ht,660,0,0,0): \
clp.lanczos4resize(332,ht,660,0,0,0)
clp=StackHorizontal(a, b, c, d, e, f, g, h, i, j, k)
return clp.lanczos4resize(720,ht)
}
(Now, who's going to be first to put the cut scenes back into dark_jedi's Howard the Duck release?) {
# function for converting 4:3 full frame clips to simulated 16:9
# source vid should be 720x480 or 720x576 and have display AR of 4:3
# script by Moth3r - originaltrilogy.com
ht=clp.height
a=(strength==1)?clp.lanczos4resize(256,ht,0,0,-660,0): \
(strength==2)?clp.lanczos4resize(284,ht,0,0,-660,0): \
(strength==3)?clp.lanczos4resize(308,ht,0,0,-660,0): \
clp.lanczos4resize(332,ht,0,0,-660,0)
b=(strength==1)?clp.lanczos4resize(248,ht,60,0,-600,0): \
(strength==2)?clp.lanczos4resize(260,ht,60,0,-600,0): \
(strength==3)?clp.lanczos4resize(272,ht,60,0,-600,0): \
clp.lanczos4resize(284,ht,60,0,-600,0)
c=clp.lanczos4resize(240,ht,120,0,-540,0)
d=(strength==1)?clp.lanczos4resize(236,ht,180,0,-480,0): \
(strength==2)?clp.lanczos4resize(228,ht,180,0,-480,0): \
(strength==3)?clp.lanczos4resize(220,ht,180,0,-480,0): \
clp.lanczos4resize(212,ht,180,0,-480,0)
e=(strength==1)?clp.lanczos4resize(232,ht,240,0,-420,0): \
(strength==2)?clp.lanczos4resize(216,ht,240,0,-420,0): \
(strength==3)?clp.lanczos4resize(204,ht,240,0,-420,0): \
clp.lanczos4resize(192,ht,240,0,-420,0)
f=(strength==1)?clp.lanczos4resize(456,ht,300,0,-300,0): \
(strength==2)?clp.lanczos4resize(424,ht,300,0,-300,0): \
(strength==3)?clp.lanczos4resize(392,ht,300,0,-300,0): \
clp.lanczos4resize(360,ht,300,0,-300,0)
g=(strength==1)?clp.lanczos4resize(232,ht,420,0,-240,0): \
(strength==2)?clp.lanczos4resize(216,ht,420,0,-240,0): \
(strength==3)?clp.lanczos4resize(204,ht,420,0,-240,0): \
clp.lanczos4resize(192,ht,420,0,-240,0)
h=(strength==1)?clp.lanczos4resize(236,ht,480,0,-180,0): \
(strength==2)?clp.lanczos4resize(228,ht,480,0,-180,0): \
(strength==3)?clp.lanczos4resize(220,ht,480,0,-180,0): \
clp.lanczos4resize(212,ht,480,0,-180,0)
i=clp.lanczos4resize(240,ht,540,0,-120,0)
j=(strength==1)?clp.lanczos4resize(248,ht,600,0,-60,0): \
(strength==2)?clp.lanczos4resize(260,ht,600,0,-60,0): \
(strength==3)?clp.lanczos4resize(272,ht,600,0,-60,0): \
clp.lanczos4resize(284,ht,600,0,-60,0)
k=(strength==1)?clp.lanczos4resize(256,ht,660,0,0,0): \
(strength==2)?clp.lanczos4resize(284,ht,660,0,0,0): \
(strength==3)?clp.lanczos4resize(308,ht,660,0,0,0): \
clp.lanczos4resize(332,ht,660,0,0,0)
clp=StackHorizontal(a, b, c, d, e, f, g, h, i, j, k)
return clp.lanczos4resize(720,ht)
}
