URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
689 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-O2" } */
|
3 |
|
|
|
4 |
|
|
#define FILL_BACK *ptrRGB++=0; *ptrRGB++=0; *ptrRGB++=0;
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
void uncompact(unsigned char* ptrRGB, const unsigned int* ptrSrc, const unsigned char* ptrRGBcompact, int line, int nbPixLeft)
|
8 |
|
|
{
|
9 |
|
|
|
10 |
|
|
#define BIT_2_RGB32 \
|
11 |
|
|
if ((v & 0x00000001)){ nbPixLeft--; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; } \
|
12 |
|
|
else{ FILL_BACK } \
|
13 |
|
|
v >>= 1;
|
14 |
|
|
#define BIT_2_RGB16 \
|
15 |
|
|
if ((v16 & 0x0001)){ nbPixLeft--; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; } \
|
16 |
|
|
else{ FILL_BACK } \
|
17 |
|
|
v16 >>= 1;
|
18 |
|
|
|
19 |
|
|
int x;
|
20 |
|
|
unsigned int v, *ptrSrc32bits=(unsigned int*)ptrSrc;
|
21 |
|
|
unsigned short v16,*ptrSrc16bits;
|
22 |
|
|
|
23 |
|
|
for(x=0; x<line; x++) {
|
24 |
|
|
v = *ptrSrc32bits++;
|
25 |
|
|
BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
|
26 |
|
|
BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
|
27 |
|
|
BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
|
28 |
|
|
BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
ptrSrc16bits=(unsigned short *)ptrSrc32bits;
|
32 |
|
|
v16 = *ptrSrc16bits++;
|
33 |
|
|
BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16
|
34 |
|
|
BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16
|
35 |
|
|
|
36 |
|
|
}
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.