40 for (i = 0; i < w; i++) {
41 const int temp = src[i];
47 for (i = 0; i < 16; i++) {
48 const int temp = src[i];
59 int *red,
int *green,
int *blue,
69 for (i = 0; i <
FFMIN(w, 4); i++) {
70 const int rt = src[i * 4 +
R];
71 const int gt = src[i * 4 +
G];
72 const int bt = src[i * 4 +
B];
73 const int at = src[i * 4 +
A];
74 dst[i * 4 +
R] = rt -
r;
75 dst[i * 4 +
G] = gt -
g;
76 dst[i * 4 +
B] = bt -
b;
77 dst[i * 4 +
A] = at -
a;
86 *red = src[(w - 1) * 4 +
R];
87 *green = src[(w - 1) * 4 +
G];
88 *blue = src[(w - 1) * 4 +
B];
89 *alpha = src[(w - 1) * 4 +
A];
94 int *red,
int *green,
int *blue)
101 for (i = 0; i <
FFMIN(w, 16); i++) {
102 const int rt = src[i * 3 + 0];
103 const int gt = src[i * 3 + 1];
104 const int bt = src[i * 3 + 2];
105 dst[i * 3 + 0] = rt -
r;
106 dst[i * 3 + 1] = gt -
g;
107 dst[i * 3 + 2] = bt -
b;
113 s->
dsp.
diff_bytes(dst + 48, src + 48, src + 48 - 3, w * 3 - 48);
115 *red = src[(w - 1) * 3 + 0];
116 *green = src[(w - 1) * 3 + 1];
117 *blue = src[(w - 1) * 3 + 2];
125 for (i = 0; i < 256;) {
129 for (; i < 256 && len[i] == val && repeat < 255; i++)
132 av_assert0(val < 32 && val >0 && repeat<256 && repeat>0);
135 buf[index++] = repeat;
137 buf[index++] = val | (repeat << 5);
193 "context=1 is not compatible with "
194 "2 pass huffyuv encoding\n");
202 "Error: YV12 is not supported by huffyuv; use "
203 "vcodec=ffvhuff or format=422p\n");
208 "Error: per-frame huffman tables are not supported "
209 "by huffyuv; use vcodec=ffvhuff\n");
214 "using huffyuv 2.2.0 or newer interlacing flag\n");
219 "Error: RGB is incompatible with median predictor\n");
234 for (i = 0; i < 3; i++)
235 for (j = 0; j < 256; j++)
239 for (i = 0; i < 3; i++) {
242 for (j = 0; j < 256; j++) {
243 s->
stats[i][j] += strtol(p, &next, 0);
244 if (next == p)
return -1;
248 if (p[0] == 0 || p[1] == 0 || p[2] == 0)
break;
251 for (i = 0; i < 3; i++)
252 for (j = 0; j < 256; j++) {
253 int d =
FFMIN(j, 256 - j);
255 s->
stats[i][j] = 100000000 / (d + 1);
259 for (i = 0; i < 3; i++) {
271 for (i = 0; i < 3; i++) {
273 for (j = 0; j < 256; j++) {
274 int d =
FFMIN(j, 256 - j);
275 s->
stats[i][j] = pels/(d + 1);
279 for (i = 0; i < 3; i++)
280 for (j = 0; j < 256; j++)
307 int y1 = y[2 * i + 1];\
314 for(i = 0; i <
count; i++) {
325 for (i = 0; i <
count; i++) {
337 for(i = 0; i <
count; i++) {
358 int y0 = s->temp[0][2 * i];\
359 int y1 = s->temp[0][2 * i + 1];
364 put_bits(&s->pb, s->len[0][y0], s->bits[0][y0]);\
365 put_bits(&s->pb, s->len[0][y1], s->bits[0][y1]);
370 for (i = 0; i <
count; i++) {
379 for (i = 0; i <
count; i++) {
385 for (i = 0; i <
count; i++) {
398 4 * planes * count) {
404 int g = s->temp[0][planes == 3 ? 3 * i + 1 : 4 * i + G]; \
405 int b =(s->temp[0][planes == 3 ? 3 * i + 2 : 4 * i + B] - g) & 0xFF;\
406 int r =(s->temp[0][planes == 3 ? 3 * i + 0 : 4 * i + R] - g) & 0xFF;\
407 int a = s->temp[0][planes * i + A];
417 put_bits(&s->pb, s->len[1][g], s->bits[1][g]); \
418 put_bits(&s->pb, s->len[0][b], s->bits[0][b]); \
419 put_bits(&s->pb, s->len[2][r], s->bits[2][r]); \
421 put_bits(&s->pb, s->len[2][a], s->bits[2][a]);
425 for (i = 0; i <
count; i++) {
430 for (i = 0; i <
count; i++) {
436 for (i = 0; i <
count; i++) {
445 const AVFrame *pict,
int *got_packet)
449 const int width2 = s->
width>>1;
454 const AVFrame *
const p = pict;
461 for (i = 0; i < 3; i++) {
468 for (i = 0; i < 3; i++)
469 for (j = 0; j < 256; j++)
470 s->
stats[i][j] >>= 1;
477 int lefty, leftu, leftv,
y, cy;
491 int lefttopy, lefttopu, lefttopv;
508 lefttopy = p->
data[0][3];
509 lefttopu = p->
data[1][1];
510 lefttopv = p->
data[2][1];
517 for (; y <
height; y++,cy++) {
527 if (y >= height)
break;
540 for (cy = y = 1; y <
height; y++, cy++) {
556 if (y >= height)
break;
583 const int fake_stride = -fake_ystride;
585 int leftr, leftg, leftb, lefta;
593 &leftr, &leftg, &leftb, &lefta);
601 &leftr, &leftg, &leftb, &lefta);
604 &leftr, &leftg, &leftb, &lefta);
611 const int fake_stride = -fake_ystride;
613 int leftr, leftg, leftb;
621 &leftr, &leftg, &leftb);
630 &leftr, &leftg, &leftb);
633 &leftr, &leftg, &leftb);
650 char *
end = p + 1024*30;
651 for (i = 0; i < 3; i++) {
652 for (j = 0; j < 256; j++) {
669 pkt->
size = size * 4;
690 #if CONFIG_HUFFYUV_ENCODER
707 #if CONFIG_FFVHUFF_ENCODER