63 12, 12, 15, 19, 25, 34, 40, 48,
64 12, 12, 18, 22, 27, 44, 47, 46,
65 17, 18, 21, 26, 35, 46, 52, 47,
66 18, 20, 24, 28, 40, 61, 59, 51,
67 20, 24, 32, 43, 50, 72, 72, 63,
68 25, 31, 42, 48, 58, 72, 81, 75,
69 38, 46, 54, 61, 71, 84, 88, 85,
70 50, 61, 65, 68, 79, 78, 86, 91,
74 12, 16, 24, 47, 99, 99, 99, 99,
75 16, 21, 26, 66, 99, 99, 99, 99,
76 24, 26, 56, 99, 99, 99, 99, 99,
77 47, 66, 99, 99, 99, 99, 99, 99,
78 99, 99, 99, 99, 99, 99, 99, 99,
79 99, 99, 99, 99, 99, 99, 99, 99,
80 99, 99, 99, 99, 99, 99, 99, 99,
81 99, 99, 99, 99, 99, 99, 99, 99,
85 0, 1, 8, 9, 16, 2, 3, 10,
86 17, 24, 32, 25, 18, 11, 4, 5,
87 12, 19, 26, 33, 40, 48, 41, 34,
88 27, 20, 13, 6, 7, 14, 21, 28,
89 35, 42, 49, 56, 57, 50, 43, 36,
90 29, 22, 15, 23, 30, 37, 44, 51,
91 58, 59, 52, 45, 38, 31, 39, 46,
92 53, 60, 61, 54, 47, 55, 62, 63,
99 for (
int i = 0;
i < 64;
i++) {
100 table[
i] = av_clip((quant_tab[
i] *
factor + 0x32) / 100, 1, 0x7fff);
111 const unsigned t4 =
t0 +
t2;
112 const unsigned t5 =
t0 -
t2;
113 const unsigned t6 =
t1 +
t3;
114 const unsigned t7 =
t1 -
t3;
119 const unsigned tC =
t8 + tA;
120 const unsigned tD = (
int)((tB +
t9) * 473
U) >> 8;
121 const unsigned tE = (((
int)(
t9 * -669
U) >> 8) - tC) + tD;
122 const unsigned tF = ((
int)((tA -
t8) * 362
U) >> 8) - tE;
123 const unsigned t10 = (((
int)(tB * 277
U) >> 8) - tD) + tF;
137 for (
int i = 0;
i < 8;
i++) {
157 for (
int i = 0;
i < 8;
i++) {
159 for (
int j = 0; j < 8; j++)
160 dst[j] = av_clip_uint8((
block[j] >> 5) + 128);
169 for (
int i = 0;
i < 8;
i++) {
189 for (
int i = 0;
i < 8;
i++) {
191 for (
int j = 0; j < 8; j++)
192 dst[j] = av_clip_uint8((
block[j] >> 5) +
src[j]);
203 const unsigned int t2 = (
int)(
t1 * 473
U) >> 8;
204 const unsigned int t3 =
t2 -
t1;
205 const unsigned int t4 = ((
int)(
t1 * 362
U) >> 8) -
t3;
206 const unsigned int t5 = (((
int)(
t1 * 277
U) >> 8) -
t2) +
t4;
220 for (
int i = 0;
i < 2;
i++) {
221 if ((
block[0x08 +
i]) == 0) {
234 for (
int i = 0;
i < 8;
i++) {
236 for (
int j = 0; j < 8; j++)
237 dst[j] = av_clip_uint8((
block[0] >> 5) + 128);
240 for (
int j = 0; j < 8; j++)
241 dst[j] = av_clip_uint8((
block[j] >> 5) + 128);
252 for (
int i = 0;
i < 2;
i++) {
253 if ((
block[0x08 +
i]) == 0) {
266 for (
int i = 0;
i < 8;
i++) {
268 for (
int j = 0; j < 8; j++)
269 dst[j] = av_clip_uint8((
block[0] >> 5) +
src[j]);
272 for (
int j = 0; j < 8; j++)
273 dst[j] = av_clip_uint8((
block[j] >> 5) +
src[j]);
285 for (
int i = 0;
i < 8;
i++) {
286 for (
int j = 0; j < 8; j++)
287 dst[j] = av_clip_uint8(
block +
src[j]);
295 int *
block,
int *pfill,
303 s->bdsp.fill_block_tab[1](dst, 128, linesize, 8);
308 block[0] = ((
int)((
unsigned)pfill[0] * qtab[0]) >> 5) + 128;
309 s->bdsp.fill_block_tab[1](dst,
block[0], linesize, 8);
315 block[0] = (unsigned)pfill[0] * qtab[0];
324 block[0] = (unsigned)pfill[0] * qtab[0];
325 for (
int i = 1;
i < 64;
i++)
336 int *
block,
int *pfill,
349 block[0] = (
int)((
unsigned)pfill[0] * qtab[0]) >> 5;
356 block[0] = (unsigned)pfill[0] * qtab[0];
365 block[0] = (unsigned)pfill[0] * qtab[0];
366 for (
int i = 1;
i < 64;
i++)
377 memset(coeffs, 0, nb_codes *
sizeof(*coeffs));
379 for (
int i = 0;
i < nb_codes;) {
388 if (x < (1 <<
value) / 2) {
389 x = (1 << (
value - 1)) + (x & ((1 <<
value) - 1 >> 1));
391 x = -(1 << (
value - 1)) - (x & ((1 <<
value) - 1 >> 1));
418 linesize[0] =
frame->linesize[0];
419 linesize[1] =
frame->linesize[0];
420 linesize[2] =
frame->linesize[0];
421 linesize[3] =
frame->linesize[0];
422 linesize[4] =
frame->linesize[1];
423 linesize[5] =
frame->linesize[2];
425 for (
int y = 0; y < avctx->
height; y += 16) {
427 int pfill[3][1] = { {0} };
439 for (
int x = 0; x < avctx->
width; x += 16) {
440 dst[0] =
frame->data[0] + linesize[0] * y + x;
441 dst[1] =
frame->data[0] + linesize[0] * y + x + 8;
442 dst[2] =
frame->data[0] + linesize[0] * (y + 8) + x;
443 dst[3] =
frame->data[0] + linesize[0] * (y + 8) + x + 8;
444 dst[4] =
frame->data[1] + linesize[4] * (y >> 1) + (x >> 1);
445 dst[5] =
frame->data[2] + linesize[5] * (y >> 1) + (x >> 1);
447 for (
int b = 0;
b < 6;
b++) {
452 pfill[(
b >= 4) + (
b >= 5)],
453 dst[
b], linesize[
b]);
470 const int mask_size = ((avctx->
height >> 4) * (avctx->
width >> 4) * 2 + 7) / 8;
484 linesize[0] =
frame->linesize[0];
485 linesize[1] =
frame->linesize[0];
486 linesize[2] =
frame->linesize[0];
487 linesize[3] =
frame->linesize[0];
488 linesize[4] =
frame->linesize[1];
489 linesize[5] =
frame->linesize[2];
508 for (
int y = 0; y < avctx->
height; y += 16) {
510 int pfill[3][1] = { {0} };
531 for (
int x = 0; x < avctx->
width; x += 16) {
542 dst[0] =
frame->data[0] + linesize[0] * y + x;
543 dst[1] =
frame->data[0] + linesize[0] * y + x + 8;
544 dst[2] =
frame->data[0] + linesize[0] * (y + 8) + x;
545 dst[3] =
frame->data[0] + linesize[0] * (y + 8) + x + 8;
546 dst[4] =
frame->data[1] + linesize[4] * (y >> 1) + (x >> 1);
547 dst[5] =
frame->data[2] + linesize[5] * (y >> 1) + (x >> 1);
549 if ((
flags >> (cnt)) & 1) {
560 src[0] = prev->
data[0] + in_linesize[0] * py + px;
561 src[1] = prev->
data[0] + in_linesize[0] * py + px + 8;
562 src[2] = prev->
data[0] + in_linesize[0] * (py + 8) + px;
563 src[3] = prev->
data[0] + in_linesize[0] * (py + 8) + px + 8;
564 src[4] = prev->
data[1] + in_linesize[4] * (py >> 1) + (px >> 1);
565 src[5] = prev->
data[2] + in_linesize[5] * (py >> 1) + (px >> 1);
567 if ((
flags >> (cnt + 4)) & 1) {
568 for (
int b = 0;
b < 6;
b++)
571 for (
int b = 0;
b < 6;
b++) {
576 pfill[(
b >= 4) + (
b >= 5)],
578 src[
b], in_linesize[
b]);
584 for (
int b = 0;
b < 6;
b++) {
589 pfill[(
b >= 4) + (
b >= 5)],
590 dst[
b], linesize[
b]);
619 s->inter_quant =
s->intra_quant +
get_sbits(gb, 8);
628 frame->key_frame =
s->is_inter == 0;
630 if (
frame->key_frame) {
638 if (!
s->prev_frame->data[0]) {
658 0, 1, 4, 5, 6, 0xE, 0x1E, 0x3E, 0x7E, 0xFE, 0x1FE, 0x1FF,
662 2, 2, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9,
705 s->mvectors_size = 0;