Thread: Avisynth+
View Single Post
Old 10th September 2017, 13:30   #3603  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,229
I made a post regarding an issue with Avisynth and pixel types in combination with different bit depths here:
https://forum.doom9.org/showpost.php...&postcount=160

Quote:
Updated the first post with version 1.6.

If you extract the luminance channel such it is just the Y channel, obviously it is a different format to the YUV clip such as output from the chroma filtering. You first have to convert back to the same format before combining. This is fine, however when you are in more than 8 bits, the commands such as isYV12() etc do not work since it is expecting a YUV420Y8 clip for it to be true. Since it is a YUV420P10 clip (for example) the command isYV12() seems to give back false. If you run convertToYV12(), it keeps the higher bitdepth of 10 etc, so isYV12() still doesn't work. This, and possibly other little issues, are problematic when you want to have the output clip the same format as the input clip and it isn't 8-bit etc. This is why I put back the 'do not process' flags to the luma commands, it was either that or dropping support for YV16 and YV24, which obviously isn't desirable.

It works fine as is because the bit depths can be matched easily and the pixel type hasn't changed. I could do a convertbits() just so isYV12() etc works, but then it's an extra unnecessary bit of processing that will probably affect speed more than what was gained by converting it to Y8 and going back to the desired pixel type.
Imagine a source of YV16 and 10 bit. If you extract the Y channel, process it, to merge it back to the original clip you need to first convert it (can't do a direct merge chroma). To do this, you need to know the format of the original clip, which is problematic because isYUV() works, but isYV16() doesn't because in this case, it is really asking , effectively isYUV422P8(). The result therefore is false. Am I missing something, or do you really have to go isYV16(Convertbits(8)) first so it answers true if a bit depth other than 8 for YUV4224Px? If this is true, then it is NOT consistent with convertYV16(), since that keeps the bit depth. You can literally go ConvertToYV16() followed by isYV16(), and it will return false if it isn't 8 bit.

Last edited by burfadel; 10th September 2017 at 13:33.
burfadel is offline