[FFmpeg-cvslog] exr: simplify filling channel_buffer[]

Paul B Mahol git at videolan.org
Sun Feb 24 15:33:30 CET 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Feb 24 12:28:22 2013 +0000| [74a78bfe6c1bc0f5b9d34979fc081dcb75c0ae03] | committer: Paul B Mahol

exr: simplify filling channel_buffer[]

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/exr.c |   21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 83d1cc9..59144a2 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -295,23 +295,18 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
         }
     }
 
-    if (s->compr != EXR_RAW && data_size < uncompressed_size) {
+    if (data_size < uncompressed_size) {
         predictor(td->tmp, uncompressed_size);
         reorder_pixels(td->tmp, td->uncompressed_data, uncompressed_size);
-
-        channel_buffer[0] = td->uncompressed_data + xdelta * s->channel_offsets[0];
-        channel_buffer[1] = td->uncompressed_data + xdelta * s->channel_offsets[1];
-        channel_buffer[2] = td->uncompressed_data + xdelta * s->channel_offsets[2];
-        if (s->channel_offsets[3] >= 0)
-            channel_buffer[3] = td->uncompressed_data + xdelta * s->channel_offsets[3];
-    } else {
-        channel_buffer[0] = src + xdelta * s->channel_offsets[0];
-        channel_buffer[1] = src + xdelta * s->channel_offsets[1];
-        channel_buffer[2] = src + xdelta * s->channel_offsets[2];
-        if (s->channel_offsets[3] >= 0)
-            channel_buffer[3] = src + xdelta * s->channel_offsets[3];
+        src = td->uncompressed_data;
     }
 
+    channel_buffer[0] = src + xdelta * s->channel_offsets[0];
+    channel_buffer[1] = src + xdelta * s->channel_offsets[1];
+    channel_buffer[2] = src + xdelta * s->channel_offsets[2];
+    if (s->channel_offsets[3] >= 0)
+        channel_buffer[3] = src + xdelta * s->channel_offsets[3];
+
     ptr = p->data[0] + line * p->linesize[0];
     for (i = 0; i < s->scan_lines_per_block && line + i <= s->ymax; i++, ptr += p->linesize[0]) {
         const uint8_t *r, *g, *b, *a;



More information about the ffmpeg-cvslog mailing list