mawen1250 写了:把resizer换成Dither_resize16(kernel="spline16"),Height()换成Height()/2,其余相同。
如果是既有chroma shift又有chroma bleeding呢?请问以下做法正确吗?
# 8bit input
src = last
src16 = src.U16
# parameters
sw = src.Width()
sh = src.Height()
U_Horizontal_Shift = U_Horizontal_Shift
U_Vertical_Shift = U_Vertical_Shift
V_Horizontal_Shift = V_Horizontal_Shift
V_Vertical_Shift = V_Vertical_Shift
depth = depth
# seperate planes
Y = src16
U = src16.UToY()
V = src16.VToY()
# fix chroma shift with 16bit resizer, output 16bit stack YV12
U1 = U.Dither_resize16(U.Width(), U.Height()/2, U_Horizontal_Shift, U_Vertical_Shift, kernel="spline16")
V1 = V.Dither_resize16(V.Width(), V.Height()/2, V_Horizontal_Shift, V_Vertical_Shift, kernel="spline16")
shift_fixed = YToUV(U1, V1, Y)
# fix chroma bleeding with awarpsharp2, output 16bit stack YV24
up = shift_fixed.Dither_resize16(sw*2, sh*2, kernel="bicubic")
bleeding_fixed = up.DitherPost(mode=6).awarpsharp2(type=1, thresh=100, depth=depth).U16
U2 = bleeding_fixed.UToY()
V2 = bleeding_fixed.VToY()
YToUV(U2, V2, Y)