Commit c9acea42 authored by kostya's avatar kostya

Support RGB48 PNG decoding

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19301 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 988fbb31
...@@ -181,6 +181,13 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w ...@@ -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 == 2) UNROLL1(2, op)\
else if(bpp == 3) UNROLL1(3, op)\ else if(bpp == 3) UNROLL1(3, op)\
else if(bpp == 4) UNROLL1(4, 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' */ /* NOTE: 'dst' can be equal to 'last' */
static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type, static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,
...@@ -478,6 +485,9 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -478,6 +485,9 @@ static int decode_frame(AVCodecContext *avctx,
} else if (s->bit_depth == 16 && } else if (s->bit_depth == 16 &&
s->color_type == PNG_COLOR_TYPE_GRAY) { s->color_type == PNG_COLOR_TYPE_GRAY) {
avctx->pix_fmt = PIX_FMT_GRAY16BE; 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 && } else if (s->bit_depth == 1 &&
s->color_type == PNG_COLOR_TYPE_GRAY) { s->color_type == PNG_COLOR_TYPE_GRAY) {
avctx->pix_fmt = PIX_FMT_MONOBLACK; avctx->pix_fmt = PIX_FMT_MONOBLACK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment