76 switch(bpp * 2 + be) {
90 const int bpp = c->
bpp2;
92 uint16_t *dst16 = (uint16_t*)c->
curbits;
93 uint32_t *dst32 = (uint32_t*)c->
curbits;
95 for(j = 0; j < c->
cur_h; j++) {
96 for(i = 0; i < c->
cur_w; i++) {
99 if(bpp == 1) *dst8++ = p;
100 if(bpp == 2) *dst16++ = p;
101 if(bpp == 4) *dst32++ = p;
107 for(j = 0; j < c->
cur_h; j++) {
108 for(i = 0; i < c->
cur_w; i++) {
111 if(bpp == 1) *dst8++ = p;
112 if(bpp == 2) *dst16++ = p;
113 if(bpp == 4) *dst32++ = p;
137 if((w < 1) || (h < 1))
return;
142 for(j = 0; j < h; j++) {
143 for(i = 0; i < w; i++)
144 dst[i] = (dst[i] & cd[i]) ^ msk[i];
149 }
else if(c->
bpp2 == 2) {
150 uint16_t* cd = (uint16_t*)c->
curbits, *msk = (uint16_t*)c->
curmask;
152 for(j = 0; j < h; j++) {
153 dst2 = (uint16_t*)dst;
154 for(i = 0; i < w; i++)
155 dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
160 }
else if(c->
bpp2 == 4) {
161 uint32_t* cd = (uint32_t*)c->
curbits, *msk = (uint32_t*)c->
curmask;
163 for(j = 0; j < h; j++) {
164 dst2 = (uint32_t*)dst;
165 for(i = 0; i < w; i++)
166 dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
178 dst += dx * bpp + dy *
stride;
180 for(j = 0; j < h; j++) {
181 memset(dst, color, w);
186 for(j = 0; j < h; j++) {
187 dst2 = (uint16_t*)dst;
188 for(i = 0; i < w; i++) {
195 for(j = 0; j < h; j++) {
196 dst2 = (uint32_t*)dst;
197 for(i = 0; i < w; i++) {
208 for(j = 0; j < h; j++) {
209 for(i = 0; i < w; i++) {
217 ((uint16_t*)dst)[i] = p;
220 ((uint32_t*)dst)[i] = p;
231 int bg = 0, fg = 0, rects,
color,
flags, xy, wh;
232 const int bpp = c->
bpp2;
234 int bw = 16, bh = 16;
237 for(j = 0; j < h; j += 16) {
240 if(j + 16 > h) bh = h - j;
241 for(i = 0; i < w; i += 16, dst2 += 16 * bpp) {
242 if(src - ssrc >= ssize) {
246 if(i + 16 > w) bw = w - i;
249 if(src - ssrc > ssize - bw * bh * bpp) {
254 src += bw * bh * bpp;
265 color = !!(flags &
HT_CLR);
267 paint_rect(dst2, 0, 0, bw, bh, bg, bpp, stride);
269 if(src - ssrc > ssize - rects * (color * bpp + 2)) {
273 for(k = 0; k < rects; k++) {
279 paint_rect(dst2, xy >> 4, xy & 0xF, (wh>>4)+1, (wh & 0xF)+1, fg, bpp, stride);
292 int buf_size = avpkt->
size;
296 int dx, dy, w, h,
depth, enc, chunks, res, size_left;
325 if((w > 0) && (h > 0)) {
327 for(i = 0; i < h; i++) {
334 chunks =
AV_RB16(src); src += 2;
336 if(buf_size - (src - buf) < 12) {
346 size_left = buf_size - (src - buf);
349 if (w*(int64_t)h*c->
bpp2 > INT_MAX/2 - 2) {
353 if(size_left < 2 + w * h * c->bpp2 * 2) {
354 av_log(avctx,
AV_LOG_ERROR,
"Premature end of data! (need %i got %i)\n", 2 + w * h * c->
bpp2 * 2, size_left);
370 src += w * h * c->
bpp2 * 2;
389 if(depth != c->
bpp) {
390 av_log(avctx,
AV_LOG_INFO,
"Depth mismatch. Container %i bpp, Frame data: %i bpp\n", c->
bpp, depth);
409 if(size_left < w * h * c->bpp2) {
414 src += w * h * c->
bpp2;
448 if((w > 0) && (h > 0)) {
450 for(i = 0; i < h; i++) {