Thread: Avisynth+
View Single Post
Old 21st February 2019, 16:41   #4543  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Bit shifting vs. multiply revisited. 8 to 10 bit scaling in YUV vs. RGB first. Behaviour seems inconsistent

0-1023 seems correct to me . VPY yields 1023 for full range eitherway; even if you convert to 8bit full range YUV first, then 10bit at a 2nd step


This gives 0-1020
Code:
#8bit RGB 0-255 source. ImageSource(), packed
ConvertToYV12(matrix="PC.709") #8bit YUV 0-255 full range
ConvertBits(10)
This gives 0-1023 if the 8=>10bit is done in RGB first
Code:
#8bit RGB 0-255 source. ImageSource(), packed
ConvertToPlanarRGB()
ConvertBits(10)
ConvertToYV12(matrix="PC.709")
But converting to YUV first, before the 8=>10bit gives 0-1020
Code:
#8bit RGB 0-255 source. ImageSource(), packed
ConvertToPlanarRGB()
ConvertToYV12(matrix="PC.709")
ConvertBits(10)

*Nevermind - I guess you can override it by using ConvertBits(10, fulls=true) .

Last edited by poisondeathray; 21st February 2019 at 17:03.
poisondeathray is offline