mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/mjpegdec: fix cmyk 420 with adobe_transform == 2
Fixes Ticket3516 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
1f361124d9
commit
d56c373391
|
@ -414,6 +414,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||||
s->upscale_v = 6;
|
s->upscale_v = 6;
|
||||||
s->upscale_h = 6;
|
s->upscale_h = 6;
|
||||||
s->chroma_height = s->height;
|
s->chroma_height = s->height;
|
||||||
|
} else if (s->adobe_transform == 2 && s->bits <= 8) {
|
||||||
|
s->avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
|
||||||
|
s->upscale_v = 6;
|
||||||
|
s->upscale_h = 6;
|
||||||
|
s->chroma_height = s->height;
|
||||||
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
} else {
|
} else {
|
||||||
if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
|
if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
|
||||||
else s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P16;
|
else s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P16;
|
||||||
|
@ -2053,6 +2059,7 @@ the_end:
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUVJ440P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUVJ440P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUV440P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUV440P ||
|
||||||
|
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_GBRAP
|
avctx->pix_fmt == AV_PIX_FMT_GBRAP
|
||||||
);
|
);
|
||||||
for (p = 1; p<4; p++) {
|
for (p = 1; p<4; p++) {
|
||||||
|
@ -2072,6 +2079,7 @@ the_end:
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
|
||||||
|
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_GBRAP
|
avctx->pix_fmt == AV_PIX_FMT_GBRAP
|
||||||
);
|
);
|
||||||
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
||||||
|
|
Loading…
Reference in New Issue