[FFmpeg-devel] [PATCH 4/5] exr: cosmetics: reindent

Paul B Mahol onemda at gmail.com
Wed Feb 20 14:49:45 CET 2013


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/exr.c | 140 +++++++++++++++++++++++++++----------------------------
 1 file changed, 70 insertions(+), 70 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 89522ba..027672f 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -538,85 +538,85 @@ static int decode_frame(AVCodecContext *avctx,
                 return AVERROR_INVALIDDATA;
             }
 
-                if (scan_lines_per_block > 1)
-                    uncompressed_size = scan_line_size * FFMIN(scan_lines_per_block, ymax - y + 1);
-                if ((s->compr == EXR_ZIP1 || s->compr == EXR_ZIP16) && data_size < uncompressed_size) {
-                    unsigned long dest_len = uncompressed_size;
-
-                    if (uncompress(s->tmp, &dest_len, src, data_size) != Z_OK ||
-                        dest_len != uncompressed_size) {
-                        av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n");
-                        return AVERROR(EINVAL);
-                    }
-                } else if (s->compr == EXR_RLE && data_size < uncompressed_size) {
-                    if (rle_uncompress(src, data_size, s->tmp, uncompressed_size)) {
-                        av_log(avctx, AV_LOG_ERROR, "error during rle decompression\n");
-                        return AVERROR(EINVAL);
-                    }
+            if (scan_lines_per_block > 1)
+                uncompressed_size = scan_line_size * FFMIN(scan_lines_per_block, ymax - y + 1);
+            if ((s->compr == EXR_ZIP1 || s->compr == EXR_ZIP16) && data_size < uncompressed_size) {
+                unsigned long dest_len = uncompressed_size;
+
+                if (uncompress(s->tmp, &dest_len, src, data_size) != Z_OK ||
+                    dest_len != uncompressed_size) {
+                    av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n");
+                    return AVERROR(EINVAL);
+                }
+            } else if (s->compr == EXR_RLE && data_size < uncompressed_size) {
+                if (rle_uncompress(src, data_size, s->tmp, uncompressed_size)) {
+                    av_log(avctx, AV_LOG_ERROR, "error during rle decompression\n");
+                    return AVERROR(EINVAL);
                 }
+            }
 
-                if (s->compr != EXR_RAW && data_size < uncompressed_size) {
-                    predictor(s->tmp, uncompressed_size);
-                    reorder_pixels(s->tmp, s->uncompressed_data, uncompressed_size);
+            if (s->compr != EXR_RAW && data_size < uncompressed_size) {
+                predictor(s->tmp, uncompressed_size);
+                reorder_pixels(s->tmp, s->uncompressed_data, uncompressed_size);
+
+                red_channel_buffer   = s->uncompressed_data + xdelta * s->channel_offsets[0];
+                green_channel_buffer = s->uncompressed_data + xdelta * s->channel_offsets[1];
+                blue_channel_buffer  = s->uncompressed_data + xdelta * s->channel_offsets[2];
+                if (s->channel_offsets[3] >= 0)
+                    alpha_channel_buffer = s->uncompressed_data + xdelta * s->channel_offsets[3];
+            } else {
+                red_channel_buffer   = src + xdelta * s->channel_offsets[0];
+                green_channel_buffer = src + xdelta * s->channel_offsets[1];
+                blue_channel_buffer  = src + xdelta * s->channel_offsets[2];
+                if (s->channel_offsets[3] >= 0)
+                    alpha_channel_buffer = src + xdelta * s->channel_offsets[3];
+            }
 
-                    red_channel_buffer   = s->uncompressed_data + xdelta * s->channel_offsets[0];
-                    green_channel_buffer = s->uncompressed_data + xdelta * s->channel_offsets[1];
-                    blue_channel_buffer  = s->uncompressed_data + xdelta * s->channel_offsets[2];
-                    if (s->channel_offsets[3] >= 0)
-                        alpha_channel_buffer = s->uncompressed_data + xdelta * s->channel_offsets[3];
+            for (i = 0; i < scan_lines_per_block && y + i <= ymax; i++, ptr += stride) {
+                const uint8_t *r, *g, *b, *a;
+
+                r = red_channel_buffer;
+                g = green_channel_buffer;
+                b = blue_channel_buffer;
+                if (alpha_channel_buffer)
+                    a = alpha_channel_buffer;
+
+                ptr_x = (uint16_t *)ptr;
+
+                // Zero out the start if xmin is not 0
+                memset(ptr_x, 0, bxmin);
+                ptr_x += xmin * desc->nb_components;
+                if (s->bits_per_color_id == 2) {
+                    // 32-bit
+                    for (x = 0; x < xdelta; x++) {
+                        *ptr_x++ = exr_flt2uint(bytestream_get_le32(&r));
+                        *ptr_x++ = exr_flt2uint(bytestream_get_le32(&g));
+                        *ptr_x++ = exr_flt2uint(bytestream_get_le32(&b));
+                        if (alpha_channel_buffer)
+                            *ptr_x++ = exr_flt2uint(bytestream_get_le32(&a));
+                    }
                 } else {
-                    red_channel_buffer   = src + xdelta * s->channel_offsets[0];
-                    green_channel_buffer = src + xdelta * s->channel_offsets[1];
-                    blue_channel_buffer  = src + xdelta * s->channel_offsets[2];
-                    if (s->channel_offsets[3] >= 0)
-                        alpha_channel_buffer = src + xdelta * s->channel_offsets[3];
-                }
-
-                for (i = 0; i < scan_lines_per_block && y + i <= ymax; i++, ptr += stride) {
-                    const uint8_t *r, *g, *b, *a;
-
-                    r = red_channel_buffer;
-                    g = green_channel_buffer;
-                    b = blue_channel_buffer;
-                    if (alpha_channel_buffer)
-                        a = alpha_channel_buffer;
-
-                    ptr_x = (uint16_t *)ptr;
-
-                    // Zero out the start if xmin is not 0
-                    memset(ptr_x, 0, bxmin);
-                    ptr_x += xmin * desc->nb_components;
-                    if (s->bits_per_color_id == 2) {
-                        // 32-bit
-                        for (x = 0; x < xdelta; x++) {
-                            *ptr_x++ = exr_flt2uint(bytestream_get_le32(&r));
-                            *ptr_x++ = exr_flt2uint(bytestream_get_le32(&g));
-                            *ptr_x++ = exr_flt2uint(bytestream_get_le32(&b));
-                            if (alpha_channel_buffer)
-                                *ptr_x++ = exr_flt2uint(bytestream_get_le32(&a));
-                        }
-                    } else {
-                        // 16-bit
-                        for (x = 0; x < xdelta; x++) {
-                            *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&r));
-                            *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&g));
-                            *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&b));
-                            if (alpha_channel_buffer)
-                                *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&a));
-                        }
+                    // 16-bit
+                    for (x = 0; x < xdelta; x++) {
+                        *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&r));
+                        *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&g));
+                        *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&b));
+                        if (alpha_channel_buffer)
+                            *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&a));
                     }
+                }
 
-                    // Zero out the end if xmax+1 is not w
-                    memset(ptr_x, 0, axmax);
+                // Zero out the end if xmax+1 is not w
+                memset(ptr_x, 0, axmax);
 
-                    red_channel_buffer   += scan_line_size;
-                    green_channel_buffer += scan_line_size;
-                    blue_channel_buffer  += scan_line_size;
-                    if (alpha_channel_buffer)
-                        alpha_channel_buffer += scan_line_size;
-                }
+                red_channel_buffer   += scan_line_size;
+                green_channel_buffer += scan_line_size;
+                blue_channel_buffer  += scan_line_size;
+                if (alpha_channel_buffer)
+                    alpha_channel_buffer += scan_line_size;
             }
         }
+    }
 
     // Zero out the end if ymax+1 is not h
     for (y = ymax + 1; y < avctx->height; y++) {
-- 
1.7.11.4



More information about the ffmpeg-devel mailing list