[FFmpeg-cvslog] libavcodec/exr: add support for uint32 channel decoding with pxr24

Martin Vignali git at videolan.org
Fri Nov 25 02:02:22 EET 2016


ffmpeg | branch: master | Martin Vignali <martin.vignali at gmail.com> | Thu Nov 17 21:24:42 2016 +0100| [5099c541bbb9174c6af8376c8793907c50ca3e97] | committer: Andreas Cadhalpun

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 at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5099c541bbb9174c6af8376c8793907c50ca3e97
---

 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;
             }



More information about the ffmpeg-cvslog mailing list