Skip to content

Commit 51fbc15

Browse files
author
jianfeng.zheng
committed
framereader: fix read_frame_I010
As libva defined: ``` /** I010: three-plane 10-bit YUV 4:2:0. * * Each sample is a two-byte little-endian value with the top six bits ignored. * The three planes contain Y, V and U respectively. */ ``` Signed-off-by: jianfeng.zheng <[email protected]>
1 parent 5d9ed4f commit 51fbc15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/framereader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ def read_frame_I010(fd, width, height):
9696
size = width * height
9797
size2 = width2 * height2
9898

99-
y = numpy.fromfile(fd, dtype=numpy.uint16, count=size).reshape((height, width)) >> 6
100-
u = numpy.fromfile(fd, dtype=numpy.uint16, count=size2).reshape((height2, width2)) >> 6
101-
v = numpy.fromfile(fd, dtype=numpy.uint16, count=size2).reshape((height2, width2)) >> 6
99+
y = numpy.fromfile(fd, dtype=numpy.uint16, count=size).reshape((height, width)) & 0x03ff
100+
v = numpy.fromfile(fd, dtype=numpy.uint16, count=size2).reshape((height2, width2)) & 0x03ff
101+
u = numpy.fromfile(fd, dtype=numpy.uint16, count=size2).reshape((height2, width2)) & 0x03ff
102102

103103
return y, u, v
104104

0 commit comments

Comments
 (0)