summaryrefslogtreecommitdiff
path: root/libavcodec/exr.c
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2016-11-17 21:24:42 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-25 00:57:38 +0100
commit5099c541bbb9174c6af8376c8793907c50ca3e97 (patch)
treeafdd513c04d79cc68cde209d1554ebd55ef3ccae /libavcodec/exr.c
parent8c8f543b81aa2b50bb6a6cfd370a0061281492a3 (diff)
libavcodec/exr: add support for uint32 channel decoding with pxr24
Doesn't decode the uint32 layer, but decodes the half part of the file. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r--libavcodec/exr.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index f02337e3ef..78527270d1 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;
}