Thread: Avisynth+
View Single Post
Old 7th July 2016, 11:59   #2035  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by vivan View Post
It's not the only correct conversion. Actually standarts (BT.709/BT.2020) define another conversion, which uses 2^(n-8) as scaling factor. And so does msdn.

Data is interpreted as having integer (higher 8 bits) and fractional (lower 8 bits) components. And this makes 16.0 and 235.0 (240.0) black and peak values regardless of the bitdepth.

I rememeber when ffmpeg first implemented high bit depth support is also used x >> 8 || x conversion, but it was then corrected.
Ok, I didn't know that the scaling factor here is defined explicitly as 2^n. The boundaries 16-235/240 just come from TV-levels though.
__________________
AviSynth+
ultim is offline