Known Issues

From Avisynth wiki
Revision as of 14:48, 23 August 2015 by Admin (Talk | contribs)

Jump to: navigation, search

The page contains a list of bugs in 2.60. They are fixed in 2.61 unless stated otherwise.

Contents

Improper YV12<->YUY2 Conversions

Please see [1]. 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.61.


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.61.

Bob: Chroma Positioning Bugs

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


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)
interleave(black,blue)
assumefieldbased.assumetff.weave
exposeissue ? converttoyuy2 : nop
pointresize(width,height/2)

This issue still exists in v2.61 and it will likely remain that way to ensure compatibility.


SincResize Bug

SincResize produces incorrect results. This bug exists in AviSynth 2.6a3, but has been corrected in 2.6MT. Demonstration: http://screenshotcomparison.com/comparison/91203

ColorBars(width=14,height=2,pixel_type="YV12").trim(0,80)
a=animate(0,80,"shift1",0.,8.)
b=animate(0,80,"shift2",0.,8.)
stackvertical(a,b)
pointresize(280,280)
ScriptClip("""
ph=current_frame/10.
subtitle("shift="+string(ph))
""")
function shift1(clip c, float x) {
   c.bilinearresize(c.width*20,c.height,x,0,c.width,c.height)
}
function shift2(clip c, float x) {
   c.sincresize(c.width*20,c.height,x,0,c.width,c.height)
}

todo: is this still an issue?

Personal tools