Revision 611e7bc4

View differences:

libavcodec/rawdec.c
34 34
} RawVideoContext;
35 35

  
36 36
static const PixelFormatTag pixelFormatBpsAVI[] = {
37
    { PIX_FMT_PAL8,    4 },
37 38
    { PIX_FMT_PAL8,    8 },
38 39
    { PIX_FMT_RGB555, 15 },
39 40
    { PIX_FMT_RGB555, 16 },
......
105 106
    frame->interlaced_frame = avctx->coded_frame->interlaced_frame;
106 107
    frame->top_field_first = avctx->coded_frame->top_field_first;
107 108

  
109
    //4bpp raw in avi (yes this is ugly ...)
110
    if(avctx->bits_per_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 && !avctx->codec_tag){
111
        int i;
112
        for(i=256*2; i+1 < context->length>>1; i++){
113
            context->buffer[2*i+0]= buf[i-256*2]>>4;
114
            context->buffer[2*i+1]= buf[i-256*2]&15;
115
        }
116
        buf= context->buffer + 256*4;
117
        buf_size= context->length - 256*4;
118
    }
119

  
108 120
    if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0))
109 121
        return -1;
110 122

  

Also available in: Unified diff