41 #define LUT8_PART(plane, v) \
42 AV_LE2NE64C(UINT64_C(0x0000000)<<32 | v) << plane, \
43 AV_LE2NE64C(UINT64_C(0x1000000)<<32 | v) << plane, \
44 AV_LE2NE64C(UINT64_C(0x0010000)<<32 | v) << plane, \
45 AV_LE2NE64C(UINT64_C(0x1010000)<<32 | v) << plane, \
46 AV_LE2NE64C(UINT64_C(0x0000100)<<32 | v) << plane, \
47 AV_LE2NE64C(UINT64_C(0x1000100)<<32 | v) << plane, \
48 AV_LE2NE64C(UINT64_C(0x0010100)<<32 | v) << plane, \
49 AV_LE2NE64C(UINT64_C(0x1010100)<<32 | v) << plane, \
50 AV_LE2NE64C(UINT64_C(0x0000001)<<32 | v) << plane, \
51 AV_LE2NE64C(UINT64_C(0x1000001)<<32 | v) << plane, \
52 AV_LE2NE64C(UINT64_C(0x0010001)<<32 | v) << plane, \
53 AV_LE2NE64C(UINT64_C(0x1010001)<<32 | v) << plane, \
54 AV_LE2NE64C(UINT64_C(0x0000101)<<32 | v) << plane, \
55 AV_LE2NE64C(UINT64_C(0x1000101)<<32 | v) << plane, \
56 AV_LE2NE64C(UINT64_C(0x0010101)<<32 | v) << plane, \
57 AV_LE2NE64C(UINT64_C(0x1010101)<<32 | v) << plane
59 #define LUT8(plane) { \
60 LUT8_PART(plane, 0x0000000), \
61 LUT8_PART(plane, 0x1000000), \
62 LUT8_PART(plane, 0x0010000), \
63 LUT8_PART(plane, 0x1010000), \
64 LUT8_PART(plane, 0x0000100), \
65 LUT8_PART(plane, 0x1000100), \
66 LUT8_PART(plane, 0x0010100), \
67 LUT8_PART(plane, 0x1010100), \
68 LUT8_PART(plane, 0x0000001), \
69 LUT8_PART(plane, 0x1000001), \
70 LUT8_PART(plane, 0x0010001), \
71 LUT8_PART(plane, 0x1010001), \
72 LUT8_PART(plane, 0x0000101), \
73 LUT8_PART(plane, 0x1000101), \
74 LUT8_PART(plane, 0x0010101), \
75 LUT8_PART(plane, 0x1010101), \
84 #define LUT32(plane) { \
86 0, 0, 0, 1 << plane, \
87 0, 0, 1 << plane, 0, \
88 0, 0, 1 << plane, 1 << plane, \
89 0, 1 << plane, 0, 0, \
90 0, 1 << plane, 0, 1 << plane, \
91 0, 1 << plane, 1 << plane, 0, \
92 0, 1 << plane, 1 << plane, 1 << plane, \
93 1 << plane, 0, 0, 0, \
94 1 << plane, 0, 0, 1 << plane, \
95 1 << plane, 0, 1 << plane, 0, \
96 1 << plane, 0, 1 << plane, 1 << plane, \
97 1 << plane, 1 << plane, 0, 0, \
98 1 << plane, 1 << plane, 0, 1 << plane, \
99 1 << plane, 1 << plane, 1 << plane, 0, \
100 1 << plane, 1 << plane, 1 << plane, 1 << plane, \
117 return x << 16 | x << 8 | x;
136 for (i=0; i < count; i++) {
142 for (i=0; i < count; i++) {
183 static void decodeplane8(uint8_t *dst,
const uint8_t *buf,
int buf_size,
int plane)
187 uint64_t
v =
AV_RN64A(dst) | lut[*buf++];
190 }
while (--buf_size);
200 static void decodeplane32(uint32_t *dst,
const uint8_t *buf,
int buf_size,
int plane)
204 unsigned mask = (*buf >> 2) & ~3;
205 dst[0] |= lut[mask++];
206 dst[1] |= lut[mask++];
207 dst[2] |= lut[mask++];
209 mask = (*buf++ << 2) & 0x3F;
210 dst[4] |= lut[mask++];
211 dst[5] |= lut[mask++];
212 dst[6] |= lut[mask++];
215 }
while (--buf_size);
228 const uint8_t *buf,
const uint8_t *
const buf_end) {
229 const uint8_t *
const buf_start = buf;
231 for (x = 0; x < dst_size && buf < buf_end;) {
233 const int8_t value = *buf++;
236 memcpy(dst + x, buf,
FFMIN3(length, dst_size - x, buf_end - buf));
238 }
else if (value > -128) {
240 memset(dst + x, *buf++,
FFMIN(length, dst_size - x));
246 return buf - buf_start;
250 void *
data,
int *data_size,
254 const uint8_t *buf = avpkt->
data;
255 int buf_size = avpkt->
size;
256 const uint8_t *buf_end = buf+buf_size;
275 for (y = 0; y < avctx->
height && buf < buf_end; y++ ) {
277 memset(row, 0, avctx->
width);
284 for(y = 0; y < avctx->
height; y++ ) {
286 memset(row, 0, avctx->
width << 2);
294 for(y = 0; y < avctx->
height; y++ ) {
296 memcpy(row, buf,
FFMIN(avctx->
width, buf_end - buf));
307 void *
data,
int *data_size,
311 const uint8_t *buf = avpkt->
data;
312 int buf_size = avpkt->
size;
313 const uint8_t *buf_end = buf+buf_size;
332 for(y = 0; y < avctx->
height ; y++ ) {
334 memset(row, 0, avctx->
width);
341 for(y = 0; y < avctx->
height ; y++ ) {
343 memset(row, 0, avctx->
width << 2);
351 for(y = 0; y < avctx->
height ; y++ ) {
384 .
name =
"iff_byterun1",