Known Issues v2.58

From Avisynth wiki
Jump to: navigation, search

The page contains a list of bugs in 2.58.


[edit] Crop Bug

The crop bug exists when cropping RGB including an area outside the screen. There will be a crash instead of an error message.

# crop Bug
exposebug = false # set to true to crash
n = exposebug ? 241 : 240
#~ File "pyavs.pyo", line 310, in _GetFrame
#~ File "avisynth.pyo", line 139, in BitBlt
#~ WindowsError: exception: access violation reading 0x02DDFFE0

[edit] Overlay Bug

Overlay gives a yellow tint on videos if used repeatedly on the same RGB video. All inputs to overlay are converted internally to a YUV 4:4:4 format, even if both are RGB.

# Overlay converts internally to a YUV 4:4:4 format. This will cause
# an increasing yellowish color at the top of the screen.
# The script also uses a large amount of memory since each instance of Overlay will use up to 3 full frames of this format.
# If that bothers you, use Layer instead.
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,25)
  function overlayissue(clip base, clip over, int n) {
  function layernonissue(clip base, clip over, int n) {

The yellow tint is caused by incorrect rounding: [1].

[edit] Improper YV12<->YUY2 Conversions

Please see [2]. The built-in YUY2<->YV12 conversions introduce a chroma shift. Use this replacement instead:

# Replacement code for YUY2<->YV12 conversions in v2.58
function YV12ToYUY2(clip c, bool "interlaced") {
  interlaced = Default(interlaced, false)
  interlaced ? c.YV12ToYUY2i() : c.YV12ToYUY2p()
function YUY2ToYV12(clip c, bool "interlaced") {
  interlaced = Default(interlaced, false)
  interlaced ? c.YUY2ToYV12i() : c.YUY2ToYV12p()
# ------- Support functions --------
function YV12ToYUY2p(clip c) {
  U = c.UToY().BilinearResize(c.width/2, c.height).ConvertToYUY2()
  V = c.VToY().BilinearResize(c.width/2, c.height).ConvertToYUY2()
  YToUV(U, V, c.ConvertToYUY2()) #crashes on v2.60
function YV12ToYUY2i(clip c) {
  f = c.AssumeTFF().SeparateFields()
  top = f.SelectEven()
  bot = f.SelectOdd()
  topU = top.UToY().BilinearResize(c.width/2, c.height/2, 0, 0.125)
  botU = bot.UToY().BilinearResize(c.width/2, c.height/2, 0, -0.125)
  U = Interleave(topU, botU).ConvertToYUY2()
  topV = top.VToY().BilinearResize(c.width/2, c.height/2, 0, 0.125)
  botV = bot.VToY().BilinearResize(c.width/2, c.height/2, 0, -0.125)
  V = Interleave(topV, botV).ConvertToYUY2()
  YToUV(U, V, f.ConvertToYUY2()).Weave()

Use the YV12<->YV16 conversions instead. They use a different code path and don't have this problem. This issue still exists in v2.60.

[edit] ImageSource/ImageReader Bug

Reading a tga image results in a flipped (upside down) output. This can be 'corrected' by using FlipVertical afterwards.

[edit] SeparateFields: Parity Bug

The separation of the fields is done wrong if the parity of the clip is not constant (thus if an earlier filter has introduced a non-standard parity function, where the parity depends on the frame number). However, frame-based clips (the usual source material) usually have the same parity for every frame, since the entire clip is usually TFF or BFF. Hence the problem doesn't show up. More can be found here.

[edit] MergeChroma/MergeLuma Documentation Bug

There is no "weight" argument. It should be "LumaWeight" for MergeLuma() and "ChromaWeight" for MergeChroma(). Since v2.60 you can also use the "weight" argument.

[edit] Resizers: Chroma Positioning Bugs

All resizers contain (hardly noticeable) horizontal chroma positioning bugs. At first glance it seems to me the code dumbly assumes the chroma is positioned top left of the macrocell, not MPEG1. More can be found here and here. It affects all horizontally subsampled YUV formats (YUY2, YV16, YV411 and YV12, but not YV24). This issue still exists in v2.60.

[edit] Horizontal Shift in RGB->YUY2

There is a horizontal shift when doing a RGB->YUY2 conversion as described here.

[edit] Bob: Chroma Positioning Bugs

Bob also contains a chroma positioning bug. More can be found here. This issue still exists in v2.60.

[edit] PointResize Issue

In YUV, PointResize will delete the first of every two lines when resizing. In RGB, the video is processed upside down and thus every 2nd line will be deleted. The result in this example is a screen of blue in RGB and a screen of black in YUY2.

# Show PointResize Issue
exposeissue = false # set to true to show issue
blue = blankclip(height=480/2,color=$ff)
black = blankclip(height=480/2)
exposeissue ? converttoyuy2 : nop

This issue still exists in v2.60. It will likely remain that way to ensure compatibility.

[edit] Histogram Bug

The display shown in Histogram looks different whether in YV12 or YUY2. The marked areas are wrong; the midpoint is off-center and the upper range is too large.

[edit] SincResize Bug

SincResize produces incorrect results. This bug exists in AviSynth 2.6a3, but has been corrected in 2.6MT. Demonstration:

function shift1(clip c, float x) {
function shift2(clip c, float x) {

todo: is this still an issue?

[edit] BlankClip and Last Bug

BlankClip without brackets will be taken as BlankClip(last) if last has a defined clip value, instead of being taken as BlankClip(). Discussion .

[edit] Audio cache bug and .

[edit] Float Implementation Documentation Issue

Older downloads of AviSynth 2.6 don't specifically mention the implementation of float. It is 32bits with 24bit mantissa. Care must be taken when casting or calculating, especially compared to the larger 32 bit integers, due to precision issues. For more information, please see Advanced_Scripting_Tips.

Personal tools