38 #define MOBI_RL_VLC_BITS 12
39 #define MOBI_MV_VLC_BITS 6
43 0x00, 0x04, 0x01, 0x02, 0x05, 0x08, 0x0C, 0x09, 0x06, 0x03, 0x07, 0x0A,
44 0x0D, 0x0E, 0x0B, 0x0F
49 { 10, 13, 13, 10, 16, 10, 13, 13, 13, 13, 16, 10, 16, 13, 13, 16 },
50 { 11, 14, 14, 11, 18, 11, 14, 14, 14, 14, 18, 11, 18, 14, 14, 18 },
51 { 13, 16, 16, 13, 20, 13, 16, 16, 16, 16, 20, 13, 20, 16, 16, 20 },
52 { 14, 18, 18, 14, 23, 14, 18, 18, 18, 18, 23, 14, 23, 18, 18, 23 },
53 { 16, 20, 20, 16, 25, 16, 20, 20, 20, 20, 25, 16, 25, 20, 20, 25 },
54 { 18, 23, 23, 18, 29, 18, 23, 23, 23, 23, 29, 18, 29, 23, 23, 29 },
59 { 20, 19, 19, 25, 18, 25, 19, 24, 24, 19, 20, 18, 32, 18, 20, 19, 19, 24, 24, 19, 19, 25, 18, 25, 18, 25, 18, 25, 19, 24, 24, 19,
60 19, 24, 24, 19, 18, 32, 18, 20, 18, 32, 18, 24, 24, 19, 19, 24, 24, 18, 25, 18, 25, 18, 19, 24, 24, 19, 18, 32, 18, 24, 24, 18,},
61 { 22, 21, 21, 28, 19, 28, 21, 26, 26, 21, 22, 19, 35, 19, 22, 21, 21, 26, 26, 21, 21, 28, 19, 28, 19, 28, 19, 28, 21, 26, 26, 21,
62 21, 26, 26, 21, 19, 35, 19, 22, 19, 35, 19, 26, 26, 21, 21, 26, 26, 19, 28, 19, 28, 19, 21, 26, 26, 21, 19, 35, 19, 26, 26, 19,},
63 { 26, 24, 24, 33, 23, 33, 24, 31, 31, 24, 26, 23, 42, 23, 26, 24, 24, 31, 31, 24, 24, 33, 23, 33, 23, 33, 23, 33, 24, 31, 31, 24,
64 24, 31, 31, 24, 23, 42, 23, 26, 23, 42, 23, 31, 31, 24, 24, 31, 31, 23, 33, 23, 33, 23, 24, 31, 31, 24, 23, 42, 23, 31, 31, 23,},
65 { 28, 26, 26, 35, 25, 35, 26, 33, 33, 26, 28, 25, 45, 25, 28, 26, 26, 33, 33, 26, 26, 35, 25, 35, 25, 35, 25, 35, 26, 33, 33, 26,
66 26, 33, 33, 26, 25, 45, 25, 28, 25, 45, 25, 33, 33, 26, 26, 33, 33, 25, 35, 25, 35, 25, 26, 33, 33, 26, 25, 45, 25, 33, 33, 25,},
67 { 32, 30, 30, 40, 28, 40, 30, 38, 38, 30, 32, 28, 51, 28, 32, 30, 30, 38, 38, 30, 30, 40, 28, 40, 28, 40, 28, 40, 30, 38, 38, 30,
68 30, 38, 38, 30, 28, 51, 28, 32, 28, 51, 28, 38, 38, 30, 30, 38, 38, 28, 40, 28, 40, 28, 30, 38, 38, 30, 28, 51, 28, 38, 38, 28,},
69 { 36, 34, 34, 46, 32, 46, 34, 43, 43, 34, 36, 32, 58, 32, 36, 34, 34, 43, 43, 34, 34, 46, 32, 46, 32, 46, 32, 46, 34, 43, 43, 34,
70 34, 43, 43, 34, 32, 58, 32, 36, 32, 58, 32, 43, 43, 34, 34, 43, 43, 32, 46, 32, 46, 32, 34, 43, 43, 34, 32, 58, 32, 43, 43, 32,},
75 15, 0, 2, 1, 4, 8, 12, 3, 11, 13, 14, 7, 10, 5, 9, 6,
80 0, 4, 1, 8, 2, 12, 3, 5, 10, 15, 7, 13, 14, 11, 9, 6,
85 0x00, 0x1F, 0x3F, 0x0F, 0x08, 0x04, 0x02, 0x01, 0x0B, 0x0E, 0x1B, 0x0D,
86 0x03, 0x07, 0x0C, 0x17, 0x1D, 0x0A, 0x1E, 0x05, 0x10, 0x2F, 0x37, 0x3B,
87 0x13, 0x3D, 0x3E, 0x09, 0x1C, 0x06, 0x15, 0x1A, 0x33, 0x11, 0x12, 0x14,
88 0x18, 0x20, 0x3C, 0x35, 0x19, 0x16, 0x3A, 0x30, 0x31, 0x32, 0x27, 0x34,
89 0x2B, 0x2D, 0x39, 0x38, 0x23, 0x36, 0x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11, 12, 12, 12, 12, 12,
128 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 7, 10, 10, 9,
129 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
130 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
131 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6,
132 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, 2, 3, 4, 4,
136 0x0, 0x822, 0x803, 0xB, 0xA, 0xB81, 0xB61, 0xB41, 0xB21, 0x122,
137 0x102, 0xE2, 0xC2, 0xA2, 0x63, 0x43, 0x24, 0xC, 0x25, 0x2E1, 0x301,
138 0xBA1, 0xBC1, 0xBE1, 0xC01, 0x26, 0x44, 0x83, 0xA3, 0xC3, 0x142,
139 0x321, 0x341, 0xC21, 0xC41, 0xC61, 0xC81, 0xCA1, 0xCC1, 0xCE1, 0xD01,
140 0x0, 0x9, 0x8, 0xB01, 0xAE1, 0xAC1, 0xAA1, 0xA81, 0xA61, 0xA41, 0xA21,
141 0x802, 0x2C1, 0x2A1, 0x281, 0x261, 0x241, 0x221, 0x201, 0x1E1, 0x82,
142 0x62, 0x7, 0x6, 0xA01, 0x9E1, 0x9C1, 0x9A1, 0x981, 0x961, 0x941, 0x921,
143 0x1C1, 0x1A1, 0x42, 0x23, 0x5, 0x901, 0x8E1, 0x8C1, 0x8A1, 0x181, 0x161,
144 0x141, 0x4, 0x881, 0x861, 0x841, 0x821, 0x121, 0x101, 0xE1, 0xC1, 0x22,
145 0x3, 0xA1, 0x81, 0x61, 0x801, 0x1, 0x21, 0x41, 0x2,
149 0x0, 0x807, 0x806, 0x16, 0x15, 0x842, 0x823, 0x805, 0x1A1, 0xA3, 0x102, 0x83,
150 0x64, 0x44, 0x27, 0x14, 0x13, 0x17, 0x18, 0x28, 0x122, 0x862, 0x882, 0x9E1, 0xA01,
151 0x19, 0x1A, 0x1B, 0x29, 0xC3, 0x2A, 0x45, 0xE3, 0x1C1, 0x808, 0x8A2, 0x8C2, 0xA21,
152 0xA41, 0xA61, 0xA81, 0x0, 0x12, 0x11, 0x9C1, 0x9A1, 0x981, 0x961, 0x941, 0x822, 0x804,
153 0x181, 0x161, 0xE2, 0xC2, 0xA2, 0x63, 0x43, 0x26, 0x25, 0x10, 0x82, 0xF, 0xE, 0xD, 0x901,
154 0x8E1, 0x8C1, 0x803, 0x141, 0x121, 0x101, 0x921, 0x62, 0x24, 0xC, 0xB, 0xA, 0x881, 0x861,
155 0xC1, 0x8A1, 0xE1, 0x42, 0x23, 0x9, 0x802, 0xA1, 0x841, 0x821, 0x81, 0x61, 0x8, 0x7, 0x22,
156 0x6, 0x41, 0x5, 0x4, 0x801, 0x1, 0x2, 0x21, 0x3,
161 10, 8, 8, 7, 8, 8, 8, 7, 8, 8, 8, 7, 7, 7, 7, 6,
167 { 2, 3, 3, 5, 5, 4, 4, 5, 5, 2 },
168 { 2, 3, 4, 4, 3, 4, 4, 2 },
169 { 3, 4, 4, 2, 4, 4, 3, 2 },
170 { 1, 3, 4, 5, 5, 3, 3 },
171 { 2, 4, 4, 3, 3, 4, 4, 2 },
172 { 2, 3, 4, 4, 4, 4, 3, 2 },
173 { 2, 3, 4, 4, 4, 4, 3, 2 },
174 { 2, 2, 3, 4, 5, 5, 2 },
175 { 2, 3, 4, 4, 3, 4, 4, 2 },
176 { 2, 4, 4, 3, 4, 4, 3, 2 },
177 { 2, 3, 3, 5, 5, 4, 3, 2 },
178 { 2, 3, 4, 4, 3, 3, 2 },
179 { 1, 4, 4, 3, 3, 4, 4 },
180 { 2, 3, 4, 4, 3, 3, 2 },
181 { 2, 3, 4, 4, 3, 3, 2 },
182 { 3, 3, 2, 2, 3, 3 },
185 { 3, 4, 5, 5, 3, 5, 6, 6, 4, 1 },
186 { 2, 3, 4, 5, 5, 2, 3, 3 },
187 { 2, 4, 4, 3, 3, 4, 4, 2 },
188 { 1, 4, 4, 3, 4, 4, 3 },
189 { 3, 3, 2, 4, 5, 5, 3, 2 },
190 { 3, 4, 4, 3, 3, 3, 3, 2 },
191 { 1, 3, 3, 4, 4, 4, 5, 5 },
192 { 1, 4, 4, 3, 3, 4, 4 },
193 { 2, 4, 4, 3, 3, 4, 4, 2 },
194 { 1, 3, 3, 4, 4, 4, 5, 5 },
195 { 2, 3, 4, 4, 4, 4, 3, 2 },
196 { 2, 3, 3, 4, 4, 3, 2 },
197 { 1, 4, 4, 3, 3, 4, 4 },
198 { 1, 4, 4, 3, 3, 4, 4 },
199 { 2, 3, 3, 4, 4, 3, 2 },
200 { 2, 3, 3, 3, 3, 2 },
207 { 1, 8, 9, 4, 3, 2, 7, 5, 6, 0 },
208 { 0, 9, 5, 4, 2, 3, 8, 1 },
209 { 3, 9, 5, 0, 4, 8, 2, 1 },
210 { 1, 3, 4, 8, 5, 2, 0 },
211 { 0, 5, 4, 8, 2, 3, 9, 1 },
212 { 0, 3, 5, 9, 4, 8, 2, 1 },
213 { 0, 3, 9, 5, 8, 4, 2, 1 },
214 { 0, 2, 3, 4, 8, 5, 1 },
215 { 0, 3, 8, 4, 2, 5, 9, 1 },
216 { 2, 8, 9, 3, 5, 4, 0, 1 },
217 { 0, 4, 3, 8, 9, 5, 2, 1 },
218 { 0, 4, 8, 5, 3, 2, 1 },
219 { 1, 9, 4, 2, 0, 5, 3 },
220 { 2, 4, 9, 5, 3, 0, 1 },
221 { 0, 4, 9, 5, 3, 2, 1 },
222 { 5, 4, 1, 0, 3, 2 },
225 { 8, 2, 3, 6, 1, 7, 5, 4, 9, 0 },
226 { 9, 2, 3, 5, 4, 1, 8, 0 },
227 { 0, 5, 4, 2, 9, 3, 8, 1 },
228 { 1, 5, 4, 2, 8, 3, 0 },
229 { 2, 9, 8, 3, 5, 4, 0, 1 },
230 { 3, 5, 4, 2, 9, 8, 0, 1 },
231 { 1, 2, 0, 9, 8, 3, 5, 4 },
232 { 1, 8, 5, 2, 0, 4, 3 },
233 { 0, 5, 4, 2, 8, 3, 9, 1 },
234 { 1, 2, 0, 9, 8, 3, 5, 4 },
235 { 0, 3, 9, 8, 5, 4, 2, 1 },
236 { 0, 4, 3, 8, 5, 2, 1 },
237 { 1, 5, 4, 2, 0, 9, 3 },
238 { 1, 9, 5, 2, 0, 4, 3 },
239 { 0, 5, 3, 9, 4, 2, 1 },
240 { 0, 4, 5, 3, 2, 1 },
286 for (
int i = 0;
i < 2;
i++) {
292 for (
int j = 0; j < 16; j++) {
321 for (
int i = 0;
i < 6;
i++) {
337 if (quantizer < 12 || quantizer > 161)
340 s->quantizer = quantizer;
345 for (
int i = 0;
i < 16;
i++)
348 for (
int i = 0;
i < 64;
i++)
351 for (
int i = 0;
i < 20;
i++)
359 unsigned a = rs[0] + rs[2];
360 unsigned b = rs[0] - rs[2];
361 unsigned c = rs[1] + ((int)rs[3] >> 1);
362 unsigned d = ((int)rs[1] >> 1) - rs[3];
373 unsigned x3, x2, x1, x0;
388 e = (unsigned)arr[7] + arr[1] - arr[3] - (arr[3] >> 1);
389 f = (unsigned)arr[7] - arr[1] + arr[5] + (arr[5] >> 1);
390 g = (unsigned)arr[5] - arr[3] - arr[7] - (arr[7] >> 1);
391 h = (unsigned)arr[5] + arr[3] + arr[1] + (arr[1] >> 1);
392 x3 = (unsigned)
g + (
h >> 2);
393 x2 = (unsigned)e + (
f >> 2);
394 x1 = (e >> 2) - (
unsigned)
f;
395 x0 = (unsigned)
h - (
g >> 2);
397 arr[0] =
tmp[0] + x0;
398 arr[1] =
tmp[1] + x1;
399 arr[2] =
tmp[2] + x2;
400 arr[3] =
tmp[3] + x3;
401 arr[4] =
tmp[3] - x3;
402 arr[5] =
tmp[2] - x2;
403 arr[6] =
tmp[1] - x1;
404 arr[7] =
tmp[0] - x0;
414 *last = (n >> 11) == 1;
415 *
run = (n >> 5) & 0x3F;
420 int bx,
int by,
int size,
int plane)
426 const int *qtab =
s->qtab[
size == 8];
427 uint8_t *
dst =
frame->data[plane] + by *
frame->linesize[plane] + bx;
457 mat[ztab[
pos]] = qval *(unsigned)
level;
464 for (
int y = 0; y <
size; y++)
467 for (
int y = 0; y <
size; y++) {
468 for (
int x = y + 1; x <
size; x++) {
469 int a = mat[x *
size + y];
470 int b = mat[y *
size + x];
472 mat[y *
size + x] =
a;
473 mat[x *
size + y] =
b;
477 for (
int x = 0; x <
size; x++)
486 int bx,
int by,
int size,
int plane)
497 for (
int y = by; y < by + 8; y += 4) {
498 for (
int x = bx; x < bx + 8; x += 4) {
515 return size == 16 ? (x + 1) >> 1 : x;
523 if (
b.x == -1 &&
b.y >=
b.size) {
524 ret.x = -1,
ret.y =
b.size - 1;
525 }
else if (
b.x >= -1 &&
b.y >= -1) {
527 }
else if (
b.x == -1 &&
b.y == -2) {
529 }
else if (
b.x == -2 &&
b.y == -1) {
536 return ret.block[y *
ret.linesize + x];
541 return ((
a +
b) + 1) / 2;
546 return ((
a +
b +
b +
c) * 2 / 4 + 1) / 2;
587 if ((bxy.
x % 2) == 0) {
593 ba.
y = bxy.
y + bxy.
x / 2;
598 bb.
y = bxy.
y + bxy.
x / 2 + 1;
607 ba.
y = bxy.
y + bxy.
x / 2 + 1;
628 }
else if (bxy.
y == 0) {
635 }
else if (bxy.
x == 1) {
668 }
else if (bxy.
x == 0) {
675 }
else if (bxy.
y == 1) {
723 return half3(acc1, clr, acc2);
744 }
else if (bxy.
y == 1) {
749 }
else if (bxy.
x < bxy.
size - 1) {
754 }
else if (bxy.
y % 2 == 0) {
757 ba.
x = bxy.
y / 2 + bxy.
size - 1;
761 bb.
x = bxy.
y / 2 + bxy.
size;
768 ba.
x = bxy.
y / 2 + bxy.
size;
779 for (
int y = 0; y <
size; y++) {
786 int w,
int h,
int ax,
int ay,
799 for (
int y = 0; y <
size; y++) {
801 for (
int x = 0; x <
size; x++) {
808 block[ax + x + (ay + y) * linesize] =
val;
817 for (
int y = 0; y <
h; y++) {
818 for (
int x = 0; x <
w; x++) {
828 int pmode,
int add_coeffs,
int size,
int plane)
832 int w = avctx->
width >> !!plane,
h = avctx->
height >> !!plane;
846 uint8_t *top =
frame->data[plane] +
FFMAX(ay - 1, 0) *
frame->linesize[plane] + ax;
848 int bottommost =
frame->data[plane][(ay +
size - 1) *
frame->linesize[plane] +
FFMAX(ax - 1, 0)];
849 int rightmost =
frame->data[plane][
FFMAX(ay - 1, 0) *
frame->linesize[plane] + ax +
size - 1];
856 for (
int x = 0; x <
size; x++) {
861 for (
int y = 0; y <
size; y++) {
867 for (
int y = 0; y <
size; y++) {
868 for (
int x = 0; x <
size; x++) {
869 block[x] = (((top[x] +
left[0] + ((arr1[x] * (y + 1) +
870 arr2[y] * (x + 1)) >> 2 *
shift)) + 1) / 2) & 0xFF;
881 if (ax == 0 && ay == 0) {
883 }
else if (ax >= 1 && ay >= 1) {
889 fill = ((
left + top) * 2 / (2 *
size) + 1) / 2;
890 }
else if (ax >= 1) {
893 }
else if (ay >= 1) {
931 int index = (y & 0xC) | (x / 4 % 4);
939 val = x + (x >=
val ? 1 : 0);
950 int x,
int y,
int pmode,
int has_coeffs,
int plane)
973 for (
int by = y; by < y + 8; by += 4) {
974 for (
int bx = x; bx < x + 8; bx += 4) {
975 int new_pmode = pmode;
1049 if (pmode_uv == 2) {
1072 return x == 16 ? 0 : x == 8 ? 1 : x == 4 ? 2 : x == 2 ? 3 : 0;
1077 int offsetm,
int offsetx,
int offsety)
1082 int fheight = avctx->
height;
1083 int fwidth = avctx->
width;
1096 if (
mv.x >= INT_MAX ||
mv.y >= INT_MAX)
1099 motion[offsetm].
x =
mv.x;
1100 motion[offsetm].
y =
mv.y;
1102 for (
int i = 0;
i < 3;
i++) {
1103 int method, src_linesize, dst_linesize;
1107 offsetx = offsetx >> 1;
1108 offsety = offsety >> 1;
1113 fwidth = fwidth >> 1;
1114 fheight = fheight >> 1;
1120 if (!
s->pic[sidx]->data[
i])
1123 method = (
mv.x & 1) | ((
mv.y & 1) << 1);
1124 src_linesize =
s->pic[sidx]->linesize[
i];
1125 dst_linesize =
s->pic[
s->current_pic]->linesize[
i];
1126 dst =
s->pic[
s->current_pic]->data[
i] + offsetx + offsety * dst_linesize;
1128 if (offsetx + (
mv.x >> 1) < 0 ||
1129 offsety + (
mv.y >> 1) < 0 ||
1130 offsetx +
width + (
mv.x + 1 >> 1) > fwidth ||
1131 offsety +
height + (
mv.y + 1 >> 1) > fheight)
1136 src =
s->pic[sidx]->data[
i] + offsetx + (
mv.x >> 1) +
1137 (offsety + (
mv.y >> 1)) * src_linesize;
1138 for (
int y = 0; y <
height; y++) {
1139 for (
int x = 0; x <
width; x++)
1141 dst += dst_linesize;
1142 src += src_linesize;
1146 src =
s->pic[sidx]->data[
i] + offsetx + (
mv.x >> 1) +
1147 (offsety + (
mv.y >> 1)) * src_linesize;
1148 for (
int y = 0; y <
height; y++) {
1149 for (
int x = 0; x <
width; x++) {
1150 dst[x] = (uint8_t)((
src[x] >> 1) + (
src[x + 1] >> 1));
1153 dst += dst_linesize;
1154 src += src_linesize;
1158 src =
s->pic[sidx]->data[
i] + offsetx + (
mv.x >> 1) +
1159 (offsety + (
mv.y >> 1)) * src_linesize;
1160 for (
int y = 0; y <
height; y++) {
1161 for (
int x = 0; x <
width; x++) {
1162 dst[x] = (uint8_t)((
src[x] >> 1) + (
src[x + src_linesize] >> 1));
1165 dst += dst_linesize;
1166 src += src_linesize;
1170 src =
s->pic[sidx]->data[
i] + offsetx + (
mv.x >> 1) +
1171 (offsety + (
mv.y >> 1)) * src_linesize;
1172 for (
int y = 0; y <
height; y++) {
1173 for (
int x = 0; x <
width; x++) {
1174 dst[x] = (uint8_t)((((
src[x] >> 1) + (
src[x + 1] >> 1)) >> 1) +
1175 (((
src[x + src_linesize] >> 1) + (
src[x + 1 + src_linesize] >> 1)) >> 1));
1178 dst += dst_linesize;
1179 src += src_linesize;
1193 for (
int i = 0;
i < 2;
i++) {
1199 offsetm, offsetx +
i * adjx, offsety +
i * adjy);
1225 s->bdsp.bswap16_buf((uint16_t *)
s->bitstream,
1243 for (
int y = 0; y < avctx->
height; y += 16) {
1244 for (
int x = 0; x < avctx->
width; x += 16) {
1253 memset(motion, 0,
s->motion_size);
1263 for (
int y = 0; y < avctx->
height; y += 16) {
1264 for (
int x = 0; x < avctx->
width; x += 16) {
1267 motion[0].
x =
mid_pred(motion[x / 16 + 1].x, motion[x / 16 + 2].x, motion[x / 16 + 3].x);
1268 motion[0].
y =
mid_pred(motion[x / 16 + 1].y, motion[x / 16 + 2].y, motion[x / 16 + 3].y);
1269 motion[x / 16 + 2].
x = 0;
1270 motion[x / 16 + 2].
y = 0;
1274 if (idx == 6 || idx == 7) {
1288 for (
int sy = y; sy < y + 16; sy += 8) {
1289 for (
int sx = x; sx < x + 16; sx += 8) {
1309 s->current_pic = (
s->current_pic + 1) % 6;
1322 for (
int i = 0;
i < 6;
i++)
1331 s->bitstream_size = 0;
1335 for (
int i = 0;
i < 6;
i++) {
1343 .
p.
name =
"mobiclip",