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,
int *
alpha)
67 for (i = 0; i <
FFMIN(w, 4); i++) {
68 const int rt = src[i * 4 +
R];
69 const int gt = src[i * 4 +
G];
70 const int bt = src[i * 4 +
B];
71 const int at = src[i * 4 +
A];
72 dst[i * 4 +
R] = rt -
r;
73 dst[i * 4 +
G] = gt -
g;
74 dst[i * 4 +
B] = bt -
b;
75 dst[i * 4 +
A] = at -
a;
84 *red = src[(w - 1) * 4 +
R];
85 *green = src[(w - 1) * 4 +
G];
86 *blue = src[(w - 1) * 4 +
B];
87 *alpha = src[(w - 1) * 4 +
A];
96 for (i = 0; i <
FFMIN(w,16); i++) {
97 const int rt = src[i*3 + 0];
98 const int gt = src[i*3 + 1];
99 const int bt = src[i*3 + 2];
100 dst[i*3 + 0] = rt -
r;
101 dst[i*3 + 1] = gt -
g;
102 dst[i*3 + 2] = bt -
b;
108 s->
dsp.
diff_bytes(dst + 48, src + 48, src + 48 - 3, w*3 - 48);
110 *red = src[(w - 1)*3 + 0];
111 *green = src[(w - 1)*3 + 1];
112 *blue = src[(w - 1)*3 + 2];
120 for (i = 0; i < 256;) {
124 for (; i < 256 && len[i] == val && repeat < 255; i++)
127 av_assert0(val < 32 && val >0 && repeat<256 && repeat>0);
130 buf[index++] = repeat;
132 buf[index++] = val | (repeat << 5);
183 "context=1 is not compatible with "
184 "2 pass huffyuv encoding\n");
192 "Error: YV12 is not supported by huffyuv; use "
193 "vcodec=ffvhuff or format=422p\n");
198 "Error: per-frame huffman tables are not supported "
199 "by huffyuv; use vcodec=ffvhuff\n");
204 "using huffyuv 2.2.0 or newer interlacing flag\n");
209 "Error: RGB is incompatible with median predictor\n");
224 for (i = 0; i < 3; i++)
225 for (j = 0; j < 256; j++)
229 for (i = 0; i < 3; i++) {
232 for (j = 0; j < 256; j++) {
233 s->
stats[i][j] += strtol(p, &next, 0);
234 if (next == p)
return -1;
238 if (p[0] == 0 || p[1] == 0 || p[2] == 0)
break;
241 for (i = 0; i < 3; i++)
242 for (j = 0; j < 256; j++) {
243 int d =
FFMIN(j, 256 - j);
245 s->
stats[i][j] = 100000000 / (d + 1);
249 for (i = 0; i < 3; i++) {
261 for (i = 0; i < 3; i++) {
263 for (j = 0; j < 256; j++) {
264 int d =
FFMIN(j, 256 - j);
265 s->
stats[i][j] = pels/(d + 1);
269 for (i = 0; i < 3; i++)
270 for (j = 0; j < 256; j++)
297 int y1 = y[2 * i + 1];\
304 for(i = 0; i <
count; i++) {
315 for (i = 0; i <
count; i++) {
327 for(i = 0; i <
count; i++) {
348 int y0 = s->temp[0][2 * i];\
349 int y1 = s->temp[0][2 * i + 1];
354 put_bits(&s->pb, s->len[0][y0], s->bits[0][y0]);\
355 put_bits(&s->pb, s->len[0][y1], s->bits[0][y1]);
360 for (i = 0; i <
count; i++) {
369 for (i = 0; i <
count; i++) {
375 for (i = 0; i <
count; i++) {
393 int g = s->temp[0][planes==3 ? 3*i + 1 : 4*i + G];\
394 int b = (s->temp[0][planes==3 ? 3*i + 2 : 4*i + B] - g) & 0xff;\
395 int r = (s->temp[0][planes==3 ? 3*i + 0 : 4*i + R] - g) & 0xff;\
396 int a = s->temp[0][planes*i + A];
401 if(planes==4) s->stats[2][a]++;
403 put_bits(&s->pb, s->len[1][g], s->bits[1][g]);\
404 put_bits(&s->pb, s->len[0][b], s->bits[0][b]);\
405 put_bits(&s->pb, s->len[2][r], s->bits[2][r]);\
406 if(planes==4) put_bits(&s->pb, s->len[2][a], s->bits[2][a]);
410 for (i = 0; i <
count; i++) {
415 for (i = 0; i <
count; i++) {
421 for (i = 0; i <
count; i++) {
430 const AVFrame *pict,
int *got_packet)
434 const int width2 = s->
width>>1;
450 for (i = 0; i < 3; i++) {
457 for (i = 0; i < 3; i++)
458 for (j = 0; j < 256; j++)
459 s->
stats[i][j] >>= 1;
466 int lefty, leftu, leftv,
y, cy;
480 int lefttopy, lefttopu, lefttopv;
497 lefttopy = p->
data[0][3];
498 lefttopu = p->
data[1][1];
499 lefttopv = p->
data[2][1];
506 for (; y <
height; y++,cy++) {
516 if (y >= height)
break;
529 for (cy = y = 1; y <
height; y++, cy++) {
545 if (y >= height)
break;
572 const int fake_stride = -fake_ystride;
574 int leftr, leftg, leftb, lefta;
597 const int fake_stride = -fake_ystride;
599 int leftr, leftg, leftb;
632 char *
end = p + 1024*30;
633 for (i = 0; i < 3; i++) {
634 for (j = 0; j < 256; j++) {
651 pkt->
size = size * 4;
670 #if CONFIG_HUFFYUV_ENCODER
686 #if CONFIG_FFVHUFF_ENCODER