diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-01-05 04:52:32 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-05 04:52:32 +0000 |
commit | b26847b710b2fefe7d2d5d1f5c3450105e70b6e9 (patch) | |
tree | e7d95edf796ff6ce2df387fd273893e5d5ec0075 | |
parent | dc8465a9b4b8db3e6c94265a80e4a8e23a2ed3bd (diff) | |
download | ffmpeg-b26847b710b2fefe7d2d5d1f5c3450105e70b6e9.tar.gz |
Fix/cleanup m/ljpeg encoding pix fmt selection code in ffmpeg.c.
Better ideas are welcome ...
Originally committed as revision 26219 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffmpeg.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -628,15 +628,18 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec) { if(codec && codec->pix_fmts){ const enum PixelFormat *p= codec->pix_fmts; + if(st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL){ + if(st->codec->codec_id==CODEC_ID_MJPEG){ + p= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE}; + }else if(st->codec->codec_id==CODEC_ID_LJPEG){ + p= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE}; + } + } for(; *p!=-1; p++){ if(*p == st->codec->pix_fmt) break; } - if(*p == -1 - && !( st->codec->codec_id==CODEC_ID_MJPEG - && st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL - && ( st->codec->pix_fmt == PIX_FMT_YUV420P - || st->codec->pix_fmt == PIX_FMT_YUV422P))) + if(*p == -1) st->codec->pix_fmt = codec->pix_fmts[0]; } } |