From e41bf418181c5e5f86b60f496a1442fe4046b732 Mon Sep 17 00:00:00 2001 From: Sebastian Hahta <joseha@utu.fi> Date: Wed, 8 Jan 2020 11:27:19 +0200 Subject: [PATCH] document depth HEVC format --- python/ftl/ftlstream.py | 5 +++++ python/ftl/libde265.py | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/python/ftl/ftlstream.py b/python/ftl/ftlstream.py index c3790ac54..f559ac9e9 100644 --- a/python/ftl/ftlstream.py +++ b/python/ftl/ftlstream.py @@ -246,6 +246,11 @@ class FTLStreamReader: warn("frame expected, no image from decoded") if ftl.is_float_channel(self._sp.channel): + # todo: old hevc format twice the width, upper/lower in left/right + # half of the image + # + # new format, see depth_convert.cu:66 + raise NotImplementedError("non-color channel decoding not available") else: diff --git a/python/ftl/libde265.py b/python/ftl/libde265.py index 20f2f250c..94f7f8664 100644 --- a/python/ftl/libde265.py +++ b/python/ftl/libde265.py @@ -165,6 +165,7 @@ class WaitingForInput(libde265Error): class Decoder: def __init__(self, size, threads=_threads): + # todo: remove _size self._size = size self._more = ctypes.c_int() self._out_stride = ctypes.c_int() @@ -189,16 +190,19 @@ class Decoder: size = (libde265.de265_get_image_height(de265_image, c), libde265.de265_get_image_width(de265_image, c)) + # todo: 10 bits per pixel for new depth format bpp = libde265.de265_get_bits_per_pixel(de265_image, c) if bpp != 8: raise NotImplementedError("unsupported bits per pixel %i" % bpp) img_ptr = libde265.de265_get_image_plane(de265_image, c, self._out_stride) - # for frombuffer() no copy assumed + # for frombuffer() no copy assumed ch = np.frombuffer(img_ptr[:size[0] * size[1]], dtype=np.uint8) ch.shape = size + # todo: old depth format twice the width + # resize all channels to match Y channel and remove self._size res[:,:,c] = _resize(ch, self._size) return res -- GitLab