41 return aa->
sym - bb->sym;
51 for (i = 0; i < 4; i++)
61 uint32_t original_format;
81 "4:2:0 video requires even width and height.\n");
89 if (avctx->
width & 1) {
91 "4:2:2 video requires even width.\n");
109 "Prediction method %d is not supported in Ut Video.\n",
116 "Plane prediction is not supported in Ut Video.\n");
148 for (i = 0; i < c->
planes; i++) {
204 int k = 2 * dst_stride;
207 for (j = 0; j <
height; j++) {
209 for (i = 0; i < width * step; i += step) {
213 dst[1][k] = src[i + 2] -
g;
214 dst[2][k] = src[i + 0] -
g;
218 for (i = 0; i < width * step; i += step) {
222 dst[1][k] = src[i + 2] -
g;
223 dst[2][k] = src[i + 0] -
g;
224 dst[3][k] = src[i + 3];
228 k += dst_stride -
width;
239 for (j = 0; j <
height; j++) {
240 for (i = 0; i <
width; i++)
255 for (j = 0; j <
height; j++) {
256 for (i = 0; i <
width; i++) {
257 *dst++ = src[i] - prev;
274 for (i = 0; i <
width; i++) {
275 *dst++ = src[i] - prev;
291 for (j = 1; j <
height; j++) {
300 int height, uint64_t *counts)
304 for (j = 0; j <
height; j++) {
305 for (i = 0; i <
width; i++) {
321 while (he[last].
len == 255 && last)
325 for (i = last; i >= 0; i--) {
326 he[i].
code = code >> (32 - he[i].
len);
327 code += 0x80000000
u >> (he[i].
len - 1);
344 for (j = 0; j <
height; j++) {
345 for (i = 0; i <
width; i++)
372 uint64_t counts[256] = { 0 };
376 uint32_t
offset = 0, slice_len = 0;
377 int i, sstart, send = 0;
383 for (i = 0; i < c->
slices; i++) {
385 send = height * (i + 1) / c->
slices;
386 write_plane(src + sstart * stride, dst + sstart * width,
387 stride, width, send - sstart);
391 for (i = 0; i < c->
slices; i++) {
393 send = height * (i + 1) / c->
slices;
394 left_predict(src + sstart * stride, dst + sstart * width,
395 stride, width, send - sstart);
399 for (i = 0; i < c->
slices; i++) {
401 send = height * (i + 1) / c->
slices;
403 stride, width, send - sstart);
416 for (symbol = 0; symbol < 256; symbol++) {
418 if (counts[symbol]) {
420 if (counts[symbol] == width * (int64_t)height) {
425 for (i = 0; i < 256; i++) {
427 bytestream2_put_byte(pb, 0);
429 bytestream2_put_byte(pb, 0xFF);
433 for (i = 0; i < c->
slices; i++)
434 bytestream2_put_le32(pb, 0);
451 for (i = 0; i < 256; i++) {
452 bytestream2_put_byte(pb, lengths[i]);
454 he[i].
len = lengths[i];
462 for (i = 0; i < c->
slices; i++) {
464 send = height * (i + 1) / c->
slices;
471 width * (send - sstart),
width,
472 send - sstart, he) >> 3;
474 slice_len = offset - slice_len;
482 bytestream2_put_le32(pb, offset);
486 offset - slice_len, SEEK_CUR);
505 const AVFrame *pic,
int *got_packet)
545 for (i = 0; i < c->
planes; i++) {
557 for (i = 0; i < c->
planes; i++) {
559 pic->
linesize[i], width >> !!i, height, &pb);
568 for (i = 0; i < c->
planes; i++) {
570 pic->
linesize[i], width >> !!i, height >> !!i,
591 bytestream2_put_le32(&pb, frame_info);