48 for (i = 0; i < 256; i++) {
62 while (he[last].len == 255 && last)
66 for (i = last; i >= 0; i--) {
67 codes[i] = code >> (32 - he[i].
len);
70 code += 0x80000000
u >> (he[i].
len - 1);
74 bits,
sizeof(*bits),
sizeof(*bits),
75 codes,
sizeof(*codes),
sizeof(*codes),
76 syms,
sizeof(*syms),
sizeof(*syms), 0);
82 const uint8_t *src,
int use_pred)
97 for (slice = 0; slice < c->
slices; slice++) {
101 send = (height * (slice + 1) / c->
slices) & cmask;
102 dest = dst + sstart *
stride;
105 for (j = sstart; j < send; j++) {
106 for (i = 0; i < width * step; i += step) {
123 for (slice = 0; slice < c->
slices; slice++) {
125 int slice_data_start, slice_data_end, slice_size;
128 send = (height * (slice + 1) / c->
slices) & cmask;
129 dest = dst + sstart *
stride;
132 slice_data_start = slice ?
AV_RL32(src + slice * 4 - 4) : 0;
133 slice_data_end =
AV_RL32(src + slice * 4);
134 slice_size = slice_data_end - slice_data_start;
138 "yet a slice has a length of zero.\n");
146 (slice_data_end - slice_data_start + 3) >> 2);
150 for (j = sstart; j < send; j++) {
151 for (i = 0; i < width * step; i += step) {
154 "Slice decoding ran out of bits\n");
189 for (j = 0; j <
height; j++) {
190 for (i = 0; i < width * step; i += step) {
194 src[i] = r + g - 0x80;
195 src[i + 2] = b + g - 0x80;
207 int slice_start, slice_height;
208 const int cmask = ~rmode;
210 for (slice = 0; slice < slices; slice++) {
211 slice_start = ((slice *
height) / slices) & cmask;
212 slice_height = ((((slice + 1) * height) / slices) & cmask) -
215 bsrc = src + slice_start *
stride;
220 for (i = step; i < width * step; i += step) {
225 if (slice_height == 1)
231 for (i = step; i < width * step; i += step) {
239 for (j = 2; j < slice_height; j++) {
240 for (i = 0; i < width * step; i += step) {
261 int slice_start, slice_height;
262 const int cmask = ~(rmode ? 3 : 1);
263 const int stride2 = stride << 1;
265 for (slice = 0; slice < slices; slice++) {
266 slice_start = ((slice *
height) / slices) & cmask;
267 slice_height = ((((slice + 1) * height) / slices) & cmask) -
271 bsrc = src + slice_start *
stride;
276 for (i = step; i < width * step; i += step) {
280 for (i = 0; i < width * step; i += step) {
281 bsrc[stride + i] +=
A;
282 A = bsrc[stride + i];
285 if (slice_height == 1)
291 for (i = step; i < width * step; i += step) {
292 B = bsrc[i - stride2];
297 for (i = 0; i < width * step; i += step) {
301 A = bsrc[stride + i];
305 for (j = 2; j < slice_height; j++) {
306 for (i = 0; i < width * step; i += step) {
307 B = bsrc[i - stride2];
312 for (i = 0; i < width * step; i += step) {
327 int buf_size = avpkt->
size;
331 int plane_size, max_slice_size = 0, slice_start,
slice_end, slice_size;
347 for (i = 0; i < c->
planes; i++) {
348 plane_start[i] = gb.
buffer;
356 for (j = 0; j < c->
slices; j++) {
357 slice_end = bytestream2_get_le32u(&gb);
358 slice_size = slice_end - slice_start;
359 if (slice_end < 0 || slice_size < 0 ||
365 max_slice_size =
FFMAX(max_slice_size, slice_size);
396 for (i = 0; i < c->
planes; i++) {
399 avctx->
height, plane_start[i],
420 for (i = 0; i < 3; i++) {
441 for (i = 0; i < 3; i++) {
483 "Insufficient extradata size %d, should be at least 16\n",
506 case MKTAG(
'U',
'L',
'R',
'G'):
510 case MKTAG(
'U',
'L',
'R',
'A'):
514 case MKTAG(
'U',
'L',
'Y',
'0'):
518 case MKTAG(
'U',
'L',
'Y',
'2'):