42 return aa->
sym - bb->sym;
52 for (i = 0; i < 4; i++)
62 uint32_t original_format;
82 "4:2:0 video requires even width and height.\n");
90 if (avctx->
width & 1) {
92 "4:2:2 video requires even width.\n");
110 "Prediction method %d is not supported in Ut Video.\n",
117 "Plane prediction is not supported in Ut Video.\n");
149 for (i = 0; i < c->
planes; i++) {
205 int k = 2 * dst_stride;
208 for (j = 0; j <
height; j++) {
210 for (i = 0; i < width * step; i += step) {
214 dst[1][k] = src[i + 2] -
g;
215 dst[2][k] = src[i + 0] -
g;
219 for (i = 0; i < width * step; i += step) {
223 dst[1][k] = src[i + 2] -
g;
224 dst[2][k] = src[i + 0] -
g;
225 dst[3][k] = src[i + 3];
229 k += dst_stride -
width;
242 for (j = 0; j <
height; j++) {
243 for (i = 0; i <
width; i++) {
244 *dst++ = src[i] - prev;
261 for (i = 0; i <
width; i++) {
262 *dst++ = src[i] - prev;
278 for (j = 1; j <
height; j++) {
287 int height, uint64_t *counts)
291 for (j = 0; j <
height; j++) {
292 for (i = 0; i <
width; i++) {
308 while (he[last].
len == 255 && last)
312 for (i = last; i >= 0; i--) {
313 he[i].
code = code >> (32 - he[i].
len);
314 code += 0x80000000
u >> (he[i].
len - 1);
331 for (j = 0; j <
height; j++) {
332 for (i = 0; i <
width; i++)
359 uint64_t counts[256] = { 0 };
363 uint32_t
offset = 0, slice_len = 0;
364 int i, sstart, send = 0;
370 for (i = 0; i < c->
slices; i++) {
372 send = height * (i + 1) / c->
slices;
374 src + sstart * stride, stride,
375 width, send - sstart);
379 for (i = 0; i < c->
slices; i++) {
381 send = height * (i + 1) / c->
slices;
382 left_predict(src + sstart * stride, dst + sstart * width,
383 stride, width, send - sstart);
387 for (i = 0; i < c->
slices; i++) {
389 send = height * (i + 1) / c->
slices;
391 stride, width, send - sstart);
404 for (symbol = 0; symbol < 256; symbol++) {
406 if (counts[symbol]) {
408 if (counts[symbol] == width * (int64_t)height) {
413 for (i = 0; i < 256; i++) {
415 bytestream2_put_byte(pb, 0);
417 bytestream2_put_byte(pb, 0xFF);
421 for (i = 0; i < c->
slices; i++)
422 bytestream2_put_le32(pb, 0);
439 for (i = 0; i < 256; i++) {
440 bytestream2_put_byte(pb, lengths[i]);
442 he[i].
len = lengths[i];
450 for (i = 0; i < c->
slices; i++) {
452 send = height * (i + 1) / c->
slices;
459 width * (send - sstart),
width,
460 send - sstart, he) >> 3;
462 slice_len = offset - slice_len;
470 bytestream2_put_le32(pb, offset);
474 offset - slice_len, SEEK_CUR);
493 const AVFrame *pic,
int *got_packet)
533 for (i = 0; i < c->
planes; i++) {
545 for (i = 0; i < c->
planes; i++) {
547 pic->
linesize[i], width >> !!i, height, &pb);
556 for (i = 0; i < c->
planes; i++) {
558 pic->
linesize[i], width >> !!i, height >> !!i,
579 bytestream2_put_le32(&pb, frame_info);