77 switch(bpp * 2 + be) {
91 const int bpp = c->
bpp2;
93 uint16_t *dst16 = (uint16_t*)c->
curbits;
94 uint32_t *dst32 = (uint32_t*)c->
curbits;
96 for(j = 0; j < c->
cur_h; j++) {
97 for(i = 0; i < c->
cur_w; i++) {
100 if(bpp == 1) *dst8++ = p;
101 if(bpp == 2) *dst16++ = p;
102 if(bpp == 4) *dst32++ = p;
108 for(j = 0; j < c->
cur_h; j++) {
109 for(i = 0; i < c->
cur_w; i++) {
112 if(bpp == 1) *dst8++ = p;
113 if(bpp == 2) *dst16++ = p;
114 if(bpp == 4) *dst32++ = p;
138 if((w < 1) || (h < 1))
return;
143 for(j = 0; j < h; j++) {
144 for(i = 0; i < w; i++)
145 dst[i] = (dst[i] & cd[i]) ^ msk[i];
150 }
else if(c->
bpp2 == 2) {
151 uint16_t* cd = (uint16_t*)c->
curbits, *msk = (uint16_t*)c->
curmask;
153 for(j = 0; j < h; j++) {
154 dst2 = (uint16_t*)dst;
155 for(i = 0; i < w; i++)
156 dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
161 }
else if(c->
bpp2 == 4) {
162 uint32_t* cd = (uint32_t*)c->
curbits, *msk = (uint32_t*)c->
curmask;
164 for(j = 0; j < h; j++) {
165 dst2 = (uint32_t*)dst;
166 for(i = 0; i < w; i++)
167 dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
179 dst += dx * bpp + dy *
stride;
181 for(j = 0; j < h; j++) {
182 memset(dst, color, w);
187 for(j = 0; j < h; j++) {
188 dst2 = (uint16_t*)dst;
189 for(i = 0; i < w; i++) {
196 for(j = 0; j < h; j++) {
197 dst2 = (uint32_t*)dst;
198 for(i = 0; i < w; i++) {
209 for(j = 0; j < h; j++) {
210 for(i = 0; i < w; i++) {
218 ((uint16_t*)dst)[i] = p;
221 ((uint32_t*)dst)[i] = p;
232 int bg = 0, fg = 0, rects,
color,
flags, xy, wh;
233 const int bpp = c->
bpp2;
235 int bw = 16, bh = 16;
238 for(j = 0; j < h; j += 16) {
241 if(j + 16 > h) bh = h - j;
242 for(i = 0; i < w; i += 16, dst2 += 16 * bpp) {
243 if(src - ssrc >= ssize) {
247 if(i + 16 > w) bw = w - i;
250 if(src - ssrc > ssize - bw * bh * bpp) {
255 src += bw * bh * bpp;
266 color = !!(flags &
HT_CLR);
268 paint_rect(dst2, 0, 0, bw, bh, bg, bpp, stride);
270 if(src - ssrc > ssize - rects * (color * bpp + 2)) {
274 for(k = 0; k < rects; k++) {
280 paint_rect(dst2, xy >> 4, xy & 0xF, (wh>>4)+1, (wh & 0xF)+1, fg, bpp, stride);
293 int buf_size = avpkt->
size;
297 int dx, dy, w, h,
depth, enc, chunks,
res, size_left,
ret;
322 if((w > 0) && (h > 0)) {
324 for(i = 0; i < h; i++) {
331 chunks =
AV_RB16(src); src += 2;
333 if(buf_size - (src - buf) < 12) {
343 size_left = buf_size - (src -
buf);
346 if (w*(int64_t)h*c->
bpp2 > INT_MAX/2 - 2) {
350 if(size_left < 2 + w * h * c->bpp2 * 2) {
351 av_log(avctx,
AV_LOG_ERROR,
"Premature end of data! (need %i got %i)\n", 2 + w * h * c->
bpp2 * 2, size_left);
367 src += w * h * c->
bpp2 * 2;
386 if(depth != c->
bpp) {
387 av_log(avctx,
AV_LOG_INFO,
"Depth mismatch. Container %i bpp, Frame data: %i bpp\n", c->
bpp, depth);
406 if(size_left < w * h * c->bpp2) {
411 src += w * h * c->
bpp2;
445 if((w > 0) && (h > 0)) {
447 for(i = 0; i < h; i++) {