Thread: Avisynth+
View Single Post
Old 10th February 2017, 23:49   #3009  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Bug in ConvertBits. If I call ConvertBits(14, dither=-1), it says "dithering is allowed only for 8 bit targets". If I do not specify "dither=-1", then it works.

Also, ConvertFromDoubleWidth supports 10-16 bit, while ConvertToDoubleWidth only supports 16-bit. Code needs to be replaced with this:
Code:
if (vi.BitsPerComponent() < 10 || vi.BitsPerComponent() > 16)
	env->ThrowError("ConvertToDoubleWidth: Input clip must be 10-16bit format");
else if (vi.Is420()) vi.pixel_type = VideoInfo::CS_YV12;
else if (vi.Is422()) vi.pixel_type = VideoInfo::CS_YV16;
else if (vi.Is444()) vi.pixel_type = VideoInfo::CS_YV24;
else if (vi.IsY()) vi.pixel_type = VideoInfo::CS_Y8;
else if (vi.IsColorSpace(VideoInfo::CS_BGR48)) vi.pixel_type = VideoInfo::CS_BGR24;
else if (vi.IsColorSpace(VideoInfo::CS_BGR64)) vi.pixel_type = VideoInfo::CS_BGR32;
else env->ThrowError("ConvertToDoubleWidth: Input clip must be 10-16bit format");
MysteryX is offline