Mercurial > libavcodec.hg
comparison rawdec.c @ 6423:4cf5fde3c99e libavcodec
code is ok for 4bpp in mov too, fix 16grey.mov
| author | bcoudurier |
|---|---|
| date | Thu, 28 Feb 2008 16:08:52 +0000 |
| parents | aa954496a445 |
| children | 66969d0e4a6d |
comparison
equal
deleted
inserted
replaced
| 6422:e82ca9167c1f | 6423:4cf5fde3c99e |
|---|---|
| 44 }; | 44 }; |
| 45 | 45 |
| 46 static const PixelFormatTag pixelFormatBpsMOV[] = { | 46 static const PixelFormatTag pixelFormatBpsMOV[] = { |
| 47 /* FIXME fix swscaler to support those */ | 47 /* FIXME fix swscaler to support those */ |
| 48 /* http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html */ | 48 /* http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html */ |
| 49 { PIX_FMT_PAL8, 4 }, | |
| 49 { PIX_FMT_PAL8, 8 }, | 50 { PIX_FMT_PAL8, 8 }, |
| 50 { PIX_FMT_BGR555, 16 }, | 51 { PIX_FMT_BGR555, 16 }, |
| 51 { PIX_FMT_RGB24, 24 }, | 52 { PIX_FMT_RGB24, 24 }, |
| 52 { PIX_FMT_BGR32_1, 32 }, | 53 { PIX_FMT_BGR32_1, 32 }, |
| 53 { -1, 0 }, | 54 { -1, 0 }, |
| 104 AVPicture * picture = (AVPicture *) data; | 105 AVPicture * picture = (AVPicture *) data; |
| 105 | 106 |
| 106 frame->interlaced_frame = avctx->coded_frame->interlaced_frame; | 107 frame->interlaced_frame = avctx->coded_frame->interlaced_frame; |
| 107 frame->top_field_first = avctx->coded_frame->top_field_first; | 108 frame->top_field_first = avctx->coded_frame->top_field_first; |
| 108 | 109 |
| 109 //4bpp raw in avi (yes this is ugly ...) | 110 //4bpp raw in avi and mov (yes this is ugly ...) |
| 110 if(avctx->bits_per_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 && !avctx->codec_tag){ | 111 if(avctx->bits_per_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 && |
| 112 !avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' ')){ | |
| 111 int i; | 113 int i; |
| 112 for(i=256*2; i+1 < context->length>>1; i++){ | 114 for(i=256*2; i+1 < context->length>>1; i++){ |
| 113 context->buffer[2*i+0]= buf[i-256*2]>>4; | 115 context->buffer[2*i+0]= buf[i-256*2]>>4; |
| 114 context->buffer[2*i+1]= buf[i-256*2]&15; | 116 context->buffer[2*i+1]= buf[i-256*2]&15; |
| 115 } | 117 } |
