Revision 20d46c03 libavcodec/imgconvert.c

View differences:

libavcodec/imgconvert.c
185 185
    },
186 186
    [PIX_FMT_RGB555] = {
187 187
        .name = "rgb555",
188
        .nb_channels = 4, .is_alpha = 1,
188
        .nb_channels = 3,
189 189
        .color_type = FF_COLOR_RGB,
190 190
        .pixel_type = FF_PIXEL_PACKED,
191 191
        .depth = 5,
......
1629 1629
    b = bitcopy_n(v << 3, 3);\
1630 1630
}
1631 1631

  
1632
#define RGBA_IN(r, g, b, a, s)\
1633
{\
1634
    unsigned int v = ((const uint16_t *)(s))[0];\
1635
    r = bitcopy_n(v >> (10 - 3), 3);\
1636
    g = bitcopy_n(v >> (5 - 3), 3);\
1637
    b = bitcopy_n(v << 3, 3);\
1638
    a = (-(v >> 15)) & 0xff;\
1639
}
1640 1632

  
1641
#define RGBA_OUT(d, r, g, b, a)\
1633
#define RGB_OUT(d, r, g, b)\
1642 1634
{\
1643
    ((uint16_t *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3) | \
1644
                           ((a << 8) & 0x8000);\
1635
    ((uint16_t *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);\
1645 1636
}
1646 1637

  
1647 1638
#define BPP 2
......
2596 2587
    case PIX_FMT_RGBA32:
2597 2588
        ret = get_alpha_info_rgba32(src, width, height);
2598 2589
        break;
2599
    case PIX_FMT_RGB555:
2600
        ret = get_alpha_info_rgb555(src, width, height);
2601
        break;
2602 2590
    case PIX_FMT_PAL8:
2603 2591
        ret = get_alpha_info_pal8(src, width, height);
2604 2592
        break;

Also available in: Unified diff