summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-01 16:48:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-01 16:48:09 +0200
commit5727d387fb244aa754847494e199ab3b4e084266 (patch)
treed43afa6de47785e7ec8e1d427f57619970574dcc /libavcodec/pngdec.c
parentc87f645a757e1888932a57a2b5ef8ca44098a9e0 (diff)
parent92a36a6b3338df5f5cff573a486e182005367c24 (diff)
Merge commit '92a36a6b3338df5f5cff573a486e182005367c24'
* commit '92a36a6b3338df5f5cff573a486e182005367c24': pngdec: correctly indent macros Conflicts: libavcodec/pngdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r--libavcodec/pngdec.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index c92087f5e8..e46800ba7a 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -185,7 +185,8 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top,
}
}
-#define UNROLL1(bpp, op) { \
+#define UNROLL1(bpp, op) \
+ { \
r = dst[0]; \
if (bpp >= 2) \
g = dst[1]; \
@@ -205,16 +206,21 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top,
continue; \
dst[i + 3] = a = op(a, src[i + 3], last[i + 3]); \
} \
-}
+ }
-#define UNROLL_FILTER(op)\
- if (bpp == 1) UNROLL1(1, op)\
- else if (bpp == 2) UNROLL1(2, op)\
- else if (bpp == 3) UNROLL1(3, op)\
- else if (bpp == 4) UNROLL1(4, op)\
- for (; i < size; i++) {\
- dst[i] = op(dst[i - bpp], src[i], last[i]);\
- }\
+#define UNROLL_FILTER(op) \
+ if (bpp == 1) { \
+ UNROLL1(1, op) \
+ } else if (bpp == 2) { \
+ UNROLL1(2, op) \
+ } else if (bpp == 3) { \
+ UNROLL1(3, op) \
+ } else if (bpp == 4) { \
+ UNROLL1(4, op) \
+ } \
+ for (; i < size; i++) { \
+ dst[i] = op(dst[i - bpp], src[i], last[i]); \
+ }
/* NOTE: 'dst' can be equal to 'last' */
static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,