35 { 16, 16 }, { 16, 8 }, { 8, 16 }, { 8, 8 }, { 8, 4 }, { 4, 8 },
36 { 4, 4 }, { 4, 2 }, { 2, 4 }, { 2, 2 }, { 2, 1 }, { 1, 2 }, { 1, 1 },
38 { 8, 8 }, { 8, 4 }, { 4, 8 }, { 4, 4 }, { 4, 2 }, { 2, 4 },
39 { 2, 2 }, { 2, 1 }, { 1, 2 }, { 1, 1 }, { 1, 1 }, { 1, 1 }, { 1, 1 },
47 0x0, 0x8, 0x0, 0x8, 0xc, 0x8, 0xc, 0xe, 0xc, 0xe, 0xf, 0xe, 0xf
50 0x0, 0x0, 0x8, 0x8, 0x8, 0xc, 0xc, 0xc, 0xe, 0xe, 0xe, 0xf, 0xf
56 int row = b->
row, col = b->
col, row7 = b->
row7;
57 enum TxfmMode max_tx = max_tx_for_bl_bp[b->
bs];
80 for (y = 0; y < h4; y++)
81 for (x = 0; x < w4; x++)
83 refsegmap[(y + row) * 8 * s->
sb_cols + x + col]);
98 for (y = 0; y < h4; y++)
99 memset(&segmap[(y + row) * 8 * s->
sb_cols + col],
118 if (have_a && have_l) {
230 }
else if (b->
intra) {
259 static const uint8_t size_group[10] = {
260 3, 3, 3, 3, 2, 2, 2, 1, 1, 1
262 int sz = size_group[b->
bs];
275 static const uint8_t inter_mode_ctx_lut[14][14] = {
276 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
277 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
278 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
279 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
280 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
281 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
282 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
283 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
284 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
285 { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
286 { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 1, 3 },
287 { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 1, 3 },
288 { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 0, 3 },
289 { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 4 },
355 if (refl == refa && refa == s->
varcompref[1]) {
362 c = (refa == refl) ? 3 : 1;
379 c = (refl == refa) ? 4 : 2;
543 static const uint8_t off[10] = {
544 3, 0, 0, 1, 0, 0, 0, 0, 0, 0
671 for (n = 0; n < w4 * 2; n++) {
675 for (n = 0; n < h4 * 2; n++) {
691 for (y = 0; y < h4; y++) {
692 int x, o = (row + y) * s->
sb_cols * 8 + col;
696 for (x = 0; x < w4; x++) {
700 }
else if (b->
comp) {
701 for (x = 0; x < w4; x++) {
702 mv[x].ref[0] = b->
ref[0];
703 mv[x].ref[1] = b->
ref[1];
708 for (x = 0; x < w4; x++) {
709 mv[x].ref[0] = b->
ref[0];
719 enum TxfmMode tx,
unsigned (*cnt)[6][3],
720 unsigned (*eob)[6][2],
uint8_t(*p)[6][11],
721 int nnz,
const int16_t *scan,
722 const int16_t(*nb)[2],
723 const int16_t *band_counts,
const int16_t *qmul)
725 int i = 0, band = 0, band_left = band_counts[band];
733 eob[band][nnz][val]++;
741 band_left = band_counts[++band];
743 nnz = (1 + cache[nb[i][0]] + cache[nb[i][1]]) >> 1;
814 band_left = band_counts[++band];
816 coef[rc] = ((
vp8_rac_get(c) ? -val : val) * qmul[!!i]) / 2;
818 coef[rc] = (
vp8_rac_get(c) ? -val : val) * qmul[!!i];
819 nnz = (1 + cache[nb[i][0]] + cache[nb[i][1]]) >> 1;
821 }
while (++i < n_coeffs);
830 int row = b->
row, col = b->
col;
835 int end_x =
FFMIN(2 * (s->
cols - col), w4);
836 int end_y =
FFMIN(2 * (s->
rows - row), h4);
837 int n, pl, x, y, step1d = 1 << b->tx,
step = 1 << (b->tx * 2);
838 int uvstep1d = 1 << b->
uvtx, uvstep = 1 << (b->
uvtx * 2), ret;
847 static const int16_t band_counts[4][8] = {
848 { 1, 2, 3, 4, 3, 16 - 13, 0 },
849 { 1, 2, 3, 4, 11, 64 - 21, 0 },
850 { 1, 2, 3, 4, 11, 256 - 21, 0 },
851 { 1, 2, 3, 4, 11, 1024 - 21, 0 },
853 const int16_t *y_band_counts = band_counts[b->tx];
854 const int16_t *uv_band_counts = band_counts[b->
uvtx];
858 for (y = 0; y < end_y; y += step1d)
859 for (x = 1; x < step1d; x++)
861 for (x = 0; x < end_x; x += step1d)
862 for (y = 1; y < step1d; y++)
865 for (n = 0, y = 0; y < end_y; y += step1d) {
866 for (x = 0; x < end_x; x += step1d, n +=
step) {
870 int nnz = a[x] + l[y];
872 b->tx, c, e, p, nnz, yscans[txtp],
873 ynbs[txtp], y_band_counts,
884 for (y = 0; y < end_y; y += step1d)
885 memset(&l[y + 1], l[y],
FFMIN(end_y - y - 1, step1d - 1));
886 for (x = 0; x < end_x; x += step1d)
887 memset(&a[x + 1], a[x],
FFMIN(end_x - x - 1, step1d - 1));
897 for (pl = 0; pl < 2; pl++) {
901 for (y = 0; y < end_y; y += uvstep1d)
902 for (x = 1; x < uvstep1d; x++)
904 for (x = 0; x < end_x; x += uvstep1d)
905 for (y = 1; y < uvstep1d; y++)
908 for (n = 0, y = 0; y < end_y; y += uvstep1d) {
909 for (x = 0; x < end_x; x += uvstep1d, n += uvstep) {
910 int nnz = a[x] + l[y];
912 16 * uvstep, b->
uvtx, c, e, p,
914 uv_band_counts, qmul[1])) < 0)
920 s->
uveob[pl][n] = ret;
924 for (y = 0; y < end_y; y += uvstep1d)
925 memset(&l[y + 1], l[y],
FFMIN(end_y - y - 1, uvstep1d - 1));
926 for (x = 0; x < end_x; x += uvstep1d)
927 memset(&a[x + 1], a[x],
FFMIN(end_x - x - 1, uvstep1d - 1));
937 ptrdiff_t stride_edge,
939 ptrdiff_t stride_inner,
940 uint8_t *l,
int col,
int x,
int w,
944 int have_top = row > 0 || y > 0;
946 int have_right = x < w - 1;
947 static const uint8_t mode_conv[10][2 ][2 ] = {
969 static const struct {
977 [
DC_PRED] = { .needs_top = 1, .needs_left = 1 },
980 .needs_topleft = 1 },
982 .needs_topleft = 1 },
984 .needs_topleft = 1 },
988 .needs_topleft = 1 },
997 mode = mode_conv[mode][have_left][have_top];
998 if (edges[mode].needs_top) {
1000 int n_px_need = 4 << tx, n_px_have = (((s->
cols - col) << !p) - x) * 4;
1001 int n_px_need_tr = 0;
1003 if (tx ==
TX_4X4 && edges[mode].needs_topright && have_right)
1010 top = !(row & 7) && !y ?
1012 y == 0 ? &dst_edge[-stride_edge] : &dst_inner[-stride_inner];
1014 topleft = !(row & 7) && !y ?
1016 y == 0 || x == 0 ? &dst_edge[-stride_edge] :
1017 &dst_inner[-stride_inner];
1021 (!edges[mode].needs_topleft || (have_left && top == topleft)) &&
1022 (tx !=
TX_4X4 || !edges[mode].needs_topright || have_right) &&
1023 n_px_need + n_px_need_tr <= n_px_have) {
1027 if (n_px_need <= n_px_have) {
1028 memcpy(*a, top, n_px_need);
1030 memcpy(*a, top, n_px_have);
1031 memset(&(*a)[n_px_have], (*a)[n_px_have - 1],
1032 n_px_need - n_px_have);
1035 memset(*a, 127, n_px_need);
1037 if (edges[mode].needs_topleft) {
1038 if (have_left && have_top)
1039 (*a)[-1] = topleft[-1];
1041 (*a)[-1] = have_top ? 129 : 127;
1043 if (tx ==
TX_4X4 && edges[mode].needs_topright) {
1044 if (have_top && have_right &&
1045 n_px_need + n_px_need_tr <= n_px_have) {
1046 memcpy(&(*a)[4], &top[4], 4);
1048 memset(&(*a)[4], (*a)[3], 4);
1053 if (edges[mode].needs_left) {
1056 int n_px_need = 4 << tx;
1057 int n_px_have = (((s->
rows - row) << !p) - y) * 4;
1058 uint8_t *dst = x == 0 ? dst_edge : dst_inner;
1059 ptrdiff_t
stride = x == 0 ? stride_edge : stride_inner;
1061 if (n_px_need <= n_px_have) {
1062 for (i = 0; i < n_px_need; i++)
1063 l[i] = dst[i * stride - 1];
1065 for (i = 0; i < n_px_have; i++)
1066 l[i] = dst[i * stride - 1];
1067 memset(&l[i], l[i - 1], n_px_need - n_px_have);
1070 memset(l, 129, 4 << tx);
1082 int row = b->
row, col = b->
col;
1083 int w4 =
bwh_tab[1][b->
bs][0] << 1, step1d = 1 << b->tx, n;
1084 int h4 =
bwh_tab[1][b->
bs][1] << 1, x, y,
step = 1 << (b->tx * 2);
1085 int end_x =
FFMIN(2 * (s->
cols - col), w4);
1086 int end_y =
FFMIN(2 * (s->
rows - row), h4);
1088 int uvstep1d = 1 << b->
uvtx, p;
1091 for (n = 0, y = 0; y < end_y; y += step1d) {
1092 uint8_t *ptr = dst, *ptr_r = dst_r;
1093 for (x = 0; x < end_x;
1094 x += step1d, ptr += 4 * step1d, ptr_r += 4 * step1d, n +=
step) {
1105 col, x, w4, row, y, b->tx, 0);
1109 s->
block + 16 * n, eob);
1111 dst_r += 4 * f->
linesize[0] * step1d;
1120 step = 1 << (b->
uvtx * 2);
1121 for (p = 0; p < 2; p++) {
1122 dst = b->
dst[1 + p];
1123 dst_r = f->
data[1 + p] + uv_off;
1124 for (n = 0, y = 0; y < end_y; y += uvstep1d) {
1125 uint8_t *ptr = dst, *ptr_r = dst_r;
1126 for (x = 0; x < end_x;
1127 x += uvstep1d, ptr += 4 * uvstep1d,
1128 ptr_r += 4 * uvstep1d, n +=
step) {
1138 col, x, w4, row, y, b->
uvtx, p + 1);
1145 dst_r += 4 * uvstep1d * f->
linesize[1];
1152 uint8_t *dst, ptrdiff_t dst_stride,
1154 ptrdiff_t ref_stride,
1156 ptrdiff_t y, ptrdiff_t x,
1158 int bw,
int bh,
int w,
int h)
1160 int mx = mv->
x, my = mv->
y;
1165 ref += y * ref_stride + x;
1171 th = (y + bh + 4 * !!my + 7) >> 6;
1175 if (x < !!mx * 3 || y < !!my * 3 ||
1176 x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
1178 ref - !!my * 3 * ref_stride - !!mx * 3,
1181 bw + !!mx * 7, bh + !!my * 7,
1182 x - !!mx * 3, y - !!my * 3, w, h);
1186 mc[!!mx][!!my](dst, ref, dst_stride, ref_stride, bh, mx << 1, my << 1);
1191 ptrdiff_t dst_stride,
1193 ptrdiff_t src_stride_u,
1195 ptrdiff_t src_stride_v,
1197 ptrdiff_t y, ptrdiff_t x,
1199 int bw,
int bh,
int w,
int h)
1201 int mx = mv->
x, my = mv->
y;
1206 ref_u += y * src_stride_u + x;
1207 ref_v += y * src_stride_v + x;
1213 th = (y + bh + 4 * !!my + 7) >> 5;
1217 if (x < !!mx * 3 || y < !!my * 3 ||
1218 x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
1220 ref_u - !!my * 3 * src_stride_u - !!mx * 3,
1223 bw + !!mx * 7, bh + !!my * 7,
1224 x - !!mx * 3, y - !!my * 3, w, h);
1226 mc[!!mx][!!my](dst_u, ref_u, dst_stride, 80, bh, mx, my);
1229 ref_v - !!my * 3 * src_stride_v - !!mx * 3,
1232 bw + !!mx * 7, bh + !!my * 7,
1233 x - !!mx * 3, y - !!my * 3, w, h);
1235 mc[!!mx][!!my](dst_v, ref_v, dst_stride, 80, bh, mx, my);
1237 mc[!!mx][!!my](dst_u, ref_u, dst_stride, src_stride_u, bh, mx, my);
1238 mc[!!mx][!!my](dst_v, ref_v, dst_stride, src_stride_v, bh, mx, my);
1245 { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
1246 { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 },
1250 int row = b->
row, col = b->
col;
1268 row << 3, col << 3, &b->
mv[0][0], 8, 4, w, h);
1270 b->
dst[0] + 4 * ls_y, ls_y,
1272 (row << 3) + 4, col << 3, &b->
mv[2][0], 8, 4, w, h);
1277 row << 3, col << 3, &b->
mv[0][1], 8, 4, w, h);
1279 b->
dst[0] + 4 * ls_y, ls_y,
1281 (row << 3) + 4, col << 3, &b->
mv[2][1], 8, 4, w, h);
1286 row << 3, col << 3, &b->
mv[0][0], 4, 8, w, h);
1289 row << 3, (col << 3) + 4, &b->
mv[1][0], 4, 8, w, h);
1294 row << 3, col << 3, &b->
mv[0][1], 4, 8, w, h);
1297 row << 3, (col << 3) + 4, &b->
mv[1][1], 4, 8, w, h);
1306 row << 3, col << 3, &b->
mv[0][0], 4, 4, w, h);
1309 row << 3, (col << 3) + 4, &b->
mv[1][0], 4, 4, w, h);
1311 b->
dst[0] + 4 * ls_y, ls_y,
1313 (row << 3) + 4, col << 3, &b->
mv[2][0], 4, 4, w, h);
1315 b->
dst[0] + 4 * ls_y + 4, ls_y,
1317 (row << 3) + 4, (col << 3) + 4, &b->
mv[3][0], 4, 4, w, h);
1322 row << 3, col << 3, &b->
mv[0][1], 4, 4, w, h);
1325 row << 3, (col << 3) + 4, &b->
mv[1][1], 4, 4, w, h);
1327 b->
dst[0] + 4 * ls_y, ls_y,
1329 (row << 3) + 4, col << 3, &b->
mv[2][1], 4, 4, w, h);
1331 b->
dst[0] + 4 * ls_y + 4, ls_y,
1333 (row << 3) + 4, (col << 3) + 4, &b->
mv[3][1], 4, 4, w, h);
1337 int bwl = bwlog_tab[0][b->
bs];
1343 row << 3, col << 3, &b->
mv[0][0], bw, bh, w, h);
1348 row << 3, col << 3, &b->
mv[0][1], bw, bh, w, h);
1353 int bwl = bwlog_tab[1][b->
bs];
1361 b->
mv[2][0].
x + b->
mv[3][0].
x, 4);
1363 b->
mv[2][0].
y + b->
mv[3][0].
y, 4);
1369 b->
dst[1], b->
dst[2], ls_uv,
1372 row << 2, col << 2, &mvuv, bw, bh, w, h);
1377 b->
mv[2][1].
x + b->
mv[3][1].
x, 4);
1379 b->
mv[2][1].
y + b->
mv[3][1].
y, 4);
1384 b->
dst[1], b->
dst[2], ls_uv,
1387 row << 2, col << 2, &mvuv, bw, bh, w, h);
1394 int w4 =
bwh_tab[1][b->
bs][0] << 1, step1d = 1 << b->tx, n;
1395 int h4 =
bwh_tab[1][b->
bs][1] << 1, x, y,
step = 1 << (b->tx * 2);
1396 int end_x =
FFMIN(2 * (s->
cols - col), w4);
1397 int end_y =
FFMIN(2 * (s->
rows - row), h4);
1399 int uvstep1d = 1 << b->
uvtx, p;
1403 for (n = 0, y = 0; y < end_y; y += step1d) {
1405 for (x = 0; x < end_x; x += step1d, ptr += 4 * step1d, n +=
step) {
1410 s->
block + 16 * n, eob);
1420 step = 1 << (b->
uvtx * 2);
1421 for (p = 0; p < 2; p++) {
1422 dst = b->
dst[p + 1];
1423 for (n = 0, y = 0; y < end_y; y += uvstep1d) {
1425 for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d, n +=
step) {
1440 int row_and_7,
int col_and_7,
1441 int w,
int h,
int col_end,
int row_end,
1454 if (tx ==
TX_4X4 && is_uv) {
1469 if (tx ==
TX_4X4 && !skip_inter) {
1470 int t = 1 << col_and_7, m_col = (t << w) - t, y;
1471 int m_col_odd = (t << (w - 1)) - t;
1475 int m_row_8 = m_col & 0x01, m_row_4 = m_col - m_row_8;
1477 for (y = row_and_7; y < h + row_and_7; y++) {
1478 int col_mask_id = 2 - !(y & 7);
1480 lflvl->
mask[is_uv][0][y][1] |= m_row_8;
1481 lflvl->
mask[is_uv][0][y][2] |= m_row_4;
1492 if ((col_end & 1) && (y & 1)) {
1493 lflvl->
mask[is_uv][1][y][col_mask_id] |= m_col_odd;
1495 lflvl->
mask[is_uv][1][y][col_mask_id] |= m_col;
1499 int m_row_8 = m_col & 0x11, m_row_4 = m_col - m_row_8;
1501 for (y = row_and_7; y < h + row_and_7; y++) {
1502 int col_mask_id = 2 - !(y & 3);
1504 lflvl->
mask[is_uv][0][y][1] |= m_row_8;
1505 lflvl->
mask[is_uv][0][y][2] |= m_row_4;
1506 lflvl->
mask[is_uv][1][y][col_mask_id] |= m_col;
1507 lflvl->
mask[is_uv][0][y][3] |= m_col;
1508 lflvl->
mask[is_uv][1][y][3] |= m_col;
1512 int y, t = 1 << col_and_7, m_col = (t << w) - t;
1515 int mask_id = (tx ==
TX_8X8);
1516 int l2 = tx + is_uv - 1, step1d = 1 << l2;
1517 static const unsigned masks[4] = { 0xff, 0x55, 0x11, 0x01 };
1518 int m_row = m_col & masks[l2];
1522 if (is_uv && tx >
TX_8X8 && (w ^ (w - 1)) == 1) {
1523 int m_row_16 = ((t << (w - 1)) - t) & masks[l2];
1524 int m_row_8 = m_row - m_row_16;
1526 for (y = row_and_7; y < h + row_and_7; y++) {
1527 lflvl->
mask[is_uv][0][y][0] |= m_row_16;
1528 lflvl->
mask[is_uv][0][y][1] |= m_row_8;
1531 for (y = row_and_7; y < h + row_and_7; y++)
1532 lflvl->
mask[is_uv][0][y][mask_id] |= m_row;
1535 if (is_uv && tx >
TX_8X8 && (h ^ (h - 1)) == 1) {
1536 for (y = row_and_7; y < h + row_and_7 - 1; y += step1d)
1537 lflvl->
mask[is_uv][1][y][0] |= m_col;
1538 if (y - row_and_7 == h - 1)
1539 lflvl->
mask[is_uv][1][y][1] |= m_col;
1541 for (y = row_and_7; y < h + row_and_7; y += step1d)
1542 lflvl->
mask[is_uv][1][y][mask_id] |= m_col;
1544 }
else if (tx !=
TX_4X4) {
1547 mask_id = (tx ==
TX_8X8) || (is_uv && h == 1);
1548 lflvl->
mask[is_uv][1][row_and_7][mask_id] |= m_col;
1549 mask_id = (tx ==
TX_8X8) || (is_uv && w == 1);
1550 for (y = row_and_7; y < h + row_and_7; y++)
1551 lflvl->
mask[is_uv][0][y][mask_id] |= t;
1553 int t8 = t & 0x01, t4 = t - t8;
1555 for (y = row_and_7; y < h + row_and_7; y++) {
1556 lflvl->
mask[is_uv][0][y][2] |= t4;
1557 lflvl->
mask[is_uv][0][y][1] |= t8;
1559 lflvl->
mask[is_uv][1][row_and_7][2 - !(row_and_7 & 7)] |= m_col;
1561 int t8 = t & 0x11, t4 = t - t8;
1563 for (y = row_and_7; y < h + row_and_7; y++) {
1564 lflvl->
mask[is_uv][0][y][2] |= t4;
1565 lflvl->
mask[is_uv][0][y][1] |= t8;
1567 lflvl->
mask[is_uv][1][row_and_7][2 - !(row_and_7 & 3)] |= m_col;
1573 VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff,
1588 s->
min_mv.
x = -(128 + col * 64);
1589 s->
min_mv.
y = -(128 + row * 64);
1598 b->
uvtx = b->tx - (w4 * 2 == (1 << b->tx) || h4 * 2 == (1 << b->tx));
1608 for (pl = 0; pl < 2; pl++) {
1616 s->
block += w4 * h4 * 64;
1617 s->
uvblock[0] += w4 * h4 * 16;
1618 s->
uvblock[1] += w4 * h4 * 16;
1619 s->
eob += w4 * h4 * 4;
1620 s->
uveob[0] += w4 * h4;
1621 s->
uveob[1] += w4 * h4;
1630 emu[0] = (col + w4) * 8 > f->
linesize[0] ||
1631 (row + h4) > s->
rows;
1632 emu[1] = (col + w4) * 4 > f->
linesize[1] ||
1633 (row + h4) > s->
rows;
1638 b->
dst[0] = f->
data[0] + yoff;
1646 b->
dst[1] = f->
data[1] + uvoff;
1647 b->
dst[2] = f->
data[2] + uvoff;
1661 for (n = 0; o < w; n++) {
1666 s->
dsp.
mc[n][0][0][0][0](f->
data[0] + yoff + o,
1679 for (n = 1; o < w; n++) {
1684 s->
dsp.
mc[n][0][0][0][0](f->
data[1] + uvoff + o,
1688 s->
dsp.
mc[n][0][0][0][0](f->
data[2] + uvoff + o,
1705 for (y = 0; y < h4; y++)
1706 memset(&lflvl->
level[((row & 7) + y) * 8 + (col & 7)], lvl, w4);
1707 mask_edges(lflvl, 0, row & 7, col & 7, x_end, y_end, 0, 0, b->tx, skip_inter);
1708 mask_edges(lflvl, 1, row & 7, col & 7, x_end, y_end,
1711 b->
uvtx, skip_inter);
1718 limit >>= (sharp + 3) >> 2;
1719 limit =
FFMIN(limit, 9 - sharp);
1721 limit =
FFMAX(limit, 1);
1730 s->
block += w4 * h4 * 64;
1731 s->
uvblock[0] += w4 * h4 * 16;
1732 s->
uvblock[1] += w4 * h4 * 16;
1733 s->
eob += w4 * h4 * 4;
1734 s->
uveob[0] += w4 * h4;
1735 s->
uveob[1] += w4 * h4;
struct VP9Context::@108 min_mv
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint8_t * segmentation_map
static void decode_mode(VP9Context *s, VP9Block *const b)
This structure describes decoded (raw) audio or video data.
uint8_t left_segpred_ctx[8]
VP5 and VP6 compatible video decoder (common features)
static av_always_inline int check_intra_mode(VP9Context *s, int mode, uint8_t **a, uint8_t *dst_edge, ptrdiff_t stride_edge, uint8_t *dst_inner, ptrdiff_t stride_inner, uint8_t *l, int col, int x, int w, int row, int y, enum TxfmMode tx, int p)
uint8_t * above_y_nnz_ctx
static av_always_inline int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t(*tree)[2], const uint8_t *probs)
uint8_t left_uv_nnz_ctx[2][8]
struct VP9Context::@106 prob
void(* intra_pred[N_TXFM_SIZES][N_INTRA_PRED_MODES])(uint8_t *dst, ptrdiff_t stride, const uint8_t *left, const uint8_t *top)
uint8_t * above_partition_ctx
void ff_thread_await_progress(ThreadFrame *f, int n, int field)
Wait for earlier decoding threads to finish reference pictures.
const uint8_t ff_vp9_default_kf_ymode_probs[10][10][9]
uint8_t * intra_pred_data[3]
const uint8_t ff_vp9_default_kf_uvmode_probs[10][9]
vp9_mc_func mc[5][4][2][2][2]
uint8_t coef[4][2][2][6][6][3]
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
static int inter_recon(AVCodecContext *avctx)
struct VP9Context::@103::@109 feat[MAX_SEGMENT]
static av_always_inline void mask_edges(VP9Filter *lflvl, int is_uv, int row_and_7, int col_and_7, int w, int h, int col_end, int row_end, enum TxfmMode tx, int skip_inter)
static void intra_recon(AVCodecContext *avctx, ptrdiff_t y_off, ptrdiff_t uv_off)
uint8_t * above_segpred_ctx
#define ROUNDED_DIV(a, b)
static av_always_inline void mc_chroma_dir(VP9Context *s, vp9_mc_func(*mc)[2], uint8_t *dst_u, uint8_t *dst_v, ptrdiff_t dst_stride, const uint8_t *ref_u, ptrdiff_t src_stride_u, const uint8_t *ref_v, ptrdiff_t src_stride_v, ThreadFrame *ref_frame, ptrdiff_t y, ptrdiff_t x, const VP56mv *mv, int bw, int bh, int w, int h)
enum CompPredMode comppredmode
uint8_t left_partition_ctx[8]
const int8_t ff_vp9_intramode_tree[9][2]
simple assert() macros that are a bit more flexible than ISO C assert().
const int16_t(*[5][4] ff_vp9_scans_nb)[2]
struct VP9Context::@101 filter
static int decode_coeffs(AVCodecContext *avctx)
const uint8_t ff_vp9_model_pareto8[256][8]
uint8_t * above_filter_ctx
struct VP9Context::@108 max_mv
const int16_t * ff_vp9_scans[5][4]
VP56mv left_mv_ctx[16][2]
uint8_t left_y_nnz_ctx[16]
struct VP9Context::@107 counts
const int8_t ff_vp9_inter_mode_tree[3][2]
int width
picture width / height.
uint8_t left_mode_ctx[16]
unsigned eob[4][2][2][6][6][2]
void(* emulated_edge_mc)(uint8_t *buf, const uint8_t *src, ptrdiff_t buf_linesize, ptrdiff_t src_linesize, int block_w, int block_h, int src_x, int src_y, int w, int h)
Copy a rectangular area of samples to a temporary buffer and replicate the border samples...
enum FilterMode filtermode
const int8_t ff_vp9_segmentation_tree[7][2]
enum FilterMode ff_vp9_filter_lut[3]
#define vp56_rac_get_prob
static const uint8_t bwh_tab[2][N_BS_SIZES][2]
if(ac->has_optimized_func)
static const float pred[4]
struct VP9Context::@103 segmentation
static const int8_t mv[256][2]
static av_always_inline int vp56_rac_get_prob_branchy(VP56RangeCoder *c, int prob)
VP56mv(* above_mv_ctx)[2]
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
enum TxfmType ff_vp9_intra_txfm_type[14]
unsigned single_ref[5][2][2]
int ff_vp9_decode_block(AVCodecContext *avctx, int row, int col, VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff, enum BlockLevel bl, enum BlockPartition bp)
void ff_vp9_fill_mv(VP9Context *s, VP56mv *mv, int mode, int sb)
uint8_t left_filter_ctx[8]
uint8_t tmp_uv[2][32 *32]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void(* vp9_mc_func)(uint8_t *dst, const uint8_t *ref, ptrdiff_t dst_stride, ptrdiff_t ref_stride, int h, int mx, int my)
void(* itxfm_add[N_TXFM_SIZES+1][N_TXFM_TYPES])(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
common internal api header.
static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src)
static av_always_inline int vp8_rac_get(VP56RangeCoder *c)
Core video DSP helper functions.
uint8_t edge_emu_buffer[71 *80]
static av_always_inline void mc_luma_dir(VP9Context *s, vp9_mc_func(*mc)[2], uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *ref, ptrdiff_t ref_stride, ThreadFrame *ref_frame, ptrdiff_t y, ptrdiff_t x, const VP56mv *mv, int bw, int bh, int w, int h)
const int8_t ff_vp9_filter_tree[2][2]
uint8_t * above_intra_ctx
#define LOCAL_ALIGNED_16(t, v,...)
static int decode_block_coeffs(VP56RangeCoder *c, int16_t *coef, int n_coeffs, enum TxfmMode tx, unsigned(*cnt)[6][3], unsigned(*eob)[6][2], uint8_t(*p)[6][11], int nnz, const int16_t *scan, const int16_t(*nb)[2], const int16_t *band_counts, const int16_t *qmul)
struct VP9Context::@104 tiling
uint8_t left_intra_ctx[8]
uint8_t * above_uv_nnz_ctx[2]