mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mjpeg: set color_range
This commit is contained in:
parent
6612a03d74
commit
1c1fbc70ca
@ -338,8 +338,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
case 0x11111100:
|
case 0x11111100:
|
||||||
if (s->rgb)
|
if (s->rgb)
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_BGRA;
|
s->avctx->pix_fmt = AV_PIX_FMT_BGRA;
|
||||||
else
|
else {
|
||||||
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
|
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
|
||||||
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
|
}
|
||||||
assert(s->nb_components == 3);
|
assert(s->nb_components == 3);
|
||||||
break;
|
break;
|
||||||
case 0x11000000:
|
case 0x11000000:
|
||||||
@ -347,12 +349,15 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
break;
|
break;
|
||||||
case 0x12111100:
|
case 0x12111100:
|
||||||
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
|
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
|
||||||
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
break;
|
break;
|
||||||
case 0x21111100:
|
case 0x21111100:
|
||||||
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
|
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
|
||||||
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
break;
|
break;
|
||||||
case 0x22111100:
|
case 0x22111100:
|
||||||
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
|
s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
|
||||||
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
|
av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user