分页: 1 / 1

[已解决] O16 mod BitDepth() 之疑惑

发表于 : 2018-10-18 20:15
mrhso
今日发现使用 O16 mod BitDepth() 位移转换 10-bit 至 8-bit 与 AviSynth+ ConvertBits()、f3kdb 不同。
使用 ConvertBits 与 f3kdb 的效果应当是相同的。
ConvertFromStacked(10).ConvertBits(16, fulls=False).ConvertToStacked()
f3kdb(Y=0, Cb=0, Cr=0, grainY=0, grainC=0, keep_tv_range=false, input_mode=1, input_depth=10, output_mode=1, output_depth=16)
而使用 BitDepth 转换则不同。
BitDepth(input_depth=10, output_depth=16, input_TVrange=True, output_TVrange=True)
拉出 Y 平面来看十分明显,但 U、V 较不明显(差异还是有)。
将结果用 Down10(10, True, -1) 转换回 10-bit,发现结果仍有细微差异。
这个差异不只发生在位移,扩张法也有差异。

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-10-18 20:26
mrhso
对 Down10 后与源 Diff 的结果来看,ConvertBits 与 f3kdb 的转换结果是正确的,而 BitDepth 不对。

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-10-18 20:29
mrhso
图片
谜之差异,真是奇妙深刻。

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-10-19 17:30
mrhso
分别使用
Dither_lut16("x 6 <<", y=3, u=3, v=3)
Dither_lut16("x 1023 / 65535 *", y=3, u=3, v=3)
对位移法和扩张法进行了模拟并对比,结果来看两种方法 BitDepth 的转换结果显然都不对,而 AviSynth+ 内部转换是正确的。

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-10-20 9:57
mrhso
根据对 BitDepth 内容的推理:
BitDepth(input_depth=10, output_depth=16, input_TVrange=True, output_TVrange=True)
应当等价于
SmoothCurve16(Ycurve="0-4096;64-4096;940-60160;65535-60160", Ucurve="0-4096;64-4096;512-32768;960-61440;65535-61440", Vcurve="0-4096;64-4096;512-32768;960-61440;65535-61440", mode=0, interp=0, HQ=false, dither=0, limiter=False, TVrange=0)
啊看不懂呢。 {:cat_13}

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-10-20 10:12
mrhso
仔细分析好像写得没有问题(例如 Ycurve 确实应该把 64-940 移到了 4096-60160 范围上),那么是 SmoothAdjust 本身的问题吗(错乱)

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-11-03 10:00
mrhso
突然意识到对于 PC Range 来说,CbCr 中值是 1<<(BitDepth-1),变化范围是 [-0.5, 0.5]*(1<<BitDepth-1)。所以 AviSynth+ 内部那个对于 CbCr 来说也是有问题的。
啊真的好乱。

Re: O16 mod BitDepth() 之疑惑

发表于 : 2018-11-03 10:07
mrhso
现在我明白了这事,我 Dither 没关……但我其实还是不太明白为什么升位也会打开 Dither,没问题了。