diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-01-20 00:30:20 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-01-20 00:30:20 +0000 |
commit | dd4f8a04fe81c2587293a7c89ef8702f54330339 (patch) | |
tree | 056cd23cd263ab90832f443b98eb420db3eb892e /libavcodec/mpegvideo.c | |
parent | 827c91bfb795359aa69663411237cb9df40b1c22 (diff) | |
download | ffmpeg-dd4f8a04fe81c2587293a7c89ef8702f54330339.tar.gz |
jpeg style yuv fixes
Originally committed as revision 3852 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 6a48097a0c..6b5546cd3a 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -892,7 +892,22 @@ int MPV_encode_init(AVCodecContext *avctx) MPV_encode_defaults(s); - avctx->pix_fmt = PIX_FMT_YUV420P; // FIXME + if(avctx->pix_fmt != PIX_FMT_YUVJ420P && avctx->pix_fmt != PIX_FMT_YUV420P){ + av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n"); + return -1; + } + + if(avctx->codec_id == CODEC_ID_MJPEG || avctx->codec_id == CODEC_ID_LJPEG){ + if(avctx->strict_std_compliance>=0 && avctx->pix_fmt != PIX_FMT_YUVJ420P){ + av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n"); + return -1; + } + }else{ + if(avctx->strict_std_compliance>=0 && avctx->pix_fmt != PIX_FMT_YUV420P){ + av_log(avctx, AV_LOG_ERROR, "colorspace not supported\n"); + return -1; + } + } s->bit_rate = avctx->bit_rate; s->width = avctx->width; @@ -2259,7 +2274,7 @@ int MPV_encode_picture(AVCodecContext *avctx, AVFrame *pic_arg = data; int i, stuffing_count; - if(avctx->pix_fmt != PIX_FMT_YUV420P){ + if(avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT_YUVJ420P){ av_log(avctx, AV_LOG_ERROR, "this codec supports only YUV420P\n"); return -1; } |