mawen1250 写了:[syntax="avisynth"]# Parameters for chroma shift, example for converting MPEG-1 chroma placement to MPEG-2 chroma placement
U_Horizontal_Shift = -0.25
U_Vertical_Shift = 0
V_Horizontal_Shift = -0.25
V_Vertical_Shift = 0
# 8bit YUV input
# Separate planes
Y = last
U = UToY8()
V = VToY8()
# Use resizer to achieve sub-pixel precision shift for each plane
U = U.Spline16Resize(U.Width(), U.Height(), U_Horizontal_Shift, U_Vertical_Shift)
V = V.Spline16Resize(V.Width(), V.Height(), V_Horizontal_Shift, V_Vertical_Shift)
# Merge planes back to YUV format
YToUV(U, V, Y)[/syntax]
我只是说了处理思路而已,具体实现靠avs内置滤镜就可以,如果我自己的话会用Dither_resize16做16bit精度的处理。
上面的例子里的参数设置是针对源制作时错误地使用MPEG-1 chroma placement的情况(而SD、HD的标准,以及播放器都是按照MPEG-2 chroma placement进行chroma subsampling和chroma upsampling的),由于MPEG-1的chroma是center align而MPEG-2的chroma是left align,所以播放的结果是chroma向左偏移0.25像素(4:2:x下对应luma的0.5像素),那么用resize向右移0.25像素就可以了。
有这种错误的典型是JC的一系列动画,从LB、LBRF、LBEX,到龙虎,到魔禁超炮,到夏娜全部都有这个问题。
有关chroma subsampling更多的问题可以参考
这贴。