unroll ImagingPackRGB

This commit is contained in:
Alexander 2017-08-18 01:13:50 +03:00
parent b4e226714d
commit 762b09cdb5

View File

@ -227,13 +227,17 @@ packLAL(UINT8* out, const UINT8* in, int pixels)
void void
ImagingPackRGB(UINT8* out, const UINT8* in, int pixels) ImagingPackRGB(UINT8* out, const UINT8* in, int pixels)
{ {
int i; int i = 0;
/* RGB triplets */ /* RGB triplets */
for (i = 0; i < pixels; i++) { for (; i < pixels-1; i++) {
out[0] = in[R]; ((UINT32*)out)[0] = ((UINT32*)in)[i];
out[1] = in[G]; out += 3;
out[2] = in[B]; }
out += 3; in += 4; for (; i < pixels; i++) {
out[0] = in[i*4+R];
out[1] = in[i*4+G];
out[2] = in[i*4+B];
out += 3;
} }
} }