Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
14th September 2012, 20:22 | #1 | Link |
Registered User
Join Date: Mar 2012
Posts: 69
|
4:3 to 16:9
Hello, Please Explain the function and Panorama.avs -http://originaltrilogy.com/forum/top...-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?
Last edited by alexx7777; 14th September 2012 at 20:25. |
14th September 2012, 21:28 | #3 | Link |
Registered User
Join Date: Mar 2012
Posts: 69
|
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. Last edited by alexx7777; 14th September 2012 at 21:34. |
14th September 2012, 21:49 | #4 | Link |
契約者
Join Date: Jun 2008
Posts: 1,576
|
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. Last edited by Keiyakusha; 14th September 2012 at 21:57. |
15th September 2012, 00:32 | #6 | Link |
Registered User
Join Date: Aug 2012
Posts: 74
|
Source
Panorama 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 Last edited by CarlPig; 15th September 2012 at 00:35. |
15th September 2012, 20:49 | #10 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,493
|
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 Last edited by wonkey_monkey; 15th September 2012 at 20:52. |
16th September 2012, 20:58 | #11 | Link |
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
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% |
16th September 2012, 23:20 | #13 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
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. |
13th March 2013, 20:16 | #15 | Link |
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 201
|
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 . . Code:
# 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() ... . Code:
# 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()
__________________
Warm and fuzzy (white and fluffy) Last edited by Jenyok; 15th March 2013 at 13:02. |
14th March 2013, 06:06 | #17 | Link |
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 201
|
Some changes in function Panorama2() ...
. Code:
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
__________________
Warm and fuzzy (white and fluffy) Last edited by Jenyok; 15th March 2013 at 13:03. |
14th March 2013, 09:03 | #18 | Link |
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 201
|
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 . Code:
# 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
__________________
Warm and fuzzy (white and fluffy) Last edited by Jenyok; 15th March 2013 at 13:00. |
14th March 2013, 09:04 | #19 | Link |
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 201
|
Continue (end) .
. Code:
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) }
__________________
Warm and fuzzy (white and fluffy) Last edited by Jenyok; 15th March 2013 at 13:01. |
14th March 2013, 09:43 | #20 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,493
|
Maybe my bees can help...
Using xyremap: Code:
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) } 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: Code:
avisource("myvid.avi") # let's assume this is PAL, 720x576 (strictly speaking cropping may be required) panostretch(1.23) bicubicresize(1024,576) |
Thread Tools | Search this Thread |
Display Modes | |
|
|