diff --git a/python/ftl/ftlstream.py b/python/ftl/ftlstream.py index c3790ac5491d2e3b5c439a7539ecbd57d5694c7c..f559ac9e9aea4092873500478d1408667a63ebf0 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 20f2f250c0c7344bc81682e15ab6bf08965318b2..94f7f8664905ea67b2a8678c02a405e893c523de 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