*dst = *src;
break;
case 2:
- *((uint16_t*)dst) = LE_16(src);
+ *((uint16_t*)dst) = AV_RL16(src);
break;
case 3:
dst[0] = src[0];
dst[1] = src[1];
dst[2] = src[2];
break;
+ case 4:
+ *((uint32_t*)dst) = AV_RL32(src);
+ break;
}
dst += depth;
if(!type)
idlen = *buf++;
pal = *buf++;
compr = *buf++;
- first_clr = LE_16(buf); buf += 2;
- colors = LE_16(buf); buf += 2;
+ first_clr = AV_RL16(buf); buf += 2;
+ colors = AV_RL16(buf); buf += 2;
csize = *buf++;
- x = LE_16(buf); buf += 2;
- y = LE_16(buf); buf += 2;
- w = LE_16(buf); buf += 2;
- h = LE_16(buf); buf += 2;
+ x = AV_RL16(buf); buf += 2;
+ y = AV_RL16(buf); buf += 2;
+ w = AV_RL16(buf); buf += 2;
+ h = AV_RL16(buf); buf += 2;
bpp = *buf++;
flags = *buf++;
//skip identifier if any
case 24:
avctx->pix_fmt = PIX_FMT_BGR24;
break;
+ case 32:
+ avctx->pix_fmt = PIX_FMT_RGBA32;
+ break;
default:
av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", s->bpp);
return -1;
if((s->bpp + 1) >> 3 == 2){
uint16_t *dst16 = (uint16_t*)dst;
for(x = 0; x < s->width; x++)
- dst16[x] = LE_16(buf + x * 2);
+ dst16[x] = AV_RL16(buf + x * 2);
+ }else if((s->bpp + 1) >> 3 == 4){
+ uint32_t *dst32 = (uint32_t*)dst;
+ for(x = 0; x < s->width; x++)
+ dst32[x] = AV_RL32(buf + x * 4);
}else
#endif
memcpy(dst, buf, s->width * ((s->bpp + 1) >> 3));