40 #if CONFIG_VP7_DECODER && CONFIG_VP8_DECODER
41 #define VPX(vp7, f) (vp7 ? vp7_ ## f : vp8_ ## f)
42 #elif CONFIG_VP7_DECODER
43 #define VPX(vp7, f) vp7_ ## f
44 #else // CONFIG_VP8_DECODER
45 #define VPX(vp7, f) vp8_ ## f
87 #if CONFIG_VP8_DECODER
130 for (i = 0; i < 5; i++)
218 for (i = 0; i < 4; i++)
221 for (i = 0; i < 4; i++)
225 for (i = 0; i < 3; i++)
234 for (i = 0; i < 4; i++) {
267 if (buf_size - size < 0)
310 for (i = 0; i < 4; i++) {
363 for (i = 0; i < 4; i++)
364 for (j = 0; j < 16; j++)
374 for (i = 0; i < 4; i++)
375 for (j = 0; j < 8; j++)
376 for (k = 0; k < 3; k++)
385 #define VP7_MVC_SIZE 17
386 #define VP8_MVC_SIZE 19
395 for (i = 0; i < 4; i++)
398 for (i = 0; i < 3; i++)
402 for (i = 0; i < 2; i++)
403 for (j = 0; j < mvc_size; j++)
423 for (j = 1; j < 3; j++) {
424 for (i = 0; i < height / 2; i++)
431 const uint8_t *src,
int src_linesize,
436 for (j = 0; j <
height; j++) {
437 for (i = 0; i <
width; i++) {
438 uint8_t y = src[j * src_linesize + i];
439 dst[j * dst_linesize + i] = av_clip_uint8(y + ((y * beta) >> 8) + alpha);
450 if (!s->
keyframe && (alpha || beta)) {
477 width, height, alpha, beta);
486 int part1_size, hscale, vscale, i, j,
ret;
490 s->
profile = (buf[0] >> 1) & 7;
498 part1_size =
AV_RL24(buf) >> 4;
500 if (buf_size < 4 - s->
profile + part1_size) {
512 buf_size -= part1_size;
520 if (hscale || vscale)
529 for (i = 0; i < 2; i++)
541 for (i = 0; i < 4; i++) {
546 for (j = 0; j < 3; j++)
551 for (j = 0; j < 4; j++)
605 for (i = 1; i < 16; i++)
632 int header_size, hscale, vscale,
ret;
639 header_size =
AV_RL24(buf) >> 5;
653 if (header_size > buf_size - 7 * s->
keyframe) {
659 if (
AV_RL24(buf) != 0x2a019d) {
661 "Invalid start code 0x%x\n",
AV_RL24(buf));
664 width =
AV_RL16(buf + 3) & 0x3fff;
665 height =
AV_RL16(buf + 5) & 0x3fff;
666 hscale = buf[4] >> 6;
667 vscale = buf[6] >> 6;
671 if (hscale || vscale)
688 buf_size -= header_size;
768 for (i = 0; i < 3; i++)
770 for (i = (vp7 ? 7 : 9); i > 3; i--)
825 const uint8_t *mbsplits_top, *mbsplits_cur, *firstidx;
835 top_mv = top_mb->
bmv;
851 for (n = 0; n < num; n++) {
853 uint32_t left, above;
857 left =
AV_RN32A(&left_mv[mbsplits_left[k + 3]]);
859 left =
AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]);
861 above =
AV_RN32A(&top_mv[mbsplits_top[k + 12]]);
863 above =
AV_RN32A(&cur_mv[mbsplits_cur[k - 4]]);
900 int xoffset,
int yoffset,
int boundary,
901 int *edge_x,
int *edge_y)
903 int vwidth = mb_width + 1;
904 int new = (mb_y + yoffset) * vwidth + mb_x + xoffset;
905 if (
new < boundary ||
new % vwidth == vwidth - 1)
907 *edge_y =
new / vwidth;
908 *edge_x =
new % vwidth;
919 int mb_x,
int mb_y,
int layout)
922 enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR };
923 enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
947 if (
AV_RN32A(&near_mv[CNT_NEAREST])) {
948 if (mv ==
AV_RN32A(&near_mv[CNT_NEAREST])) {
950 }
else if (
AV_RN32A(&near_mv[CNT_NEAR])) {
951 if (mv !=
AV_RN32A(&near_mv[CNT_NEAR]))
959 AV_WN32A(&near_mv[CNT_NEAREST], mv);
980 if (cnt[CNT_NEAREST] > cnt[CNT_NEAR])
981 AV_WN32A(&mb->
mv, cnt[CNT_ZERO] > cnt[CNT_NEAREST] ? 0 :
AV_RN32A(&near_mv[CNT_NEAREST]));
994 mb->
mv = near_mv[CNT_NEAR];
998 mb->
mv = near_mv[CNT_NEAREST];
1004 mb->
bmv[0] = mb->
mv;
1010 int mb_x,
int mb_y,
int layout)
1015 enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
1016 enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
1025 mb_edge[0] = mb + 2;
1026 mb_edge[2] = mb + 1;
1037 #define MV_EDGE_CHECK(n) \
1039 VP8Macroblock *edge = mb_edge[n]; \
1040 int edge_ref = edge->ref_frame; \
1041 if (edge_ref != VP56_FRAME_CURRENT) { \
1042 uint32_t mv = AV_RN32A(&edge->mv); \
1044 if (cur_sign_bias != sign_bias[edge_ref]) { \
1047 mv = ((mv & 0x7fff7fff) + \
1048 0x00010001) ^ (mv & 0x80008000); \
1050 if (!n || mv != AV_RN32A(&near_mv[idx])) \
1051 AV_WN32A(&near_mv[++idx], mv); \
1052 cnt[idx] += 1 + (n != 2); \
1054 cnt[CNT_ZERO] += 1 + (n != 2); \
1067 if (cnt[CNT_SPLITMV] &&
1068 AV_RN32A(&near_mv[1 + VP8_EDGE_TOP]) ==
AV_RN32A(&near_mv[1 + VP8_EDGE_TOPLEFT]))
1069 cnt[CNT_NEAREST] += 1;
1072 if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) {
1074 FFSWAP(
VP56mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]);
1080 clamp_mv(s, &mb->
mv, &near_mv[CNT_ZERO + (cnt[CNT_NEAREST] >= cnt[CNT_ZERO])]);
1091 mb->
bmv[0] = mb->
mv;
1095 mb->
bmv[0] = mb->
mv;
1099 mb->
bmv[0] = mb->
mv;
1104 mb->
bmv[0] = mb->
mv;
1110 int mb_x,
int keyframe,
int layout)
1126 for (y = 0; y < 4; y++) {
1127 for (x = 0; x < 4; x++) {
1131 left[
y] = top[x] = *intra4x4;
1137 for (i = 0; i < 16; i++)
1148 const char *vp7_feature_name[] = {
"q-index",
1150 "partial-golden-update",
1155 for (i = 0; i < 4; i++) {
1161 "Feature %s present in macroblock (value 0x%x)\n",
1170 *segment = ref ? *ref : *segment;
1237 int i,
uint8_t *token_prob, int16_t qmul[2],
1238 const uint8_t scan[16],
int vp7)
1252 token_prob = probs[i][0];
1260 token_prob = probs[i + 1][1];
1280 int cat = (a << 1) + b;
1281 coeff = 3 + (8 << cat);
1285 token_prob = probs[i + 1][2];
1297 int16_t
dc = block[0];
1306 block[0] = pred[0] =
dc;
1311 block[0] = pred[0] =
dc;
1325 token_prob, qmul, scan,
IS_VP7);
1328 #ifndef vp8_decode_block_coeffs_internal
1356 int i,
int zero_nhood, int16_t qmul[2],
1357 const uint8_t scan[16],
int vp7)
1359 uint8_t *token_prob = probs[i][zero_nhood];
1363 token_prob, qmul, scan)
1373 int i, x,
y, luma_start = 0, luma_ctx = 3;
1374 int nnz_pred, nnz, nnz_total = 0;
1379 nnz_pred = t_nnz[8] + l_nnz[8];
1385 l_nnz[8] = t_nnz[8] = !!nnz;
1405 for (y = 0; y < 4; y++)
1406 for (x = 0; x < 4; x++) {
1407 nnz_pred = l_nnz[
y] + t_nnz[x];
1410 luma_start, nnz_pred,
1416 t_nnz[x] = l_nnz[
y] = !!nnz;
1423 for (i = 4; i < 6; i++)
1424 for (y = 0; y < 2; y++)
1425 for (x = 0; x < 2; x++) {
1426 nnz_pred = l_nnz[i + 2 *
y] + t_nnz[i + 2 * x];
1432 t_nnz[i + 2 * x] = l_nnz[i + 2 *
y] = !!nnz;
1446 int linesize,
int uvlinesize,
int simple)
1448 AV_COPY128(top_border, src_y + 15 * linesize);
1450 AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
1451 AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
1457 uint8_t *src_cr,
int linesize,
int uvlinesize,
int mb_x,
1458 int mb_y,
int mb_width,
int simple,
int xchg)
1460 uint8_t *top_border_m1 = top_border - 32;
1462 src_cb -= uvlinesize;
1463 src_cr -= uvlinesize;
1465 #define XCHG(a, b, xchg) \
1473 XCHG(top_border_m1 + 8, src_y - 8, xchg);
1474 XCHG(top_border, src_y, xchg);
1475 XCHG(top_border + 8, src_y + 8, 1);
1476 if (mb_x < mb_width - 1)
1477 XCHG(top_border + 32, src_y + 16, 1);
1481 if (!simple || !mb_y) {
1482 XCHG(top_border_m1 + 16, src_cb - 8, xchg);
1483 XCHG(top_border_m1 + 24, src_cr - 8, xchg);
1484 XCHG(top_border + 16, src_cb, 1);
1485 XCHG(top_border + 24, src_cr, 1);
1535 int *copy_buf,
int vp7)
1539 if (!mb_x && mb_y) {
1573 int x,
y,
mode, nnz;
1589 const uint8_t lo = is_vp7 ? 128 : 127;
1590 const uint8_t hi = is_vp7 ? 128 : 129;
1591 uint8_t tr_top[4] = { lo, lo, lo, lo };
1599 if (mb_y && mb_x == s->
mb_width - 1) {
1600 tr = tr_right[-1] * 0x01010101
u;
1607 for (y = 0; y < 4; y++) {
1609 for (x = 0; x < 4; x++) {
1614 if ((y == 0 || x == 3) && mb_y == 0) {
1617 topright = tr_right;
1620 mb_y + y, ©, is_vp7);
1622 dst = copy_dst + 12;
1626 AV_WN32A(copy_dst + 4, lo * 0x01010101U);
1632 copy_dst[3] = ptr[4 * x - s->
linesize - 1];
1641 copy_dst[11] = ptr[4 * x - 1];
1642 copy_dst[19] = ptr[4 * x + s->
linesize - 1];
1643 copy_dst[27] = ptr[4 * x + s->
linesize * 2 - 1];
1644 copy_dst[35] = ptr[4 * x + s->
linesize * 3 - 1];
1673 mb_x, mb_y, is_vp7);
1684 { 0, 1, 2, 1, 2, 1, 2, 1 },
1686 { 0, 3, 5, 3, 5, 3, 5, 3 },
1687 { 0, 2, 3, 2, 3, 2, 3, 2 },
1709 int x_off,
int y_off,
int block_w,
int block_h,
1716 int src_linesize = linesize;
1718 int mx = (mv->
x << 1) & 7, mx_idx = subpel_idx[0][mx];
1719 int my = (mv->
y << 1) & 7, my_idx = subpel_idx[0][my];
1721 x_off += mv->
x >> 2;
1722 y_off += mv->
y >> 2;
1726 src += y_off * linesize + x_off;
1727 if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
1728 y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
1730 src - my_idx * linesize - mx_idx,
1732 block_w + subpel_idx[1][mx],
1733 block_h + subpel_idx[1][my],
1734 x_off - mx_idx, y_off - my_idx,
1739 mc_func[my_idx][mx_idx](dst, linesize,
src, src_linesize, block_h, mx, my);
1742 mc_func[0][0](dst, linesize, src + y_off * linesize + x_off,
1743 linesize, block_h, 0, 0);
1767 int x_off,
int y_off,
int block_w,
int block_h,
1774 int mx = mv->
x & 7, mx_idx = subpel_idx[0][mx];
1775 int my = mv->
y & 7, my_idx = subpel_idx[0][my];
1777 x_off += mv->
x >> 3;
1778 y_off += mv->
y >> 3;
1781 src1 += y_off * linesize + x_off;
1782 src2 += y_off * linesize + x_off;
1784 if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
1785 y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
1787 src1 - my_idx * linesize - mx_idx,
1789 block_w + subpel_idx[1][mx],
1790 block_h + subpel_idx[1][my],
1791 x_off - mx_idx, y_off - my_idx, width, height);
1793 mc_func[my_idx][mx_idx](dst1, linesize, src1,
EDGE_EMU_LINESIZE, block_h, mx, my);
1796 src2 - my_idx * linesize - mx_idx,
1797 EDGE_EMU_LINESIZE, linesize,
1798 block_w + subpel_idx[1][mx],
1799 block_h + subpel_idx[1][my],
1800 x_off - mx_idx, y_off - my_idx, width, height);
1802 mc_func[my_idx][mx_idx](dst2, linesize, src2,
EDGE_EMU_LINESIZE, block_h, mx, my);
1804 mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my);
1805 mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my);
1809 mc_func[0][0](dst1, linesize, src1 + y_off * linesize + x_off, linesize, block_h, 0, 0);
1810 mc_func[0][0](dst2, linesize, src2 + y_off * linesize + x_off, linesize, block_h, 0, 0);
1817 int bx_off,
int by_off,
int block_w,
int block_h,
1824 ref_frame, mv, x_off + bx_off, y_off + by_off,
1825 block_w, block_h, width, height, s->
linesize,
1844 dst[2] + by_off * s->
uvlinesize + bx_off, ref_frame,
1845 &uvmv, x_off + bx_off, y_off + by_off,
1846 block_w, block_h, width, height, s->
uvlinesize,
1857 if (s->
ref_count[ref - 1] > (mb_xy >> 5)) {
1858 int x_off = mb_x << 4, y_off = mb_y << 4;
1859 int mx = (mb->
mv.
x >> 2) + x_off + 8;
1860 int my = (mb->
mv.
y >> 2) + y_off;
1862 int off = mx + (my + (mb_x & 3) * 4) * s->
linesize + 64;
1867 off = (mx >> 1) + ((my >> 1) + (mb_x & 7)) * s->
uvlinesize + 64;
1879 int x_off = mb_x << 4, y_off = mb_y << 4;
1887 0, 0, 16, 16, width,
height, &mb->
mv);
1894 for (y = 0; y < 4; y++) {
1895 for (x = 0; x < 4; x++) {
1897 ref, &bmv[4 * y + x],
1898 4 * x + x_off, 4 * y + y_off, 4, 4,
1909 for (y = 0; y < 2; y++) {
1910 for (x = 0; x < 2; x++) {
1911 uvmv.
x = mb->
bmv[2 * y * 4 + 2 * x ].
x +
1912 mb->
bmv[2 * y * 4 + 2 * x + 1].
x +
1913 mb->
bmv[(2 * y + 1) * 4 + 2 * x ].x +
1914 mb->
bmv[(2 * y + 1) * 4 + 2 * x + 1].
x;
1915 uvmv.
y = mb->
bmv[2 * y * 4 + 2 * x ].
y +
1916 mb->
bmv[2 * y * 4 + 2 * x + 1].
y +
1917 mb->
bmv[(2 * y + 1) * 4 + 2 * x ].y +
1918 mb->
bmv[(2 * y + 1) * 4 + 2 * x + 1].
y;
1927 &uvmv, 4 * x + x_off, 4 * y + y_off, 4, 4,
1936 0, 0, 16, 8, width,
height, &bmv[0]);
1938 0, 8, 16, 8, width,
height, &bmv[1]);
1942 0, 0, 8, 16, width,
height, &bmv[0]);
1944 8, 0, 8, 16, width,
height, &bmv[1]);
1948 0, 0, 8, 8, width,
height, &bmv[0]);
1950 8, 0, 8, 8, width,
height, &bmv[1]);
1952 0, 8, 8, 8, width,
height, &bmv[2]);
1954 8, 8, 8, 8, width,
height, &bmv[3]);
1966 for (y = 0; y < 4; y++) {
1969 if (nnz4 & ~0x01010101) {
1970 for (x = 0; x < 4; x++) {
1991 for (ch = 0; ch < 2; ch++) {
1994 uint8_t *ch_dst = dst[1 + ch];
1995 if (nnz4 & ~0x01010101) {
1996 for (y = 0; y < 2; y++) {
1997 for (x = 0; x < 2; x++) {
2000 td->
block[4 + ch][(y << 1) + x],
2004 td->
block[4 + ch][(y << 1) + x],
2008 goto chroma_idct_end;
2025 int interior_limit, filter_level;
2039 filter_level = av_clip_uintp2(filter_level, 6);
2041 interior_limit = filter_level;
2046 interior_limit =
FFMAX(interior_limit, 1);
2056 int mb_x,
int mb_y,
int is_vp7)
2058 int mbedge_lim, bedge_lim_y, bedge_lim_uv, hev_thresh;
2064 static const uint8_t hev_thresh_lut[2][64] = {
2065 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2066 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2067 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2069 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2070 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2071 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2079 bedge_lim_y = filter_level;
2080 bedge_lim_uv = filter_level * 2;
2081 mbedge_lim = filter_level + 2;
2084 bedge_lim_uv = filter_level * 2 + inner_limit;
2085 mbedge_lim = bedge_lim_y + 4;
2088 hev_thresh = hev_thresh_lut[s->
keyframe][filter_level];
2092 mbedge_lim, inner_limit, hev_thresh);
2094 mbedge_lim, inner_limit, hev_thresh);
2097 #define H_LOOP_FILTER_16Y_INNER(cond) \
2098 if (cond && inner_filter) { \
2099 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 4, linesize, \
2100 bedge_lim_y, inner_limit, \
2102 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 8, linesize, \
2103 bedge_lim_y, inner_limit, \
2105 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 12, linesize, \
2106 bedge_lim_y, inner_limit, \
2108 s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4, \
2109 uvlinesize, bedge_lim_uv, \
2110 inner_limit, hev_thresh); \
2117 mbedge_lim, inner_limit, hev_thresh);
2119 mbedge_lim, inner_limit, hev_thresh);
2124 linesize, bedge_lim_y,
2125 inner_limit, hev_thresh);
2127 linesize, bedge_lim_y,
2128 inner_limit, hev_thresh);
2130 linesize, bedge_lim_y,
2131 inner_limit, hev_thresh);
2133 dst[2] + 4 * uvlinesize,
2134 uvlinesize, bedge_lim_uv,
2135 inner_limit, hev_thresh);
2145 int mbedge_lim, bedge_lim;
2154 bedge_lim = 2 * filter_level + inner_limit;
2155 mbedge_lim = bedge_lim + 4;
2174 #define MARGIN (16 << 2)
2184 for (mb_y = 0; mb_y < s->
mb_height; mb_y++) {
2186 ((s->
mb_width + 1) * (mb_y + 1) + 1);
2193 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_xy++, mb++) {
2198 prev_frame && prev_frame->
seg_map ?
2199 prev_frame->
seg_map->
data + mb_xy : NULL, 1, is_vp7);
2221 #define check_thread_pos(td, otd, mb_x_check, mb_y_check) \
2223 int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF); \
2224 if (otd->thread_mb_pos < tmp) { \
2225 pthread_mutex_lock(&otd->lock); \
2226 td->wait_mb_pos = tmp; \
2228 if (otd->thread_mb_pos >= tmp) \
2230 pthread_cond_wait(&otd->cond, &otd->lock); \
2232 td->wait_mb_pos = INT_MAX; \
2233 pthread_mutex_unlock(&otd->lock); \
2237 #define update_pos(td, mb_y, mb_x) \
2239 int pos = (mb_y << 16) | (mb_x & 0xFFFF); \
2240 int sliced_threading = (avctx->active_thread_type == FF_THREAD_SLICE) && \
2242 int is_null = !next_td || !prev_td; \
2243 int pos_check = (is_null) ? 1 \
2244 : (next_td != td && \
2245 pos >= next_td->wait_mb_pos) || \
2247 pos >= prev_td->wait_mb_pos); \
2248 td->thread_mb_pos = pos; \
2249 if (sliced_threading && pos_check) { \
2250 pthread_mutex_lock(&td->lock); \
2251 pthread_cond_broadcast(&td->cond); \
2252 pthread_mutex_unlock(&td->lock); \
2256 #define check_thread_pos(td, otd, mb_x_check, mb_y_check)
2257 #define update_pos(td, mb_y, mb_x)
2261 int jobnr,
int threadnr,
int is_vp7)
2266 int mb_x, mb_xy = mb_y * s->
mb_width;
2279 prev_td = &s->
thread_data[(jobnr + num_jobs - 1) % num_jobs];
2283 next_td = &s->
thread_data[(jobnr + 1) % num_jobs];
2293 memset(mb - 1, 0,
sizeof(*mb));
2297 if (!is_vp7 || mb_y == 0)
2303 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_xy++, mb++) {
2305 if (prev_td != td) {
2306 if (threadnr != 0) {
2308 mb_x + (is_vp7 ? 2 : 1),
2309 mb_y - (is_vp7 ? 2 : 1));
2312 mb_x + (is_vp7 ? 2 : 1) + s->
mb_width + 3,
2313 mb_y - (is_vp7 ? 2 : 1));
2320 dst[2] - dst[1], 2);
2324 prev_frame && prev_frame->seg_map ?
2325 prev_frame->seg_map->data + mb_xy : NULL, 0, is_vp7);
2356 if (s->
deblock_filter && num_jobs != 1 && threadnr == num_jobs - 1) {
2382 int jobnr,
int threadnr)
2388 int jobnr,
int threadnr)
2394 int jobnr,
int threadnr,
int is_vp7)
2416 prev_td = &s->
thread_data[(jobnr + num_jobs - 1) % num_jobs];
2420 next_td = &s->
thread_data[(jobnr + 1) % num_jobs];
2422 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb++) {
2426 (mb_x + 1) + (s->
mb_width + 3), mb_y - 1);
2431 if (num_jobs == 1) {
2443 filter_mb(s, dst, f, mb_x, mb_y, is_vp7);
2453 int jobnr,
int threadnr)
2459 int jobnr,
int threadnr)
2466 int threadnr,
int is_vp7)
2475 for (mb_y = jobnr; mb_y < s->
mb_height; mb_y += num_jobs) {
2495 int jobnr,
int threadnr)
2501 int jobnr,
int threadnr)
2512 int ret, i, referenced, num_jobs;
2541 for (i = 0; i < 5; i++)
2543 &s->
frames[i] != prev_frame &&
2566 "Discarding interframe without a prior keyframe!\n");
2571 curframe->tf.f->key_frame = s->
keyframe;
2598 s->
linesize = curframe->tf.f->linesize[0];
2671 #if CONFIG_VP7_DECODER
2716 if (CONFIG_VP7_DECODER && is_vp7) {
2721 }
else if (CONFIG_VP8_DECODER && !is_vp7) {
2739 #if CONFIG_VP7_DECODER
2751 #if CONFIG_VP8_DECODER
2767 #define REBASE(pic) ((pic) ? (pic) - &s_src->frames[0] + &s->frames[0] : NULL)
2782 s->
prob[0] = s_src->
prob[!s_src->update_probabilities];
2788 if (s_src->frames[i].tf.f->data[0]) {
2789 int ret = vp8_ref_frame(s, &s->
frames[i], &s_src->frames[i]);
2795 s->
framep[0] = REBASE(s_src->next_framep[0]);
2796 s->
framep[1] = REBASE(s_src->next_framep[1]);
2797 s->
framep[2] = REBASE(s_src->next_framep[2]);
2798 s->
framep[3] = REBASE(s_src->next_framep[3]);
2804 #if CONFIG_VP7_DECODER
2811 .
init = vp7_decode_init,
2813 .
decode = vp7_decode_frame,
2819 #if CONFIG_VP8_DECODER