View Single Post
Old 18th June 2018, 22:34   #11  |  Link
amichaelt
Guest
 
Posts: n/a
There is a bug with YV12 sources I see from the Avisynth wiki page. Maybe this can help you?

Quote:
Originally Posted by raffriff42 View Post
Has anybody used WarpedResize [with a YV12 source] lately? For me it is warping Chroma from one side instead of centered like Luma, which looks a bit odd:
Code:
LoadPlugin(p + "SimpleResize\Avisynth_2.5_Alpha\SimpleResize.dll")
ColorBars(pixel_type="YV12")
Subtitle("5 4 3 2 1 0 1 2 3 4 5", 
\       align=5, size=Height*0.2, font="Courier New",
\       text_color=$aaffffff, halo_color=$ff000000)
WarpedResize(Width, Height, 1.5, 1.0)
Subtitle("WarpedResize(hWarp=1.5)", align=8,
\       text_color=$ebebeb, halo_color=$ff000000)
return Last
...but this fixes the problem:
Code:
## fix WarpedResize YV12 chroma bug; make warp arguments optional 
function WarpedResize2(clip C, int width, int height, float "hWarp", float "vWarp")
{
    Assert(C.IsYV12, 
    \   "WarpedResize2: source must be YV12")     
    Assert(width % 4 == 0, 
    \   "WarpedResize2: 'width' arg must be mod 4")
    Assert(height % 4 == 0, 
    \   "WarpedResize2: 'height' arg must be mod 4")
    
    hWarp = Default(hWarp, 1.0)
    vWarp = Default(vWarp, 1.0)
    
    U = C.UToY .WarpedResize(width / 2, height / 2, hWarp, vWarp)
    V = C.VToY .WarpedResize(width / 2, height / 2, hWarp, vWarp)
    Y = C      .WarpedResize(width, height, hWarp, vWarp)

    return YToUV(U, V, Y)
}

Last edited by amichaelt; 18th June 2018 at 22:38.
  Reply With Quote