mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
avcodec/apng: Add support for blending with GRAY8A pixel format
Signed-off-by: Donny Yang <work@kota.moe> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0ab1c46fe0
commit
33292c07fe
@ -896,7 +896,8 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
if (s->blend_op == APNG_BLEND_OP_OVER &&
|
if (s->blend_op == APNG_BLEND_OP_OVER &&
|
||||||
avctx->pix_fmt != AV_PIX_FMT_RGBA) {
|
avctx->pix_fmt != AV_PIX_FMT_RGBA &&
|
||||||
|
avctx->pix_fmt != AV_PIX_FMT_GRAY8A) {
|
||||||
avpriv_request_sample(avctx, "Blending with pixel format %s",
|
avpriv_request_sample(avctx, "Blending with pixel format %s",
|
||||||
av_get_pix_fmt_name(avctx->pix_fmt));
|
av_get_pix_fmt_name(avctx->pix_fmt));
|
||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
@ -942,6 +943,11 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
|
|||||||
foreground_alpha = foreground[3];
|
foreground_alpha = foreground[3];
|
||||||
background_alpha = background[3];
|
background_alpha = background[3];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AV_PIX_FMT_GRAY8A:
|
||||||
|
foreground_alpha = foreground[1];
|
||||||
|
background_alpha = background[1];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foreground_alpha == 0)
|
if (foreground_alpha == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user