aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-27 01:59:50 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-27 01:59:50 +0000
commitc2c7342b700222de68028ebd8b149fd1462b1b04 (patch)
treebb148873fd0ef47e0bd0ec4f50ff7acc431283f2
parent7c1e33f930a890fc89ec0d5f48c49eb473aea5f4 (diff)
downloadffmpeg-c2c7342b700222de68028ebd8b149fd1462b1b04.tar.gz
Simplify pix_fmt_id instead of listing a subset of non-simplified ones.
Originally committed as revision 15436 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mjpegdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 125d26a1bd..bb088b5c6e 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -289,8 +289,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
(s->h_count[2] << 12) | (s->v_count[2] << 8) |
(s->h_count[3] << 4) | s->v_count[3];
av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
+ if(!(pix_fmt_id & 0x10101010))
+ pix_fmt_id-= (pix_fmt_id & 0xF0F0F0F0)>>1;
+ if(!(pix_fmt_id & 0x01010101))
+ pix_fmt_id-= (pix_fmt_id & 0x0F0F0F0F)>>1;
+
switch(pix_fmt_id){
- case 0x22222200:
case 0x11111100:
if(s->rgb){
s->avctx->pix_fmt = PIX_FMT_RGB32;
@@ -306,7 +310,6 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV440P : PIX_FMT_YUVJ440P;
break;
case 0x21111100:
- case 0x22121200:
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P;
break;
case 0x22111100: