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. |
2nd January 2011, 00:25 | #141 | Link | ||
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
A Happy New Year, to all our Avisynth friends and family.
Quote:
The effect of the algorithm is to paste all of the input rows together as one single very long row, then slice them up based on the new width (= input width + skew). Skew can also be negative in which case the last skew pixels of each line are added to the beginning of the next line and you get some extra lines at the end. The last line is padded with grey pixels when required. The geometry of the output is calculated thus :- . OutWidth = InWidth + Skew // signed skew values acceptable . OutHeight = (InHeight*InWidth + OutWidth-1) / OutWidth // Ceiling Quote:
Microsoft specify 4 byte, DWORD, alignment for the simple DIB compatible formats, RGB24, RGB32, YUY2 and Y8. They make no specification for other formats, i.e. it is format specific. Avery Lee in VirtualDub assumes all planar YUV formats are packed, i.e. pitch = rowsize, and all DIB compatible formats are DWORD aligned, i.e. pitch = (rowsize+3)/4 * 4. By default Avisynth conforms to VirtualDub's alignment and packing expectations. For other software using AVIFile input that may assume DWORD alignment of a planar format the user can set OPT_AVIPadScanlines=True. With VirtualDub's direct stream copy mode the Avisynth AVIFile emulation packing is copied through, so DWORD aligned planar AVI files can be created by this method. Both DirectShowSource (257) and AviSource (260b3) test for and support both packed and DWORD aligned planar memory layouts. For image widths such that the chroma rowsize is mod4 there is never an issue, i.e YV24 is mod4, YV16 and YV12 are mod8, YV411 is mod16. But for other widths the assumptions made by the software in use becomes relevant. If the result of processing a planar output Avisynth script, via the AVIFile interface, shows row skewing then OPT_AVIPadScanlines=True may help. |
||
3rd January 2011, 00:51 | #143 | Link |
Anime addict
Join Date: Feb 2009
Location: Spain
Posts: 673
|
In this link, you have avaliable different versions included MT. http://avisynth.org/mediawiki/Main_Page
|
12th January 2011, 01:49 | #145 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
Does this bug exist in 2.6?
Code:
#crop bug exposebug=false#set to true to crash n=exposebug?241:240 colorbars crop(0,n,0,n) #~ File "pyavs.pyo", line 310, in _GetFrame #~ File "avisynth.pyo", line 139, in BitBlt #~ WindowsError: exception: access violation reading 0x02DDFFE0 |
12th January 2011, 02:32 | #146 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Yes it does.
Reason is code in transform.cpp: Code:
} else { // RGB is upside-down _top = vi.height - _height - _top; } if (_left + _width > vi.width || _top + _height > vi.height) env->ThrowError("Crop: you cannot use crop to enlarge or 'shift' a clip"); |
12th January 2011, 03:09 | #149 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
could we update this page:
http://avisynth.org/mediawiki/Known_Issues I don't know where else to put it. Last edited by jmac698; 12th January 2011 at 11:46. |
12th January 2011, 11:47 | #150 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
I was wondering if this behavior exists in 2.6, and if you can think of a way of reducing memory usage, and also improve the color problems to the same amount of accuracy as Layer, finally why do I get the wrong lines at the top when n>=26?:
Code:
#Overlay uses color conversions, this can be a problem if called many times #you will see an increasing yellowish color at the top of the screen #the script also uses a large amount of memory #Layer has none of these issues #Layer does have issues when n>=26, the wrong lines appear base=blankclip.trim(0,9) over=colorbars.trim(0,9) showissue=true#Be careful with overlayissue, large values of n cause excessive memory use leading to a crash showissue?overlayissue(base,over,25):layernonissue(base.resetmask,over.resetmask,26) function overlayissue(clip base, clip over, int n) { n<2?overlay(base,over.crop(0,n-1,0,1),y=n-1):overlay(overlayissue(base,over.crop(0,n-1,0,1),n-1),over.crop(0,n-1,0,1),y=n-1) } function layernonissue(clip base, clip over, int n) { n<2?layer(base,over.crop(0,n-1,0,1),y=n-1):layer(layernonissue(base,over.crop(0,n-1,0,1),n-1),over.crop(0,n-1,0,1),y=n-1) } Last edited by jmac698; 12th January 2011 at 12:03. |
12th January 2011, 13:47 | #151 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
The second parameter should just be over at all recursive levels. (Would have been easier using GScript ) The same error exists in overlayissue, which probably explains the crashes for large n. |
|
12th January 2011, 13:58 | #152 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
Great, that fixed one of the problems. There is still a huge amount of memory used in overlay, hundreds of MB.
Code:
#Overlay uses color conversions, this can be a problem if called many times #you will see an increasing yellowish color at the top of the screen #the script also uses a large amount of memory #Layer has none of these issues base=blankclip.trim(0,9) over=colorbars.trim(0,9) showissue=true#Be careful with overlayissue, large values of n cause excessive memory use leading to a crash showissue?overlayissue(base,over,25):layernonissue(base.resetmask,over.resetmask,400) function overlayissue(clip base, clip over, int n) { n<2?overlay(base,over.crop(0,n-1,0,1),y=n-1):overlay(overlayissue(base,over,n-1),over.crop(0,n-1,0,1),y=n-1) } function layernonissue(clip base, clip over, int n) { n<2?layer(base,over.crop(0,n-1,0,1),y=n-1):layer(layernonissue(base,over,n-1),over.crop(0,n-1,0,1),y=n-1) } |
22nd January 2011, 17:18 | #154 | Link | |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
latest repository does not compile in .net 2008:
Quote:
Last edited by kemuri-_9; 22nd January 2011 at 17:21. |
|
25th April 2011, 10:00 | #155 | Link |
Registered User
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
|
I try last official Avisynth 2.6 with simple script
Code:
ImageSource("TSW Charger V4.4.jpg", end=0) ConvertToYUY2() nnediresize_YUY2() function nnediresize2x(clip c, bool pY, bool pU, bool pV) { v = c.nnedi3(dh=true,Y=pY,U=pU,V=pV,field=0).turnleft() v = v.nnedi3(dh=true,Y=pY,U=pU,V=pV,field=0).turnright() return v } function nnediresize_YUY2(clip c) { cy = c cu = c.utoy() cv = c.vtoy() cy = nnediresize2x(cy,true,false,false) cu = nnediresize2x(cu,true,false,false) cv = nnediresize2x(cv,true,false,false) return ytouv(cu,cv,cy) } function nnediresize_YV12(clip c) { return nnediresize2x(c,true,true,true) } Please explain. yup. |
25th April 2011, 12:20 | #156 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Sorry the YUY2 version of the YtoUV() code is broken. See post 132 above by Stainless.
The planar version works so you could use an intermediate YV16 and then convert that to YUY2 at the end. Also a better workflow in 2.6 would be RGB -> YV24 -> nnedi3 -> YV16 -> YUY2, which would save doubling the chroma width. Code:
ImageSource("TSW Charger V4.4.jpg", end=0) # RGB Format ConvertToYV24() # No chroma subsampling nnediresize_YUY2() function nnediresize2x(clip c, bool pY, bool pU, bool pV) { v = c.nnedi3(dh=true,Y=pY,U=pU,V=pV,field=0).turnleft() v = v.nnedi3(dh=true,Y=pY,U=pU,V=pV,field=0).turnright() return v } function nnediresize_YUY2(clip c) { cy = c.ConvertToY8().ConvertToYV12() # Fast extract Y, blank chroma cu = c.UtoY8().ConvertToYV12() # Fast extract U to Y, blank chroma cv = c.VtoY8().ConvertToYV12() # Fast extract V to Y, blank chroma cy = nnediresize2x(cy,true,false,false) # Double height and double width cu = nnedi3(dh=true,Y=True,U=False,V=False,field=0) # Double height only cv = nnedi3(dh=true,Y=True,U=False,V=False,field=0) # Double height only YtoUV(cu,cv,cy) # YV16 output return ConvertToYUY2() # Lossless conversion to YUY2 } |
25th April 2011, 17:55 | #160 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Is this fixed in CVS?
Any timescale for getting a new release out? On 18th Jan 2011, you said: Quote:
@yup: Wouldn't it have been more useful just to quote the error message? - images can take some time to be approved by a mod. |
|
|
|