aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Kinsey <gkinsey@ad-holdings.co.uk>2011-09-01 16:18:22 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-01 16:18:22 +0200
commit2f870e262e953815060de0ebea9b6653133b203e (patch)
tree31e4bebc111cf80b80210330c9c0ab6c84d989b3
parent3584b01e4e63cd9d05b82dee4859da5d463fb8e2 (diff)
downloadffmpeg-2f870e262e953815060de0ebea9b6653133b203e.tar.gz
jpegdec: set color_range
-rw-r--r--libavcodec/mjpegdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 1deaaf3afd..e3c1b38163 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -323,8 +323,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
case 0x11111100:
if(s->rgb){
s->avctx->pix_fmt = PIX_FMT_BGRA;
- }else
+ }else{
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ }
assert(s->nb_components==3);
break;
case 0x11000000:
@@ -332,12 +334,15 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
break;
case 0x12111100:
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV440P : PIX_FMT_YUVJ440P;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
break;
case 0x21111100:
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
break;
case 0x22111100:
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
break;
default:
av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);