Ticket #830: patchtif1bpp.diff

File patchtif1bpp.diff, 1.3 KB (added by Carl Eugen Hoyos, 15 years ago)
  • libavcodec/tiff.c

    diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
    index 1060a44..a35d070 100644
    a b static void av_always_inline horizontal_fill(unsigned int bpp, uint8_t* dst,  
    108108{
    109109    int i;
    110110
    111     if (bpp == 2) {
     111    if (bpp == 1) {
     112        for (i = 0; i < width; i++) {
     113            dst[(i+offset)*8+0] = (usePtr ? src[i] : c) >> 7;
     114            dst[(i+offset)*8+1] = (usePtr ? src[i] : c) >> 6 & 0x1;
     115            dst[(i+offset)*8+2] = (usePtr ? src[i] : c) >> 5 & 0x1;
     116            dst[(i+offset)*8+3] = (usePtr ? src[i] : c) >> 4 & 0x1;
     117            dst[(i+offset)*8+4] = (usePtr ? src[i] : c) >> 3 & 0x1;
     118            dst[(i+offset)*8+5] = (usePtr ? src[i] : c) >> 2 & 0x1;
     119            dst[(i+offset)*8+6] = (usePtr ? src[i] : c) >> 1 & 0x1;
     120            dst[(i+offset)*8+7] = (usePtr ? src[i] : c) & 0x1;
     121        }
     122    } else if (bpp == 2) {
    112123        for (i = 0; i < width; i++) {
    113124            dst[(i+offset)*4+0] = (usePtr ? src[i] : c) >> 6;
    114125            dst[(i+offset)*4+1] = (usePtr ? src[i] : c) >> 4 & 0x3;
    … … static int init_image(TiffContext *s)  
    270281
    271282    switch (s->bpp * 10 + s->bppcount) {
    272283    case 11:
    273         s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
    274         break;
    275284    case 21:
    276285    case 41:
    277286    case 81: