} else if (s->bit_depth == 16 &&
s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
avctx->pix_fmt = PIX_FMT_RGBA64BE;
- } else if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
+ } else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
+ s->color_type == PNG_COLOR_TYPE_PALETTE) {
avctx->pix_fmt = PIX_FMT_PAL8;
} else if (s->bit_depth == 1) {
avctx->pix_fmt = PIX_FMT_MONOBLACK;
} else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
- avctx->pix_fmt = PIX_FMT_GRAY8A;
+ avctx->pix_fmt = PIX_FMT_Y400A;
} else {
av_log(avctx, AV_LOG_ERROR, "unsupported bit depth %d "
"and color type %d\n",
/* handle p-frames only if a predecessor frame is available */
if(s->last_picture->data[0] != NULL) {
- if(!(avpkt->flags & AV_PKT_FLAG_KEY)) {
+ if( !(avpkt->flags & AV_PKT_FLAG_KEY)
+ && s->last_picture->width == s->current_picture->width
+ && s->last_picture->height== s->current_picture->height
+ ) {
int i, j;
uint8_t *pd = s->current_picture->data[0];
uint8_t *pd_last = s->last_picture->data[0];
.close = png_dec_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
- .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
+ .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
};