Hello, In attach a patch, who fix the decoding of half (or float) layer with pxr24 compression, when there is also an uint32 layer.
The uint32 layer is still not decodable. Found by Andreas Cadhalpun sample can be found here : https://we.tl/ULGDVxQXGy Comments welcome Martin
From c70a83c38cd9a9434e6434d60dadf0a1c809e074 Mon Sep 17 00:00:00 2001 From: Martin Vignali <martin.vign...@gmail.com> Date: Thu, 17 Nov 2016 21:24:42 +0100 Subject: [PATCH 2/3] libavcodec/exr : add support for uint32 channel decoding with pxr24 Doesn't decode the uint32 layer, but decode the half part of the file. --- libavcodec/exr.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f02337e..7852727 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -882,6 +882,22 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src, bytestream_put_le16(&out, pixel); } break; + case EXR_UINT: + ptr[0] = in; + ptr[1] = ptr[0] + s->xdelta; + ptr[2] = ptr[1] + s->xdelta; + ptr[3] = ptr[2] + s->xdelta; + in = ptr[3] + s->xdelta; + + for (j = 0; j < s->xdelta; ++j) { + uint32_t diff = (*(ptr[0]++) << 24) | + (*(ptr[1]++) << 16) | + (*(ptr[2]++) << 8 ) | + (*(ptr[3]++)); + pixel += diff; + bytestream_put_le32(&out, pixel); + } + break; default: return AVERROR_INVALIDDATA; } -- 1.9.3 (Apple Git-50)
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel