View Full Version : 4:3 to 16:9
alexx7777
14th September 2012, 20:22
Hello, Please Explain the function and Panorama.avs -http://originaltrilogy.com/forum/topic.cfm/Panorama--an-AviSynth-function-for-converting-4-3-into-16-9/topic/7642/, WarpedResize (720, 576, 0.88, 1). Tried to use both, the visible result of 4:3. The effect should be stretching to 16:9 or not? The site with a description of the functions shown panorama.avs naglyalno rastiyazhenie image to 16:9. My source - 720x576 (4:3, BFF). How can I get the result of tension?
Keiyakusha
14th September 2012, 20:44
whats so hard?
Panorama(strength=10)
Edit: well 10 maybe too extreme :D
alexx7777
14th September 2012, 21:28
Thanks, Keiyakusha. Applied, how to make that picture stretched to 16:9? After applying, there is no visible difference.
Script dolzhent be so -
Import("panorama.avs")
DirectShowSource("D:\Video.avi", fps=25.000, convertfps=true)
Converttoyv12(interlaced=true)
panorama(4)
Encoding through Virtualdub Lagarith codec ostaetsya same result 4:3. I do not understand how to do to get 16:9.
Keiyakusha
14th September 2012, 21:49
It doesn't changes the resolution. It alters information withing the same resolution.If you want square pixels - resize it yourself after that. panorama(4).lanczosresize(1024,576) or whatever you want.
Edit: of course you can do anamorphic encoding and specify proper sar/par, but Virtualdub and lagarith approach probably won't help you with that.
alexx7777
14th September 2012, 22:18
Thank, Keiyakusha, now understood
CarlPig
15th September 2012, 00:32
Source
http://cloudho.st/i/fLr1FDqC.jpg
Panorama
http://cloudho.st/i/VhOWKDqC.jpg
Script:
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\plugins\test.avsi")
DGSource("G:\Soldaterkammerater_Test\title00.dgi",fieldop=0)
#deinterlace
#crop
#resize
#denoise
panorama(4).lanczosresize(720,404)
i seems the heads are pressed together
sorry for my bad english
Keiyakusha
15th September 2012, 00:53
Source
i seems the heads are pressed together
Not sure what do you mean, but of course there will be distortion. You can't create real 16x9 from 4x3.
CarlPig
15th September 2012, 00:59
So i need to crop?
LemMotlow
15th September 2012, 20:01
d l t d
wonkey_monkey
15th September 2012, 20:49
Or any mix of the above - my personal choice is to crop to 14:9 (biased to the upper half of the picture), then stretch to 15:9 in a 16:9 frame.
David
TheSkiller
16th September 2012, 20:58
Maybe slightly offtopic but... :)
For DVD my preference is not to mess with it and leave it original – since like that, when viewed on a widescreen TV, the viewer has control of what he wants it to look like using the TV's formatting options. In other words the viewer gets to apply *his* preference in terms of formatting.
If you format a 4:3 source to 16:9 in some way and encode it like that you:
- force viewers to watch it the way you think it looks good
- provide a vastly inferior experience when viewed on a classic 4:3 TV
- reduce the horizontal and/or vertical resolution by up to 25%
CarlPig
16th September 2012, 23:01
Here are the choices:
4:3 image, normal display on 16:9
http://dc204.4shared.com/download/bw6MI7rC/4x3_16x9_pillars.png
4:3 stretched to 16:9
http://dc625.4shared.com/download/_jWXaP0Z/4x3_stretch.png
4:3 enlarged/cropped to 16:9
http://dc537.4shared.com/download/QLGehvP1/4x3_enlarge_crop.png
http://dc611.4shared.com/download/2kJcX1ia/aspect_ratio.png
Thanks for the choices.
But explain more about "4:3 enlarged/cropped to 16:9"
How much is cropped etc.
IanB
16th September 2012, 23:20
Example :-
640 x 480 square pixel 4:3 source
Want the height for a 640 wide square pixel 16:9 output.
Height = Width / Aspect ratio = 640 / (16 / 9) = 360
Therefore you need to crop 480 - 360 = 120 lines total. This can be 60 top and 60 bottom or 40 top and 80 bottom or anything else that adds to 120.
Basically you crop away 25% of the height going from 4:3 to 16:9 this way, this is why people crib a bit, like only crop 20% and then stretch a bit.
CarlPig
17th September 2012, 09:38
Thank you for the explanation.
Jenyok
13th March 2013, 20:16
New function Panorama2() ...
Blocks with 32 pixels width and central block with 64 pixels width.
Source video should be 768x480 or 768x576 or 640x480 or 640x400 .
.
# Function for converting 4:3 full frame clips to simulated 16:9
# square pixel w=1 : h=1
# source video should be 768x480 or 768x576 or 640x480 or 640x400
# and have display AR of 4:3
#
# script by Jenyok - forum.doom9.org
#
function Panorama2(clip clp, int "strength")
{
#
#
strength = Default(strength, 1)
strength = (strength < 1) ? 1 : (strength > 4) ? 4 : strength
#
#
wd = clp.width
ht = clp.height
#
#
rgb = false
rgb24 = false
rgb32 = false
YUY2 = false
YV12 = false
YUV = false
rgb = IsRGB(clp)
rgb24 = IsRGB24(clp)
rgb32 = IsRGB32(clp)
YUY2 = IsYUY2(clp)
YV12 = IsYV12(clp)
YUV = IsYUV(clp)
#
#
clp=ConvertToRGB32(clp)
# Lanczos4Resize(clip, int target_width, int target_height,
# float "src_left", float "src_top",
# float "src_width", float "src_height")
#
a01=(strength == 1) ? clp.lanczos4resize(136, ht, 0, 0, -736, 0) : \
(strength == 2) ? clp.lanczos4resize(152, ht, 0, 0, -736, 0) : \
(strength == 3) ? clp.lanczos4resize(164, ht, 0, 0, -736, 0) : \
clp.lanczos4resize(177, ht, 0, 0, -736, 0)
# a01 = a01.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a02=(strength == 1) ? clp.lanczos4resize(134, ht, 32, 0, -704, 0) : \
(strength == 2) ? clp.lanczos4resize(146, ht, 32, 0, -704, 0) : \
(strength == 3) ? clp.lanczos4resize(156, ht, 32, 0, -704, 0) : \
clp.lanczos4resize(168, ht, 32, 0, -704, 0)
# a02 = a02.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a03=(strength == 1) ? clp.lanczos4resize(132, ht, 64, 0, -672, 0) : \
(strength == 2) ? clp.lanczos4resize(142, ht, 64, 0, -672, 0) : \
(strength == 3) ? clp.lanczos4resize(150, ht, 64, 0, -672, 0) : \
clp.lanczos4resize(158, ht, 64, 0, -672, 0)
# a03 = a03.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a04=(strength == 1) ? clp.lanczos4resize(130, ht, 96, 0, -640, 0) : \
(strength == 2) ? clp.lanczos4resize(138, ht, 96, 0, -640, 0) : \
(strength == 3) ? clp.lanczos4resize(142, ht, 96, 0, -640, 0) : \
clp.lanczos4resize(148, ht, 96, 0, -640, 0)
# a04 = a04.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a05=(strength == 1) ? clp.lanczos4resize(129, ht, 128, 0, -608, 0) : \
(strength == 2) ? clp.lanczos4resize(132, ht, 128, 0, -608, 0) : \
(strength == 3) ? clp.lanczos4resize(142, ht, 128, 0, -608, 0) : \
clp.lanczos4resize(148, ht, 128, 0, -608, 0)
# a05 = a05.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a06=clp.lanczos4resize(128, ht, 160, 0, -576, 0)
# a06=a06.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a07=(strength == 1) ? clp.lanczos4resize(127, ht, 192, 0, -544, 0) : \
(strength == 2) ? clp.lanczos4resize(124, ht, 192, 0, -544, 0) : \
(strength == 3) ? clp.lanczos4resize(123, ht, 192, 0, -544, 0) : \
clp.lanczos4resize(122, ht, 192, 0, -544, 0)
# a07 = a07.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a08=(strength == 1) ? clp.lanczos4resize(126, ht, 224, 0, -512, 0) : \
(strength == 2) ? clp.lanczos4resize(122, ht, 224, 0, -512, 0) : \
(strength == 3) ? clp.lanczos4resize(118, ht, 224, 0, -512, 0) : \
clp.lanczos4resize(116, ht, 224, 0, -512, 0)
# a08 = a08.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a09=(strength == 1) ? clp.lanczos4resize(124, ht, 256, 0, -480, 0) : \
(strength == 2) ? clp.lanczos4resize(118, ht, 256, 0, -480, 0) : \
(strength == 3) ? clp.lanczos4resize(114, ht, 256, 0, -480, 0) : \
clp.lanczos4resize(108, ht, 256, 0, -480, 0)
# a09 = a09.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a10=(strength == 1) ? clp.lanczos4resize(122, ht, 288, 0, -448, 0) : \
(strength == 2) ? clp.lanczos4resize(116, ht, 288, 0, -448, 0) : \
(strength == 3) ? clp.lanczos4resize(110, ht, 288, 0, -448, 0) : \
clp.lanczos4resize(102, ht, 288, 0, -448, 0)
# a10 = a10.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a11=(strength == 1) ? clp.lanczos4resize(120, ht, 320, 0, -416, 0) : \
(strength == 2) ? clp.lanczos4resize(112, ht, 320, 0, -416, 0) : \
(strength == 3) ? clp.lanczos4resize(104, ht, 320, 0, -416, 0) : \
clp.lanczos4resize(96, ht, 320, 0, -416, 0)
# a11 = a11.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
# Center block 64 pixels
#
a12=(strength == 1) ? clp.lanczos4resize(242, ht, 352, 0, -352, 0) : \
(strength == 2) ? clp.lanczos4resize(224, ht, 352, 0, -352, 0) : \
(strength == 3) ? clp.lanczos4resize(208, ht, 352, 0, -352, 0) : \
clp.lanczos4resize(192, ht, 352, 0, -352, 0)
# a12 = a12.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a13=(strength == 1) ? clp.lanczos4resize(120, ht, 416, 0, -320, 0) : \
(strength == 2) ? clp.lanczos4resize(112, ht, 416, 0, -320, 0) : \
(strength == 3) ? clp.lanczos4resize(104, ht, 416, 0, -320, 0) : \
clp.lanczos4resize(96, ht, 416, 0, -320, 0)
# a13 = a13.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a14=(strength == 1) ? clp.lanczos4resize(122, ht, 448, 0, -288, 0) : \
(strength == 2) ? clp.lanczos4resize(116, ht, 448, 0, -288, 0) : \
(strength == 3) ? clp.lanczos4resize(110, ht, 448, 0, -288, 0) : \
clp.lanczos4resize(102, ht, 448, 0, -288, 0)
# a14 = a14.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a15=(strength == 1) ? clp.lanczos4resize(124, ht, 480, 0, -256, 0) : \
(strength == 2) ? clp.lanczos4resize(118, ht, 480, 0, -256, 0) : \
(strength == 3) ? clp.lanczos4resize(114, ht, 480, 0, -256, 0) : \
clp.lanczos4resize(108, ht, 480, 0, -256, 0)
# a15 = a15.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a16=(strength == 1) ? clp.lanczos4resize(126, ht, 512, 0, -224, 0) : \
(strength == 2) ? clp.lanczos4resize(122, ht, 512, 0, -224, 0) : \
(strength == 3) ? clp.lanczos4resize(118, ht, 512, 0, -224, 0) : \
clp.lanczos4resize(116, ht, 512, 0, -224, 0)
# a16 = a16.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a17=(strength == 1) ? clp.lanczos4resize(127, ht, 544, 0, -192, 0) : \
(strength == 2) ? clp.lanczos4resize(124, ht, 544, 0, -192, 0) : \
(strength == 3) ? clp.lanczos4resize(123, ht, 544, 0, -192, 0) : \
clp.lanczos4resize(122, ht, 544, 0, -192, 0)
# a17 = a17.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a18=clp.lanczos4resize(128, ht, 576, 0, -160, 0)
# a18=a18.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a19=(strength == 1) ? clp.lanczos4resize(129, ht, 608, 0, -128, 0) : \
(strength == 2) ? clp.lanczos4resize(132, ht, 608, 0, -128, 0) : \
(strength == 3) ? clp.lanczos4resize(136, ht, 608, 0, -128, 0) : \
clp.lanczos4resize(138, ht, 608, 0, -128, 0)
# a19 = a19.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a20=(strength == 1) ? clp.lanczos4resize(130, ht, 640, 0, -96, 0) : \
(strength == 2) ? clp.lanczos4resize(138, ht, 640, 0, -96, 0) : \
(strength == 3) ? clp.lanczos4resize(142, ht, 640, 0, -96, 0) : \
clp.lanczos4resize(148, ht, 640, 0, -96, 0)
# a20 = a20.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a21=(strength == 1) ? clp.lanczos4resize(132, ht, 672, 0, -64, 0) : \
(strength == 2) ? clp.lanczos4resize(142, ht, 672, 0, -64, 0) : \
(strength == 3) ? clp.lanczos4resize(150, ht, 672, 0, -64, 0) : \
clp.lanczos4resize(158, ht, 672, 0, -64, 0)
# a21 = a21.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a22=(strength == 1) ? clp.lanczos4resize(134, ht, 704, 0, -32, 0) : \
(strength == 2) ? clp.lanczos4resize(146, ht, 704, 0, -32, 0) : \
(strength == 3) ? clp.lanczos4resize(156, ht, 704, 0, -32, 0) : \
clp.lanczos4resize(168, ht, 704, 0, -32, 0)
# a22 = a22.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a23=(strength == 1) ? clp.lanczos4resize(136, ht, 736, 0, 0, 0) : \
(strength == 2) ? clp.lanczos4resize(152, ht, 736, 0, 0, 0) : \
(strength == 3) ? clp.lanczos4resize(164, ht, 736, 0, 0, 0) : \
clp.lanczos4resize(177, ht, 736, 0, 0, 0)
clp=StackHorizontal(a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, a11, a12, \
a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23)
clp = lanczos4resize(clp, wd, ht)
clp = (rgb == true) ? clp.ConvertToRGB() : \
(rgb24 == true) ? clp.ConvertToRGB24() : \
(rgb32 == true) ? clp.ConvertToRGB32() : \
(YUY2 == true) ? clp.ConvertToYUY2() : \
(YV12 == true) ? clp.ConvertToYV12() : \
(YUV == true) ? clp.ConvertToYV12() : clp
return (clp)
}
.
.
Usage of this function Panorama2() ...
.
# Source video
#
AVISource("01-Build_AVI_from_TS_2013.avi") # Source video 768x576 pix , AR 4 : 3
Panorama2(strength=2)
Spline64Resize(1024, 576) # AR 16 : 9
ConvertToYUY2()
johnmeyer
13th March 2013, 20:40
Is Panorama2 an anamorphic stretching algorithm? If so, can you post before/after examples?
Jenyok
14th March 2013, 06:06
Some changes in function Panorama2() ...
.
clp = (rgb == true) ? clp.ConvertToRGB() : \
(rgb24 == true) ? clp.ConvertToRGB24() : \
(rgb32 == true) ? clp.ConvertToRGB32() : \
(YUY2 == true) ? clp.ConvertToYUY2() : \
(YV12 == true) ? clp.ConvertToYV12() : \
(YUV == true) ? clp.ConvertToYV12() : clp
Jenyok
14th March 2013, 09:03
This is one more new function Panorama3() ...
Blocks are with 32 pixels width and central block is with 64 pixels width.
Source video should be 768x480 or 768x576 or 640x480 or 640x400 .
There are 9 (nine) steps of panoraming, see code of function.
.
Begin
.
# Function for converting 4:3 full frame clips to simulated 16:9
# square pixel w=1 : h=1
# source vid should be 768x480 or 768x576 or 640x480 or 640x400
# and have display AR of 4:3
#
# script by Jenyok - forum.doom9.org
#
function Panorama3(clip clp, int "strength")
{
# 3.80 -> 4 -> 4.25000 (strength=1)
# 3.70 -> 4 -> 4.41875 (strength=2)
# 3.60 -> 4 -> 4.58750 (strength=3)
# 3.50 -> 4 -> 4.75625 (strength=4)
# 3.40 -> 4 -> 4.92500 (strength=5)
# 3.30 -> 4 -> 5.09375 (strength=6)
# 3.20 -> 4 -> 5.26250 (strength=7)
# 3.10 -> 4 -> 5.43125 (strength=8)
# 3.00 -> 4 -> 5.60000 (strength=9)
#
#
strength = Default(strength, 1)
strength = (strength < 1) ? 1 : (strength > 9) ? 9 : strength
#
#
wd = clp.width
ht = clp.height
#
#
rgb = false
rgb24 = false
rgb32 = false
YUY2 = false
YV12 = false
YUV = false
rgb = IsRGB(clp)
rgb24 = IsRGB24(clp)
rgb32 = IsRGB32(clp)
YUY2 = IsYUY2(clp)
YV12 = IsYV12(clp)
YUV = IsYUV(clp)
#
#
clp=ConvertToRGB32(clp)
# Lanczos4Resize(clip, int target_width, int target_height,
# float "src_left", float "src_top",
# float "src_width", float "src_height")
#
a01=(strength == 1) ? clp.lanczos4resize(136, ht, 0, 0, -736, 0) : \
(strength == 2) ? clp.lanczos4resize(141, ht, 0, 0, -736, 0) : \
(strength == 3) ? clp.lanczos4resize(147, ht, 0, 0, -736, 0) : \
(strength == 4) ? clp.lanczos4resize(152, ht, 0, 0, -736, 0) : \
(strength == 5) ? clp.lanczos4resize(158, ht, 0, 0, -736, 0) : \
(strength == 6) ? clp.lanczos4resize(163, ht, 0, 0, -736, 0) : \
(strength == 7) ? clp.lanczos4resize(168, ht, 0, 0, -736, 0) : \
(strength == 8) ? clp.lanczos4resize(174, ht, 0, 0, -736, 0) : \
clp.lanczos4resize(179, ht, 0, 0, -736, 0)
# a01 = a01.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a02=(strength == 1) ? clp.lanczos4resize(134, ht, 32, 0, -704, 0) : \
(strength == 2) ? clp.lanczos4resize(139, ht, 32, 0, -704, 0) : \
(strength == 3) ? clp.lanczos4resize(143, ht, 32, 0, -704, 0) : \
(strength == 4) ? clp.lanczos4resize(147, ht, 32, 0, -704, 0) : \
(strength == 5) ? clp.lanczos4resize(152, ht, 32, 0, -704, 0) : \
(strength == 6) ? clp.lanczos4resize(156, ht, 32, 0, -704, 0) : \
(strength == 7) ? clp.lanczos4resize(160, ht, 32, 0, -704, 0) : \
(strength == 8) ? clp.lanczos4resize(165, ht, 32, 0, -704, 0) : \
clp.lanczos4resize(169, ht, 32, 0, -704, 0)
# a02 = a02.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a03=(strength == 1) ? clp.lanczos4resize(133, ht, 64, 0, -672, 0) : \
(strength == 2) ? clp.lanczos4resize(136, ht, 64, 0, -672, 0) : \
(strength == 3) ? clp.lanczos4resize(139, ht, 64, 0, -672, 0) : \
(strength == 4) ? clp.lanczos4resize(143, ht, 64, 0, -672, 0) : \
(strength == 5) ? clp.lanczos4resize(146, ht, 64, 0, -672, 0) : \
(strength == 6) ? clp.lanczos4resize(149, ht, 64, 0, -672, 0) : \
(strength == 7) ? clp.lanczos4resize(152, ht, 64, 0, -672, 0) : \
(strength == 8) ? clp.lanczos4resize(155, ht, 64, 0, -672, 0) : \
clp.lanczos4resize(159, ht, 64, 0, -672, 0)
# a03 = a03.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a04=(strength == 1) ? clp.lanczos4resize(131, ht, 96, 0, -640, 0) : \
(strength == 2) ? clp.lanczos4resize(133, ht, 96, 0, -640, 0) : \
(strength == 3) ? clp.lanczos4resize(136, ht, 96, 0, -640, 0) : \
(strength == 4) ? clp.lanczos4resize(138, ht, 96, 0, -640, 0) : \
(strength == 5) ? clp.lanczos4resize(140, ht, 96, 0, -640, 0) : \
(strength == 6) ? clp.lanczos4resize(142, ht, 96, 0, -640, 0) : \
(strength == 7) ? clp.lanczos4resize(144, ht, 96, 0, -640, 0) : \
(strength == 8) ? clp.lanczos4resize(146, ht, 96, 0, -640, 0) : \
clp.lanczos4resize(148, ht, 96, 0, -640, 0)
# a04 = a04.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a05=(strength == 1) ? clp.lanczos4resize(130, ht, 128, 0, -608, 0) : \
(strength == 2) ? clp.lanczos4resize(131, ht, 128, 0, -608, 0) : \
(strength == 3) ? clp.lanczos4resize(132, ht, 128, 0, -608, 0) : \
(strength == 4) ? clp.lanczos4resize(133, ht, 128, 0, -608, 0) : \
(strength == 5) ? clp.lanczos4resize(134, ht, 128, 0, -608, 0) : \
(strength == 6) ? clp.lanczos4resize(135, ht, 128, 0, -608, 0) : \
(strength == 7) ? clp.lanczos4resize(136, ht, 128, 0, -608, 0) : \
(strength == 8) ? clp.lanczos4resize(137, ht, 128, 0, -608, 0) : \
clp.lanczos4resize(138, ht, 128, 0, -608, 0)
# a05 = a05.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a06=clp.lanczos4resize(128, ht, 160, 0, -576, 0)
# a06=a06.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a07=(strength == 1) ? clp.lanczos4resize(127, ht, 192, 0, -544, 0) : \
(strength == 2) ? clp.lanczos4resize(126, ht, 192, 0, -544, 0) : \
(strength == 3) ? clp.lanczos4resize(125, ht, 192, 0, -544, 0) : \
(strength == 4) ? clp.lanczos4resize(125, ht, 192, 0, -544, 0) : \
(strength == 5) ? clp.lanczos4resize(124, ht, 192, 0, -544, 0) : \
(strength == 6) ? clp.lanczos4resize(123, ht, 192, 0, -544, 0) : \
(strength == 7) ? clp.lanczos4resize(123, ht, 192, 0, -544, 0) : \
(strength == 8) ? clp.lanczos4resize(122, ht, 192, 0, -544, 0) : \
clp.lanczos4resize(121, ht, 192, 0, -544, 0)
# a07 = a07.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a08=(strength == 1) ? clp.lanczos4resize(125, ht, 224, 0, -512, 0) : \
(strength == 2) ? clp.lanczos4resize(124, ht, 224, 0, -512, 0) : \
(strength == 3) ? clp.lanczos4resize(123, ht, 224, 0, -512, 0) : \
(strength == 4) ? clp.lanczos4resize(122, ht, 224, 0, -512, 0) : \
(strength == 5) ? clp.lanczos4resize(120, ht, 224, 0, -512, 0) : \
(strength == 6) ? clp.lanczos4resize(119, ht, 224, 0, -512, 0) : \
(strength == 7) ? clp.lanczos4resize(118, ht, 224, 0, -512, 0) : \
(strength == 8) ? clp.lanczos4resize(116, ht, 224, 0, -512, 0) : \
clp.lanczos4resize(115, ht, 224, 0, -512, 0)
# a08 = a08.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a09=(strength == 1) ? clp.lanczos4resize(124, ht, 256, 0, -480, 0) : \
(strength == 2) ? clp.lanczos4resize(122, ht, 256, 0, -480, 0) : \
(strength == 3) ? clp.lanczos4resize(120, ht, 256, 0, -480, 0) : \
(strength == 4) ? clp.lanczos4resize(118, ht, 256, 0, -480, 0) : \
(strength == 5) ? clp.lanczos4resize(116, ht, 256, 0, -480, 0) : \
(strength == 6) ? clp.lanczos4resize(115, ht, 256, 0, -480, 0) : \
(strength == 7) ? clp.lanczos4resize(113, ht, 256, 0, -480, 0) : \
(strength == 8) ? clp.lanczos4resize(111, ht, 256, 0, -480, 0) : \
clp.lanczos4resize(109, ht, 256, 0, -480, 0)
# a09 = a09.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a10=(strength == 1) ? clp.lanczos4resize(123, ht, 288, 0, -448, 0) : \
(strength == 2) ? clp.lanczos4resize(120, ht, 288, 0, -448, 0) : \
(strength == 3) ? clp.lanczos4resize(118, ht, 288, 0, -448, 0) : \
(strength == 4) ? clp.lanczos4resize(115, ht, 288, 0, -448, 0) : \
(strength == 5) ? clp.lanczos4resize(113, ht, 288, 0, -448, 0) : \
(strength == 6) ? clp.lanczos4resize(110, ht, 288, 0, -448, 0) : \
(strength == 7) ? clp.lanczos4resize(108, ht, 288, 0, -448, 0) : \
(strength == 8) ? clp.lanczos4resize(105, ht, 288, 0, -448, 0) : \
clp.lanczos4resize(102, ht, 288, 0, -448, 0)
# a10 = a10.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a11=(strength == 1) ? clp.lanczos4resize(122, ht, 320, 0, -416, 0) : \
(strength == 2) ? clp.lanczos4resize(118, ht, 320, 0, -416, 0) : \
(strength == 3) ? clp.lanczos4resize(115, ht, 320, 0, -416, 0) : \
(strength == 4) ? clp.lanczos4resize(112, ht, 320, 0, -416, 0) : \
(strength == 5) ? clp.lanczos4resize(109, ht, 320, 0, -416, 0) : \
(strength == 6) ? clp.lanczos4resize(106, ht, 320, 0, -416, 0) : \
(strength == 7) ? clp.lanczos4resize(102, ht, 320, 0, -416, 0) : \
(strength == 8) ? clp.lanczos4resize(99, ht, 320, 0, -416, 0) : \
clp.lanczos4resize(96, ht, 320, 0, -416, 0)
# a11 = a11.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
# Center block 64 pixels
#
a12=(strength == 1) ? clp.lanczos4resize(243, ht, 352, 0, -352, 0) : \
(strength == 2) ? clp.lanczos4resize(236, ht, 352, 0, -352, 0) : \
(strength == 3) ? clp.lanczos4resize(230, ht, 352, 0, -352, 0) : \
(strength == 4) ? clp.lanczos4resize(224, ht, 352, 0, -352, 0) : \
(strength == 5) ? clp.lanczos4resize(218, ht, 352, 0, -352, 0) : \
(strength == 6) ? clp.lanczos4resize(211, ht, 352, 0, -352, 0) : \
(strength == 7) ? clp.lanczos4resize(205, ht, 352, 0, -352, 0) : \
(strength == 8) ? clp.lanczos4resize(198, ht, 352, 0, -352, 0) : \
clp.lanczos4resize(192, ht, 352, 0, -352, 0)
# a12 = a12.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
Jenyok
14th March 2013, 09:04
Continue (end) .
.
a13=(strength == 1) ? clp.lanczos4resize(122, ht, 416, 0, -320, 0) : \
(strength == 2) ? clp.lanczos4resize(118, ht, 416, 0, -320, 0) : \
(strength == 3) ? clp.lanczos4resize(115, ht, 416, 0, -320, 0) : \
(strength == 4) ? clp.lanczos4resize(112, ht, 416, 0, -320, 0) : \
(strength == 5) ? clp.lanczos4resize(109, ht, 416, 0, -320, 0) : \
(strength == 6) ? clp.lanczos4resize(106, ht, 416, 0, -320, 0) : \
(strength == 7) ? clp.lanczos4resize(102, ht, 416, 0, -320, 0) : \
(strength == 8) ? clp.lanczos4resize(99, ht, 416, 0, -320, 0) : \
clp.lanczos4resize(96, ht, 416, 0, -320, 0)
# a13 = a13.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a14=(strength == 1) ? clp.lanczos4resize(123, ht, 448, 0, -288, 0) : \
(strength == 2) ? clp.lanczos4resize(120, ht, 448, 0, -288, 0) : \
(strength == 3) ? clp.lanczos4resize(118, ht, 448, 0, -288, 0) : \
(strength == 4) ? clp.lanczos4resize(115, ht, 448, 0, -288, 0) : \
(strength == 5) ? clp.lanczos4resize(113, ht, 448, 0, -288, 0) : \
(strength == 6) ? clp.lanczos4resize(110, ht, 448, 0, -288, 0) : \
(strength == 7) ? clp.lanczos4resize(108, ht, 448, 0, -288, 0) : \
(strength == 8) ? clp.lanczos4resize(105, ht, 448, 0, -288, 0) : \
clp.lanczos4resize(102, ht, 448, 0, -288, 0)
# a14 = a14.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a15=(strength == 1) ? clp.lanczos4resize(124, ht, 480, 0, -256, 0) : \
(strength == 2) ? clp.lanczos4resize(122, ht, 480, 0, -256, 0) : \
(strength == 3) ? clp.lanczos4resize(120, ht, 480, 0, -256, 0) : \
(strength == 4) ? clp.lanczos4resize(118, ht, 480, 0, -256, 0) : \
(strength == 5) ? clp.lanczos4resize(116, ht, 480, 0, -256, 0) : \
(strength == 6) ? clp.lanczos4resize(115, ht, 480, 0, -256, 0) : \
(strength == 7) ? clp.lanczos4resize(113, ht, 480, 0, -256, 0) : \
(strength == 8) ? clp.lanczos4resize(111, ht, 480, 0, -256, 0) : \
clp.lanczos4resize(109, ht, 480, 0, -256, 0)
# a15 = a15.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a16=(strength == 1) ? clp.lanczos4resize(125, ht, 512, 0, -224, 0) : \
(strength == 2) ? clp.lanczos4resize(124, ht, 512, 0, -224, 0) : \
(strength == 3) ? clp.lanczos4resize(123, ht, 512, 0, -224, 0) : \
(strength == 4) ? clp.lanczos4resize(122, ht, 512, 0, -224, 0) : \
(strength == 5) ? clp.lanczos4resize(120, ht, 512, 0, -224, 0) : \
(strength == 6) ? clp.lanczos4resize(119, ht, 512, 0, -224, 0) : \
(strength == 7) ? clp.lanczos4resize(118, ht, 512, 0, -224, 0) : \
(strength == 8) ? clp.lanczos4resize(116, ht, 512, 0, -224, 0) : \
clp.lanczos4resize(115, ht, 512, 0, -224, 0)
# a16 = a16.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a17=(strength == 1) ? clp.lanczos4resize(127, ht, 544, 0, -192, 0) : \
(strength == 2) ? clp.lanczos4resize(126, ht, 544, 0, -192, 0) : \
(strength == 3) ? clp.lanczos4resize(125, ht, 544, 0, -192, 0) : \
(strength == 4) ? clp.lanczos4resize(125, ht, 544, 0, -192, 0) : \
(strength == 5) ? clp.lanczos4resize(124, ht, 544, 0, -192, 0) : \
(strength == 6) ? clp.lanczos4resize(123, ht, 544, 0, -192, 0) : \
(strength == 7) ? clp.lanczos4resize(123, ht, 544, 0, -192, 0) : \
(strength == 8) ? clp.lanczos4resize(122, ht, 544, 0, -192, 0) : \
clp.lanczos4resize(121, ht, 544, 0, -192, 0)
# a17 = a17.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a18=clp.lanczos4resize(128, ht, 576, 0, -160, 0)
# a18=a18.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a19=(strength == 1) ? clp.lanczos4resize(130, ht, 608, 0, -128, 0) : \
(strength == 2) ? clp.lanczos4resize(131, ht, 608, 0, -128, 0) : \
(strength == 3) ? clp.lanczos4resize(132, ht, 608, 0, -128, 0) : \
(strength == 4) ? clp.lanczos4resize(133, ht, 608, 0, -128, 0) : \
(strength == 5) ? clp.lanczos4resize(134, ht, 608, 0, -128, 0) : \
(strength == 6) ? clp.lanczos4resize(135, ht, 608, 0, -128, 0) : \
(strength == 7) ? clp.lanczos4resize(136, ht, 608, 0, -128, 0) : \
(strength == 8) ? clp.lanczos4resize(137, ht, 608, 0, -128, 0) : \
clp.lanczos4resize(138, ht, 608, 0, -128, 0)
# a19 = a19.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a20=(strength == 1) ? clp.lanczos4resize(131, ht, 640, 0, -96, 0) : \
(strength == 2) ? clp.lanczos4resize(133, ht, 640, 0, -96, 0) : \
(strength == 3) ? clp.lanczos4resize(136, ht, 640, 0, -96, 0) : \
(strength == 4) ? clp.lanczos4resize(138, ht, 640, 0, -96, 0) : \
(strength == 5) ? clp.lanczos4resize(140, ht, 640, 0, -96, 0) : \
(strength == 6) ? clp.lanczos4resize(142, ht, 640, 0, -96, 0) : \
(strength == 7) ? clp.lanczos4resize(144, ht, 640, 0, -96, 0) : \
(strength == 8) ? clp.lanczos4resize(146, ht, 640, 0, -96, 0) : \
clp.lanczos4resize(148, ht, 640, 0, -96, 0)
# a20 = a20.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a21=(strength == 1) ? clp.lanczos4resize(133, ht, 672, 0, -64, 0) : \
(strength == 2) ? clp.lanczos4resize(136, ht, 672, 0, -64, 0) : \
(strength == 3) ? clp.lanczos4resize(139, ht, 672, 0, -64, 0) : \
(strength == 4) ? clp.lanczos4resize(143, ht, 672, 0, -64, 0) : \
(strength == 5) ? clp.lanczos4resize(146, ht, 672, 0, -64, 0) : \
(strength == 6) ? clp.lanczos4resize(149, ht, 672, 0, -64, 0) : \
(strength == 7) ? clp.lanczos4resize(152, ht, 672, 0, -64, 0) : \
(strength == 8) ? clp.lanczos4resize(155, ht, 672, 0, -64, 0) : \
clp.lanczos4resize(159, ht, 672, 0, -64, 0)
# a21 = a21.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a22=(strength == 1) ? clp.lanczos4resize(134, ht, 704, 0, -32, 0) : \
(strength == 2) ? clp.lanczos4resize(139, ht, 704, 0, -32, 0) : \
(strength == 3) ? clp.lanczos4resize(143, ht, 704, 0, -32, 0) : \
(strength == 4) ? clp.lanczos4resize(147, ht, 704, 0, -32, 0) : \
(strength == 5) ? clp.lanczos4resize(152, ht, 704, 0, -32, 0) : \
(strength == 6) ? clp.lanczos4resize(156, ht, 704, 0, -32, 0) : \
(strength == 7) ? clp.lanczos4resize(160, ht, 704, 0, -32, 0) : \
(strength == 8) ? clp.lanczos4resize(165, ht, 704, 0, -32, 0) : \
clp.lanczos4resize(169, ht, 704, 0, -32, 0)
# a22 = a22.AddBorders(0, 0, 8, 0, $FFFFFF) # for debbug only
a23=(strength == 1) ? clp.lanczos4resize(136, ht, 736, 0, 0, 0) : \
(strength == 2) ? clp.lanczos4resize(141, ht, 736, 0, 0, 0) : \
(strength == 3) ? clp.lanczos4resize(147, ht, 736, 0, 0, 0) : \
(strength == 4) ? clp.lanczos4resize(152, ht, 736, 0, 0, 0) : \
(strength == 5) ? clp.lanczos4resize(158, ht, 736, 0, 0, 0) : \
(strength == 6) ? clp.lanczos4resize(163, ht, 736, 0, 0, 0) : \
(strength == 7) ? clp.lanczos4resize(168, ht, 736, 0, 0, 0) : \
(strength == 8) ? clp.lanczos4resize(174, ht, 736, 0, 0, 0) : \
clp.lanczos4resize(179, ht, 736, 0, 0, 0)
clp=StackHorizontal(a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, a11, a12, \
a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23)
clp = lanczos4resize(clp, wd, ht)
clp = (rgb == true) ? clp.ConvertToRGB() : \
(rgb24 == true) ? clp.ConvertToRGB24() : \
(rgb32 == true) ? clp.ConvertToRGB32() : \
(YUY2 == true) ? clp.ConvertToYUY2() : \
(YV12 == true) ? clp.ConvertToYV12() : \
(YUV == true) ? clp.ConvertToYV12() : clp
return (clp)
}
wonkey_monkey
14th March 2013, 09:43
Maybe my bees can help...
Using xyremap (http://forum.doom9.org/showthread.php?t=166087):
function panostretch(clip input, float strength) {
strength=(strength==0) ? "n 0.01 *" : string(strength)
rgb=input.converttorgb32
a=xyremap(rgb,x="x w / 2 * "+strength+" ^ w * 0.5 *")
b=xyremap(rgb.fliphorizontal,x="x w / 2 * "+strength+" ^ w * 0.5 *")
stackhorizontal(a.crop(0,0,input.width/2,0),b.crop(0,0,input.width/2,0).fliphorizontal)
}
A strength of 1 has no effect. Passing a strength of 0 returns an animated version where strength=current_frame/100 (so if frame 123 looks good, use strength=1.23).
You should view the result at your final (horizontally stretched or vertically compressed, for 4:3->16:9) size so you can judge the correctness of central features:
avisource("myvid.avi") # let's assume this is PAL, 720x576 (strictly speaking cropping may be required)
panostretch(1.23)
bicubicresize(1024,576)
Jenyok
14th March 2013, 11:10
davidhorman
.
Tested XYRemap and PanoStretch() function...
Really works...
.
Gavino
14th March 2013, 17:11
(Applies to both Panorama2 and Panorama3)
(strength < 1) ? 1 : (strength > 9) ? 9 : strength
This line does nothing. Should be:
strength = (strength < 1) ? 1 : (strength > 9) ? 9 : strength
clp = (YUY2 == true) ? clp.ConvertToYUY2() : clp
clp = (YV12 == true) ? clp.ConvertToYV12() : clp
clp = (YUV == true) ? clp.ConvertToYV12() : clp
Because of the last line, this will end up converting an original YUY2 clip to YV12.
I would change these three lines to:
clp = (YUY2 == true) ? clp.ConvertToYUY2() :
\ (YUV == true) ? clp.ConvertToYV12() : clp
Poutnik
14th March 2013, 18:39
I have archieved interesting results by realtime ffdshow AVS postprocessing of PAL SD 4:3 on wide 16:10 screen.
I did not perform either simple stretching, either cropping.
I used instead a WarpResize feature by Tom Barry's SimpleResize plugin.
Image got resized to wide screen, but not linearly, keeping ratios at the center near to natural. So circle did not get ratio of diameters 1 : 1.33, but e.g. 1.05 > 1.15.
Said by other words - e.g. faces that would got too wide,
became little sqeezed in wide and little prolonged in heigth,
both nelinearly.
If effect is overdone, it could looking weird.
But if effect is set mild, just partially correcting wide stratching, it was not bad at all.
I do not have any script handy, but it is not difficult to tweak paramters.
http://web.archive.org/web/20110208133956/http://home.comcast.net/~tombarry970/
One reason to use WarpedResize would be when you have a clip with a 16:9 aspect ratio and
want to resize it for a 4:3 aspect ratio display without either clipping off valuable
info or having to display black bars. (or vice versa)
An example image of using WarpedResize for this can be found (for now) at
www.trbarry.com/WarpTest.jpg. This image was from a short HDTV digital capture that was
at a 1280x720 resolution, a 16:9 aspect ratio. It was downsized and warped to a 640x480
4:3 aspect ratio using the following script command:
WarpedResize(640,480,1.15,0.95))
so I guess, for the opposite, 4:3 -> 16:9 it could be like
WarpedResize(1920,1080,1/1.15,1/0.95))
the drawback can be that its basis is linear resizer ( if warp parameters are 1 ).
Edit: But I guess one cam make warping within original resolution and the use better upsampling, e.g. Spline64resize.
Jenyok
14th March 2013, 19:26
Gavino
.
Thanks, mate.
All were changed yet.
.
.
Poutnik
.
I did not understand your post in such way ?
What values of parameters hwarp, vwarp could be, when converting from 768:576 (4:3) to 1024:576 (16:9) ?
.
Poutnik
15th March 2013, 11:36
Poutnik - I did not understand your post in such way ? What values of parameters hwarp, vwarp could be, when converting from 768:576 (4:3) to 1024:576 (16:9) ?.
Well, I cannot test the plugin right know, but a circle on the centre of screen 4:3 cecomes an 4:3 ellipse for screen 16:9 ( as 16:9 is 4:3 * 4:3 ).
Using WarpedResize(width, height, hWarp, vWarp), warp parameters 0.75, 1.0 should make such an ellipse on wide screen a circle again,
squeezing it horizontally 3/4. I.e. WarpedResize(1024, 576, 0.75, 1.0),
3 important notes:
1) Full centre compensation leads to weird non-linear visual effects out of a centre.
Instead of full compensation ( 0.75, 1 ) a partial compensation e.g. (0.84, 1.0) can be better to balance desired versus undesired effects.
2) Less apparent side-effects one can reach by compensation at both axes with the opposite effect.
E.g. instead of warp parameters 0.84, 1.0, one can use 0.92, 1.08, or just e.g.(0.88,1.04) .
The circle will be partially corrected by little squeezing horizontally and little prolonging vertically.
The same compensation effect will than have undesired effects less noticable, equally distributed on both axis.
3) If one insists on full compensation, using both axis way from point 2),
than warp parameters should be sqrt(3)/2, 2/sqrt(3) i.e cca (0.866, 1.157).
Jenyok
15th March 2013, 12:34
Hello, Please Explain the function and Panorama.avs -http://originaltrilogy.com/forum/topic.cfm/Panorama--an-AviSynth-function-for-converting-4-3-into-16-9/topic/7642/, WarpedResize (720, 576, 0.88, 1). Tried to use both, the visible result of 4:3. The effect should be stretching to 16:9 or not? The site with a description of the functions shown panorama.avs naglyalno rastiyazhenie image to 16:9. My source - 720x576 (4:3, BFF). How can I get the result of tension?
.
.
.
Where do I get picture, see web link below, in 640x480 pix or 768x576 pix with best quality ?
Or, maybe, generate using AVIsynth ?
To do some tests with this picture.
.
http://originaltrilogy.com/forum/topic.cfm/Panorama--an-AviSynth-function-for-converting-4-3-into-16-9/topic/7642/
.
Gavino
15th March 2013, 12:56
Gavino
Thanks, mate.
All were changed yet.
Where?
The errors are still there in posts #15, #17, #18 and #19.
Poutnik
15th March 2013, 14:23
Possible suggested function PanaramaWR, using WarpedResize function from SimpleResize plugin by Tom Barry.
I have not written AVs function for long time, so feel free to discover bugs...
Edit: Added Interlaced option of WarpedResize.
function PanoramaWR( clip c, int w, int h, float "Strength", float "AxisShare", bool "bInterlaced" ) {
#Function resizes video to other DAR, correcting distorsion at central region by WarpResize function with nonlinear pixel mapping.
#Sideeffects are optinally mitigated by using partial only correction along both axes.
#Strength = <0,1>, 0=no compensation, 1= full centre compensation
#AxisShare = <0,1>, 0=only stratched axis is compensated,
# 1=both axis are equally compensated by reciprocal ratios and effects
Strength = default(Strength,0.667) #guessed suggested value
AxisShare = default(AxisShare,0.667) #guessed suggested value
bInterlaced = default(bInterlaced,false)
Strength = min(1.0, max(0.0, Strength))
AxisShare = min(1.0, max(0.0, AxisShare))
RatioOfDARs = (float(w) / h) / (float(c.width) / c.height ) #Fixed, credit to Gavino
#Fixed, credit to Jenyok, and fixed again by myself
WarpRatio = 1/(RatioOfDARs * Strength + ( 1.0 - Strength) )
# WarpX = WarpRatio for AxisShare=0.0 up to sqrt(WarpRatio) for AxisShare=1.0
WarpX = exp (log(WarpRatio) * ( 1.0 - AxisShare/2.0 ))
WarpY = Warpx / WarpRatio
#For direct usage of WarpedResize, Plugin Autor used for 16:9 to 4:3 resize warpx 1.15, warpy 0.95.
#So for 4:3 to 16:9 it should be warpx = 1.0/1.15, warpy = 1.0/0.95
Return ( bInterlaced ) ? InterlacedWarpedResize(c,w,h,WarpX,WarpY) \
: WarpedResize(c,w,h,WarpX,WarpY)
}
Source("yourfile")
_IsIntelaced = false #IL status or detection to be provided
ConvertToYUY2(interlace=_IsIntelaced)
PanoramaWR(1024,576, bInterlaced = _IsInterlaced)
function PanoramaWR2( clip c, int w, int h, float "Strength", float "AxisShare", bool "bExtResize", bool "bWarpFirst" ) {
#Function resizes video to other DAR,
#correcting distortion at central region by WarpedResize function of simpleresize plugin with nonlinear pixel mapping.
#Added option of external Spline64Resize
#removed interlace option
#included YV12 - YUY2 - YV12 conversions.
#Sideeffects are optinally mitigated by using partial only correction along both axes.
#Strength = <0,1>, 0=no compensation, 1= full centre compensation
#AxisShare = <0,1>, 0=only stratched axis is compensated,
# 1=both axis are equally compensated by reciprocal ratios and effects
Strength = default(Strength,0.667) #guessed suggested value
AxisShare = default(AxisShare,0.667) #guessed suggested value
bExtResize = default(bExtResize,false)
bWarpFirst = default(bWarpFirst,true)
Strength = min(1.0, max(0.0, Strength))
AxisShare = min(1.0, max(0.0, AxisShare))
RatioOfDARs = (float(w) / h) / (float(c.width) / c.height ) #Fixed, credit to Gavino
#Fixed, credit to Jenyok, and fixed again by myself
WarpRatio = 1/(RatioOfDARs * Strength + ( 1.0 - Strength) )
# WarpX = WarpRatio for AxisShare=0.0 up to sqrt(WarpRatio) for AxisShare=1.0
WarpX = exp (log(WarpRatio) * ( 1.0 - AxisShare/2.0 ))
WarpY = Warpx / WarpRatio
#For direct usage of WarpedResize, Plugin Autor used for 16:9 to 4:3 resize warpx 1.15, warpy 0.95.
#So for 4:3 to 16:9 it should be warpx = 1.0/1.15, warpy = 1.0/0.95
iWidth=c.width
iHeight=c.height
ConverttoYUY2(c)
( bExtResize ) \
? (bWarpFirst) \
? WarpedResize(iWidth,iHeight,WarpX,WarpY).Spline64Resize(w,h) \
: Spline64Resize(w,h).WarpedResize(last.width,last.height,WarpX,WarpY) \
: WarpedResize(w,h,WarpX,WarpY)
ConverttoYV12()
Return last
}
Jenyok
15th March 2013, 14:45
This is picture for test.
768 x 576 pixels.
.
Poutnik
.
Really so ?
WarpRatio = 1/RatioOfDARs * Strength
or maybe
WarpRatio = 1/ (RatioOfDARs * Strength) ???
.
Poutnik
15th March 2013, 15:00
WarpRatio = 1/ (RatioOfDARs * Strength) ???
.
Sure, corrected. Thanks. It was originally right, but I have corrupted it later.
Edit: Note that perhaps it is better to keep width more corrected, i.e. not using AxisShare=1.0,
as I think distortion along horizontal longer side can be less critical for HVS
because of larger viewing angle and vertically oriented human bodies.
Note that for pictures it is often more handy to upload them e,.g, to imageshack.us
and than post here a link structure tailored for webforums.
Like this:
http://img824.imageshack.us/img824/8695/snap032.png (http://imageshack.us/photo/my-images/824/snap032.png/)
Uploaded with ImageShack.us (http://imageshack.us)
Gavino
15th March 2013, 16:50
RatioOfDARs = ( w / h) / (c.width / c.height )
These will all be taken as integer divisions and hence the results truncated. You need to use:
RatioOfDARs = (float(w) / h) / (float(c.width) / c.height )
Poutnik
15th March 2013, 17:11
These will all be taken as integer divisions and hence the results truncated. You need to use:
RatioOfDARs = (float(w) / h) / (float(c.width) / c.height )
Thanks. As I have said, too long not writing any more complex AVS code. MeGUI makes sometime people lazy. :-)
Jenyok
15th March 2013, 18:54
Poutnik
.
I tested your function PanoramaWR(...) .
Really, function works very good.
.
Poutnik
15th March 2013, 19:32
I have added variant PanoramaWR2, with option of external resizer (Spline64Resize) after warping without resize.
Also added option for switching the order, resize first, then warping.
Also fixed again formula for Warpratio.
Jenyok
17th March 2013, 10:17
This is a script for generating test video clip for testing Panorama(...) functions and other non-liner convertion functions.
And generated video clip is in archive too.
All made with AVISynth.
.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.