Commit 682621b0 authored by Josh Holmer's avatar Josh Holmer Committed by Nathan Egge

Fix CIEDE script for high bit depth

The Cr plane would not read in the correct data
on high bit depth videos, causing an incorrect result.
This commit fixes the input offset so the correct
values are read.
parent beb4c67d
......@@ -26,7 +26,7 @@ def decode_y4m_buffer(frame):
A, Adiv2, div2 = W * H, Hdiv2 * Wdiv2, (Hdiv2, Wdiv2)
dtype, scale = 'uint8', 1.
if C.endswith('p10'):
dtype, scale, A = 'uint16', 4., A * 2
dtype, scale, A, Adiv2 = 'uint16', 4., A * 2, Adiv2 * 2
Y = (np.ndarray((H, W), dtype, buf) - 16. * scale) / (219. * scale)
if C.startswith('420'):
Cb = (np.ndarray(div2, dtype, buf, A) - 128. * scale) / (224. * scale)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment