summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-06-30 03:37:20 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-06-30 03:37:20 +0000
commitf3ac96e4d82ce977fbef0d724b744bd9cbdddb20 (patch)
tree9236686028f39ed0a398c516cb948b93c33e8500 /libavcodec/pngdec.c
parent2073fc84ff6dd0a29e8a9d5572c612ee9fa41158 (diff)
Support RGB48 PNG decoding
Originally committed as revision 19301 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r--libavcodec/pngdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 2b8df4edd9..5711c8ad88 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -181,6 +181,13 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w
else if(bpp == 2) UNROLL1(2, op)\
else if(bpp == 3) UNROLL1(3, op)\
else if(bpp == 4) UNROLL1(4, op)\
+ else {\
+ for (; i < size; i += bpp) {\
+ int j;\
+ for (j = 0; j < bpp; j++)\
+ dst[i+j] = op(dst[i+j-bpp], src[i+j], last[i+j]);\
+ }\
+ }
/* NOTE: 'dst' can be equal to 'last' */
static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,
@@ -478,6 +485,9 @@ static int decode_frame(AVCodecContext *avctx,
} else if (s->bit_depth == 16 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
avctx->pix_fmt = PIX_FMT_GRAY16BE;
+ } else if (s->bit_depth == 16 &&
+ s->color_type == PNG_COLOR_TYPE_RGB) {
+ avctx->pix_fmt = PIX_FMT_RGB48BE;
} else if (s->bit_depth == 1 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
avctx->pix_fmt = PIX_FMT_MONOBLACK;