1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

msrledec: move loop into switch

speeds up code and allows more simplifications

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-30 16:39:35 +01:00
parent c2992b7053
commit dbaae33c2c

View File

@ -218,21 +218,30 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
case 32: pix32 = bytestream2_get_le32(gb);
break;
}
for(i = 0; i < p1; i++) {
switch(depth){
case 8: *output++ = pix[0];
case 8:
for(i = 0; i < p1; i++)
*output++ = pix[0];
break;
case 16: *(uint16_t*)output = pix16;
case 16:
for(i = 0; i < p1; i++) {
*(uint16_t*)output = pix16;
output += 2;
}
break;
case 24: *output++ = pix[0];
case 24:
for(i = 0; i < p1; i++) {
*output++ = pix[0];
*output++ = pix[1];
*output++ = pix[2];
break;
case 32: *(uint32_t*)output = pix32;
output += 4;
break;
}
break;
case 32:
for(i = 0; i < p1; i++) {
*(uint32_t*)output = pix32;
output += 4;
}
break;
}
pos += p1;
}