49 for (i = 0; i < 256; i++) {
61 while (he[last].len == 255 && last)
64 if (he[last].len > 32)
68 for (i = last; i >= 0; i--) {
69 codes[i] = code >> (32 - he[i].
len);
72 code += 0x80000000
u >> (he[i].
len - 1);
76 bits,
sizeof(*bits),
sizeof(*bits),
77 codes,
sizeof(*codes),
sizeof(*codes),
78 syms,
sizeof(*syms),
sizeof(*syms), 0);
99 for (slice = 0; slice < c->
slices; slice++) {
103 send = (height * (slice + 1) / c->
slices) & cmask;
104 dest = dst + sstart * stride;
107 for (j = sstart; j < send; j++) {
108 for (i = 0; i < width * step; i += step) {
125 for (slice = 0; slice < c->
slices; slice++) {
127 int slice_data_start, slice_data_end, slice_size;
130 send = (height * (slice + 1) / c->
slices) & cmask;
131 dest = dst + sstart * stride;
134 slice_data_start = slice ?
AV_RL32(src + slice * 4 - 4) : 0;
135 slice_data_end =
AV_RL32(src + slice * 4);
136 slice_size = slice_data_end - slice_data_start;
140 "yet a slice has a length of zero.\n");
149 (slice_data_end - slice_data_start + 3) >> 2);
153 for (j = sstart; j < send; j++) {
154 for (i = 0; i < width * step; i += step) {
157 "Slice decoding ran out of bits\n");
192 for (j = 0; j <
height; j++) {
193 for (i = 0; i < width * step; i += step) {
197 src[i] = r + g - 0x80;
198 src[i + 2] = b + g - 0x80;
210 int slice_start, slice_height;
211 const int cmask = ~rmode;
213 for (slice = 0; slice < slices; slice++) {
214 slice_start = ((slice *
height) / slices) & cmask;
215 slice_height = ((((slice + 1) * height) / slices) & cmask) -
220 bsrc = src + slice_start * stride;
225 for (i = step; i < width * step; i += step) {
230 if (slice_height <= 1)
236 for (i = step; i < width * step; i += step) {
237 B = bsrc[i - stride];
244 for (j = 2; j < slice_height; j++) {
245 for (i = 0; i < width * step; i += step) {
246 B = bsrc[i - stride];
266 int slice_start, slice_height;
267 const int cmask = ~(rmode ? 3 : 1);
268 const int stride2 = stride << 1;
270 for (slice = 0; slice < slices; slice++) {
271 slice_start = ((slice *
height) / slices) & cmask;
272 slice_height = ((((slice + 1) * height) / slices) & cmask) -
278 bsrc = src + slice_start * stride;
283 for (i = step; i < width * step; i += step) {
287 for (i = 0; i < width * step; i += step) {
288 bsrc[stride + i] +=
A;
289 A = bsrc[stride + i];
292 if (slice_height <= 1)
298 for (i = step; i < width * step; i += step) {
299 B = bsrc[i - stride2];
304 for (i = 0; i < width * step; i += step) {
305 B = bsrc[i - stride];
308 A = bsrc[stride + i];
312 for (j = 2; j < slice_height; j++) {
313 for (i = 0; i < width * step; i += step) {
314 B = bsrc[i - stride2];
319 for (i = 0; i < width * step; i += step) {
320 B = bsrc[i - stride];
323 A = bsrc[i + stride];
334 int buf_size = avpkt->
size;
338 int plane_size, max_slice_size = 0, slice_start,
slice_end, slice_size;
348 for (i = 0; i < c->
planes; i++) {
349 plane_start[i] = gb.
buffer;
357 for (j = 0; j < c->
slices; j++) {
358 slice_end = bytestream2_get_le32u(&gb);
359 slice_size = slice_end - slice_start;
360 if (slice_end < 0 || slice_size < 0 ||
366 max_slice_size =
FFMAX(max_slice_size, slice_size);
398 for (i = 0; i < c->
planes; i++) {
401 avctx->
height, plane_start[i],
422 for (i = 0; i < 3; i++) {
443 for (i = 0; i < 3; i++) {
484 "Insufficient extradata size %d, should be at least 16\n",
507 case MKTAG(
'U',
'L',
'R',
'G'):
511 case MKTAG(
'U',
'L',
'R',
'A'):
515 case MKTAG(
'U',
'L',
'Y',
'0'):
520 case MKTAG(
'U',
'L',
'Y',
'2'):
525 case MKTAG(
'U',
'L',
'H',
'0'):
530 case MKTAG(
'U',
'L',
'H',
'2'):