# HG changeset patch # User kostya # Date 1246333040 0 # Node ID 06e12f9b93d79ceca2e541c5be23c6ef2bd4e390 # Parent 78b2fc137c27a65d95a60a51546f9508cca824e3 Support RGB48 PNG decoding diff -r 78b2fc137c27 -r 06e12f9b93d7 pngdec.c --- a/pngdec.c Tue Jun 30 03:12:50 2009 +0000 +++ b/pngdec.c Tue Jun 30 03:37:20 2009 +0000 @@ -181,6 +181,13 @@ 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 @@ } 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;