Mercurial > libavcodec.hg
comparison mpegvideo.c @ 2442:ba01b8552bd4 libavcodec
jpeg style yuv fixes
author | michael |
---|---|
date | Thu, 20 Jan 2005 00:30:20 +0000 |
parents | 548c87c06dbb |
children | e248c6250232 |
comparison
equal
deleted
inserted
replaced
2441:358813ec4ca2 | 2442:ba01b8552bd4 |
---|---|
890 int i, dummy; | 890 int i, dummy; |
891 int chroma_h_shift, chroma_v_shift; | 891 int chroma_h_shift, chroma_v_shift; |
892 | 892 |
893 MPV_encode_defaults(s); | 893 MPV_encode_defaults(s); |
894 | 894 |
895 avctx->pix_fmt = PIX_FMT_YUV420P; // FIXME | 895 if(avctx->pix_fmt != PIX_FMT_YUVJ420P && avctx->pix_fmt != PIX_FMT_YUV420P){ |
896 av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n"); | |
897 return -1; | |
898 } | |
899 | |
900 if(avctx->codec_id == CODEC_ID_MJPEG || avctx->codec_id == CODEC_ID_LJPEG){ | |
901 if(avctx->strict_std_compliance>=0 && avctx->pix_fmt != PIX_FMT_YUVJ420P){ | |
902 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n"); | |
903 return -1; | |
904 } | |
905 }else{ | |
906 if(avctx->strict_std_compliance>=0 && avctx->pix_fmt != PIX_FMT_YUV420P){ | |
907 av_log(avctx, AV_LOG_ERROR, "colorspace not supported\n"); | |
908 return -1; | |
909 } | |
910 } | |
896 | 911 |
897 s->bit_rate = avctx->bit_rate; | 912 s->bit_rate = avctx->bit_rate; |
898 s->width = avctx->width; | 913 s->width = avctx->width; |
899 s->height = avctx->height; | 914 s->height = avctx->height; |
900 if(avctx->gop_size > 600){ | 915 if(avctx->gop_size > 600){ |
2257 { | 2272 { |
2258 MpegEncContext *s = avctx->priv_data; | 2273 MpegEncContext *s = avctx->priv_data; |
2259 AVFrame *pic_arg = data; | 2274 AVFrame *pic_arg = data; |
2260 int i, stuffing_count; | 2275 int i, stuffing_count; |
2261 | 2276 |
2262 if(avctx->pix_fmt != PIX_FMT_YUV420P){ | 2277 if(avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT_YUVJ420P){ |
2263 av_log(avctx, AV_LOG_ERROR, "this codec supports only YUV420P\n"); | 2278 av_log(avctx, AV_LOG_ERROR, "this codec supports only YUV420P\n"); |
2264 return -1; | 2279 return -1; |
2265 } | 2280 } |
2266 | 2281 |
2267 for(i=0; i<avctx->thread_count; i++){ | 2282 for(i=0; i<avctx->thread_count; i++){ |