84 n = (chunk_id & 0x04) ? 4 : 6;
89 for (i=0; i < 256; i++) {
90 if ((chunk_id & 0x01) && !(mask >>= 1)) {
99 if (!(chunk_id & 0x01) || (flag & mask)) {
102 if ((data + n) > eod)
105 for (k = 0; k < 4; ++k) {
107 for (kk = 0; kk < 3; ++kk)
112 u = *(int8_t *)data++;
113 v = *(int8_t *)data++;
117 g = *p++ - (u/2) - v;
120 *p++ = av_clip_uint8(r);
121 *p++ = av_clip_uint8(g);
122 *p++ = av_clip_uint8(b);
136 uint8_t *cb0, *cb1, *cb2, *cb3;
138 char *ip0, *ip1, *ip2, *ip3;
143 for (y=strip->
y1; y < strip->y2; y+=4) {
146 ip0 = ip1 = ip2 = ip3 = s->
frame.
data[0] +
162 for (x=strip->
x1; x < strip->x2; x+=4) {
163 if ((chunk_id & 0x01) && !(mask >>= 1)) {
164 if ((data + 4) > eod)
172 if (!(chunk_id & 0x01) || (flag & mask)) {
173 if (!(chunk_id & 0x02) && !(mask >>= 1)) {
174 if ((data + 4) > eod)
182 if ((chunk_id & 0x02) || (~flag & mask)) {
189 ip3[0] = ip3[1] = ip2[0] = ip2[1] = p[6];
190 ip3[2] = ip3[3] = ip2[2] = ip2[3] = p[9];
191 ip1[0] = ip1[1] = ip0[0] = ip0[1] = p[0];
192 ip1[2] = ip1[3] = ip0[2] = ip0[3] = p[3];
195 memcpy(ip3 + 0, p, 3); memcpy(ip3 + 3, p, 3);
196 memcpy(ip2 + 0, p, 3); memcpy(ip2 + 3, p, 3);
198 memcpy(ip3 + 6, p, 3); memcpy(ip3 + 9, p, 3);
199 memcpy(ip2 + 6, p, 3); memcpy(ip2 + 9, p, 3);
201 memcpy(ip1 + 0, p, 3); memcpy(ip1 + 3, p, 3);
202 memcpy(ip0 + 0, p, 3); memcpy(ip0 + 3, p, 3);
204 memcpy(ip1 + 6, p, 3); memcpy(ip1 + 9, p, 3);
205 memcpy(ip0 + 6, p, 3); memcpy(ip0 + 9, p, 3);
208 }
else if (flag & mask) {
209 if ((data + 4) > eod)
239 memcpy(ip3 + 0, cb2 + 6, 6);
240 memcpy(ip3 + 6, cb3 + 6, 6);
241 memcpy(ip2 + 0, cb2 + 0, 6);
242 memcpy(ip2 + 6, cb3 + 0, 6);
243 memcpy(ip1 + 0, cb0 + 6, 6);
244 memcpy(ip1 + 6, cb1 + 6, 6);
245 memcpy(ip0 + 0, cb0 + 0, 6);
246 memcpy(ip0 + 6, cb1 + 0, 6);
256 ip0 += 12; ip1 += 12;
257 ip2 += 12; ip3 += 12;
269 int chunk_id, chunk_size;
274 strip->
x1 >= strip->
x2 || strip->
y1 >= strip->
y2)
277 while ((data + 4) <= eod) {
279 chunk_size =
AV_RB24 (&data[1]) - 4;
284 chunk_size = ((data + chunk_size) > eod) ? (eod -
data) : chunk_size;
320 int i, result, strip_size, frame_flags, num_strips;
322 int encoded_buf_size;
327 frame_flags = s->
data[0];
333 if (!encoded_buf_size) {
337 if (encoded_buf_size != s->
size && (s->
size % encoded_buf_size) != 0) {
345 (s->
data[10] == 0xFE) &&
346 (s->
data[11] == 0x00) &&
347 (s->
data[12] == 0x00) &&
348 (s->
data[13] == 0x06) &&
349 (s->
data[14] == 0x00) &&
350 (s->
data[15] == 0x00))
364 for (i=0; i < num_strips; i++) {
365 if ((s->
data + 12) > eod)
384 strip_size = ((s->
data + strip_size) > eod) ? (eod - s->
data) : strip_size;
386 if ((i > 0) && !(frame_flags & 0x01)) {
398 s->
data += strip_size;
430 void *
data,
int *got_frame,
434 int ret = 0, buf_size = avpkt->
size;