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;
767 for (i = 0; i < 3; i++)
769 for (i = (vp7 ? 7 : 9); i > 3; i--)
824 const uint8_t *mbsplits_top, *mbsplits_cur, *firstidx;
834 top_mv = top_mb->
bmv;
850 for (n = 0; n < num; n++) {
852 uint32_t left, above;
856 left =
AV_RN32A(&left_mv[mbsplits_left[k + 3]]);
858 left =
AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]);
860 above =
AV_RN32A(&top_mv[mbsplits_top[k + 12]]);
862 above =
AV_RN32A(&cur_mv[mbsplits_cur[k - 4]]);
899 int xoffset,
int yoffset,
int boundary,
900 int *edge_x,
int *edge_y)
902 int vwidth = mb_width + 1;
903 int new = (mb_y + yoffset) * vwidth + mb_x + xoffset;
904 if (
new < boundary ||
new % vwidth == vwidth - 1)
906 *edge_y =
new / vwidth;
907 *edge_x =
new % vwidth;
918 int mb_x,
int mb_y,
int layout)
921 enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR };
922 enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
946 if (
AV_RN32A(&near_mv[CNT_NEAREST])) {
947 if (mv ==
AV_RN32A(&near_mv[CNT_NEAREST])) {
949 }
else if (
AV_RN32A(&near_mv[CNT_NEAR])) {
950 if (mv !=
AV_RN32A(&near_mv[CNT_NEAR]))
958 AV_WN32A(&near_mv[CNT_NEAREST], mv);
979 if (cnt[CNT_NEAREST] > cnt[CNT_NEAR])
980 AV_WN32A(&mb->
mv, cnt[CNT_ZERO] > cnt[CNT_NEAREST] ? 0 :
AV_RN32A(&near_mv[CNT_NEAREST]));
993 mb->
mv = near_mv[CNT_NEAR];
997 mb->
mv = near_mv[CNT_NEAREST];
1003 mb->
bmv[0] = mb->
mv;
1009 int mb_x,
int mb_y,
int layout)
1014 enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
1015 enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
1024 mb_edge[0] = mb + 2;
1025 mb_edge[2] = mb + 1;
1036 #define MV_EDGE_CHECK(n) \
1038 VP8Macroblock *edge = mb_edge[n]; \
1039 int edge_ref = edge->ref_frame; \
1040 if (edge_ref != VP56_FRAME_CURRENT) { \
1041 uint32_t mv = AV_RN32A(&edge->mv); \
1043 if (cur_sign_bias != sign_bias[edge_ref]) { \
1046 mv = ((mv & 0x7fff7fff) + \
1047 0x00010001) ^ (mv & 0x80008000); \
1049 if (!n || mv != AV_RN32A(&near_mv[idx])) \
1050 AV_WN32A(&near_mv[++idx], mv); \
1051 cnt[idx] += 1 + (n != 2); \
1053 cnt[CNT_ZERO] += 1 + (n != 2); \
1066 if (cnt[CNT_SPLITMV] &&
1067 AV_RN32A(&near_mv[1 + VP8_EDGE_TOP]) ==
AV_RN32A(&near_mv[1 + VP8_EDGE_TOPLEFT]))
1068 cnt[CNT_NEAREST] += 1;
1071 if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) {
1073 FFSWAP(
VP56mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]);
1079 clamp_mv(s, &mb->
mv, &near_mv[CNT_ZERO + (cnt[CNT_NEAREST] >= cnt[CNT_ZERO])]);
1090 mb->
bmv[0] = mb->
mv;
1094 mb->
bmv[0] = mb->
mv;
1098 mb->
bmv[0] = mb->
mv;
1103 mb->
bmv[0] = mb->
mv;
1109 int mb_x,
int keyframe,
int layout)
1125 for (y = 0; y < 4; y++) {
1126 for (x = 0; x < 4; x++) {
1130 left[
y] = top[x] = *intra4x4;
1136 for (i = 0; i < 16; i++)
1147 const char *vp7_feature_name[] = {
"q-index",
1149 "partial-golden-update",
1154 for (i = 0; i < 4; i++) {
1160 "Feature %s present in macroblock (value 0x%x)\n",
1169 *segment = ref ? *ref : *segment;
1236 int i,
uint8_t *token_prob, int16_t qmul[2],
1237 const uint8_t scan[16],
int vp7)
1251 token_prob = probs[i][0];
1259 token_prob = probs[i + 1][1];
1279 int cat = (a << 1) + b;
1280 coeff = 3 + (8 << cat);
1284 token_prob = probs[i + 1][2];
1296 int16_t
dc = block[0];
1305 block[0] = pred[0] =
dc;
1310 block[0] = pred[0] =
dc;
1324 token_prob, qmul, scan,
IS_VP7);
1327 #ifndef vp8_decode_block_coeffs_internal
1355 int i,
int zero_nhood, int16_t qmul[2],
1356 const uint8_t scan[16],
int vp7)
1358 uint8_t *token_prob = probs[i][zero_nhood];
1362 token_prob, qmul, scan)
1372 int i, x,
y, luma_start = 0, luma_ctx = 3;
1373 int nnz_pred, nnz, nnz_total = 0;
1378 nnz_pred = t_nnz[8] + l_nnz[8];
1384 l_nnz[8] = t_nnz[8] = !!nnz;
1404 for (y = 0; y < 4; y++)
1405 for (x = 0; x < 4; x++) {
1406 nnz_pred = l_nnz[
y] + t_nnz[x];
1409 luma_start, nnz_pred,
1415 t_nnz[x] = l_nnz[
y] = !!nnz;
1422 for (i = 4; i < 6; i++)
1423 for (y = 0; y < 2; y++)
1424 for (x = 0; x < 2; x++) {
1425 nnz_pred = l_nnz[i + 2 *
y] + t_nnz[i + 2 * x];
1431 t_nnz[i + 2 * x] = l_nnz[i + 2 *
y] = !!nnz;
1445 int linesize,
int uvlinesize,
int simple)
1447 AV_COPY128(top_border, src_y + 15 * linesize);
1449 AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
1450 AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
1456 uint8_t *src_cr,
int linesize,
int uvlinesize,
int mb_x,
1457 int mb_y,
int mb_width,
int simple,
int xchg)
1459 uint8_t *top_border_m1 = top_border - 32;
1461 src_cb -= uvlinesize;
1462 src_cr -= uvlinesize;
1464 #define XCHG(a, b, xchg) \
1472 XCHG(top_border_m1 + 8, src_y - 8, xchg);
1473 XCHG(top_border, src_y, xchg);
1474 XCHG(top_border + 8, src_y + 8, 1);
1475 if (mb_x < mb_width - 1)
1476 XCHG(top_border + 32, src_y + 16, 1);
1480 if (!simple || !mb_y) {
1481 XCHG(top_border_m1 + 16, src_cb - 8, xchg);
1482 XCHG(top_border_m1 + 24, src_cr - 8, xchg);
1483 XCHG(top_border + 16, src_cb, 1);
1484 XCHG(top_border + 24, src_cr, 1);
1534 int *copy_buf,
int vp7)
1538 if (!mb_x && mb_y) {
1572 int x,
y,
mode, nnz;
1588 const uint8_t lo = is_vp7 ? 128 : 127;
1589 const uint8_t hi = is_vp7 ? 128 : 129;
1590 uint8_t tr_top[4] = { lo, lo, lo, lo };
1598 if (mb_y && mb_x == s->
mb_width - 1) {
1599 tr = tr_right[-1] * 0x01010101
u;
1606 for (y = 0; y < 4; y++) {
1608 for (x = 0; x < 4; x++) {
1613 if ((y == 0 || x == 3) && mb_y == 0) {
1616 topright = tr_right;
1619 mb_y + y, ©, is_vp7);
1621 dst = copy_dst + 12;
1625 AV_WN32A(copy_dst + 4, lo * 0x01010101U);
1631 copy_dst[3] = ptr[4 * x - s->
linesize - 1];
1640 copy_dst[11] = ptr[4 * x - 1];
1641 copy_dst[19] = ptr[4 * x + s->
linesize - 1];
1642 copy_dst[27] = ptr[4 * x + s->
linesize * 2 - 1];
1643 copy_dst[35] = ptr[4 * x + s->
linesize * 3 - 1];
1672 mb_x, mb_y, is_vp7);
1683 { 0, 1, 2, 1, 2, 1, 2, 1 },
1685 { 0, 3, 5, 3, 5, 3, 5, 3 },
1686 { 0, 2, 3, 2, 3, 2, 3, 2 },
1708 int x_off,
int y_off,
int block_w,
int block_h,
1715 int src_linesize = linesize;
1717 int mx = (mv->
x << 1) & 7, mx_idx = subpel_idx[0][mx];
1718 int my = (mv->
y << 1) & 7, my_idx = subpel_idx[0][my];
1720 x_off += mv->
x >> 2;
1721 y_off += mv->
y >> 2;
1725 src += y_off * linesize + x_off;
1726 if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
1727 y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
1729 src - my_idx * linesize - mx_idx,
1731 block_w + subpel_idx[1][mx],
1732 block_h + subpel_idx[1][my],
1733 x_off - mx_idx, y_off - my_idx,
1738 mc_func[my_idx][mx_idx](dst, linesize,
src, src_linesize, block_h, mx, my);
1741 mc_func[0][0](dst, linesize, src + y_off * linesize + x_off,
1742 linesize, block_h, 0, 0);
1766 int x_off,
int y_off,
int block_w,
int block_h,
1773 int mx = mv->
x & 7, mx_idx = subpel_idx[0][mx];
1774 int my = mv->
y & 7, my_idx = subpel_idx[0][my];
1776 x_off += mv->
x >> 3;
1777 y_off += mv->
y >> 3;
1780 src1 += y_off * linesize + x_off;
1781 src2 += y_off * linesize + x_off;
1783 if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
1784 y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
1786 src1 - my_idx * linesize - mx_idx,
1788 block_w + subpel_idx[1][mx],
1789 block_h + subpel_idx[1][my],
1790 x_off - mx_idx, y_off - my_idx, width, height);
1792 mc_func[my_idx][mx_idx](dst1, linesize, src1,
EDGE_EMU_LINESIZE, block_h, mx, my);
1795 src2 - my_idx * linesize - mx_idx,
1796 EDGE_EMU_LINESIZE, linesize,
1797 block_w + subpel_idx[1][mx],
1798 block_h + subpel_idx[1][my],
1799 x_off - mx_idx, y_off - my_idx, width, height);
1801 mc_func[my_idx][mx_idx](dst2, linesize, src2,
EDGE_EMU_LINESIZE, block_h, mx, my);
1803 mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my);
1804 mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my);
1808 mc_func[0][0](dst1, linesize, src1 + y_off * linesize + x_off, linesize, block_h, 0, 0);
1809 mc_func[0][0](dst2, linesize, src2 + y_off * linesize + x_off, linesize, block_h, 0, 0);
1816 int bx_off,
int by_off,
int block_w,
int block_h,
1823 ref_frame, mv, x_off + bx_off, y_off + by_off,
1824 block_w, block_h, width, height, s->
linesize,
1843 dst[2] + by_off * s->
uvlinesize + bx_off, ref_frame,
1844 &uvmv, x_off + bx_off, y_off + by_off,
1845 block_w, block_h, width, height, s->
uvlinesize,
1856 if (s->
ref_count[ref - 1] > (mb_xy >> 5)) {
1857 int x_off = mb_x << 4, y_off = mb_y << 4;
1858 int mx = (mb->
mv.
x >> 2) + x_off + 8;
1859 int my = (mb->
mv.
y >> 2) + y_off;
1861 int off = mx + (my + (mb_x & 3) * 4) * s->
linesize + 64;
1866 off = (mx >> 1) + ((my >> 1) + (mb_x & 7)) * s->
uvlinesize + 64;
1878 int x_off = mb_x << 4, y_off = mb_y << 4;
1886 0, 0, 16, 16, width,
height, &mb->
mv);
1893 for (y = 0; y < 4; y++) {
1894 for (x = 0; x < 4; x++) {
1896 ref, &bmv[4 * y + x],
1897 4 * x + x_off, 4 * y + y_off, 4, 4,
1908 for (y = 0; y < 2; y++) {
1909 for (x = 0; x < 2; x++) {
1910 uvmv.
x = mb->
bmv[2 * y * 4 + 2 * x ].
x +
1911 mb->
bmv[2 * y * 4 + 2 * x + 1].
x +
1912 mb->
bmv[(2 * y + 1) * 4 + 2 * x ].x +
1913 mb->
bmv[(2 * y + 1) * 4 + 2 * x + 1].
x;
1914 uvmv.
y = mb->
bmv[2 * y * 4 + 2 * x ].
y +
1915 mb->
bmv[2 * y * 4 + 2 * x + 1].
y +
1916 mb->
bmv[(2 * y + 1) * 4 + 2 * x ].y +
1917 mb->
bmv[(2 * y + 1) * 4 + 2 * x + 1].
y;
1918 uvmv.
x = (uvmv.
x + 2 + (uvmv.
x >> (INT_BIT - 1))) >> 2;
1919 uvmv.
y = (uvmv.
y + 2 + (uvmv.
y >> (INT_BIT - 1))) >> 2;
1926 &uvmv, 4 * x + x_off, 4 * y + y_off, 4, 4,
1935 0, 0, 16, 8, width,
height, &bmv[0]);
1937 0, 8, 16, 8, width,
height, &bmv[1]);
1941 0, 0, 8, 16, width,
height, &bmv[0]);
1943 8, 0, 8, 16, width,
height, &bmv[1]);
1947 0, 0, 8, 8, width,
height, &bmv[0]);
1949 8, 0, 8, 8, width,
height, &bmv[1]);
1951 0, 8, 8, 8, width,
height, &bmv[2]);
1953 8, 8, 8, 8, width,
height, &bmv[3]);
1965 for (y = 0; y < 4; y++) {
1968 if (nnz4 & ~0x01010101) {
1969 for (x = 0; x < 4; x++) {
1990 for (ch = 0; ch < 2; ch++) {
1993 uint8_t *ch_dst = dst[1 + ch];
1994 if (nnz4 & ~0x01010101) {
1995 for (y = 0; y < 2; y++) {
1996 for (x = 0; x < 2; x++) {
1999 td->
block[4 + ch][(y << 1) + x],
2003 td->
block[4 + ch][(y << 1) + x],
2007 goto chroma_idct_end;
2024 int interior_limit, filter_level;
2038 filter_level = av_clip_uintp2(filter_level, 6);
2040 interior_limit = filter_level;
2045 interior_limit =
FFMAX(interior_limit, 1);
2055 int mb_x,
int mb_y,
int is_vp7)
2057 int mbedge_lim, bedge_lim_y, bedge_lim_uv, hev_thresh;
2063 static const uint8_t hev_thresh_lut[2][64] = {
2064 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2065 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2066 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2068 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2069 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2070 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2078 bedge_lim_y = filter_level;
2079 bedge_lim_uv = filter_level * 2;
2080 mbedge_lim = filter_level + 2;
2083 bedge_lim_uv = filter_level * 2 + inner_limit;
2084 mbedge_lim = bedge_lim_y + 4;
2087 hev_thresh = hev_thresh_lut[s->
keyframe][filter_level];
2091 mbedge_lim, inner_limit, hev_thresh);
2093 mbedge_lim, inner_limit, hev_thresh);
2096 #define H_LOOP_FILTER_16Y_INNER(cond) \
2097 if (cond && inner_filter) { \
2098 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 4, linesize, \
2099 bedge_lim_y, inner_limit, \
2101 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 8, linesize, \
2102 bedge_lim_y, inner_limit, \
2104 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 12, linesize, \
2105 bedge_lim_y, inner_limit, \
2107 s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4, \
2108 uvlinesize, bedge_lim_uv, \
2109 inner_limit, hev_thresh); \
2116 mbedge_lim, inner_limit, hev_thresh);
2118 mbedge_lim, inner_limit, hev_thresh);
2123 linesize, bedge_lim_y,
2124 inner_limit, hev_thresh);
2126 linesize, bedge_lim_y,
2127 inner_limit, hev_thresh);
2129 linesize, bedge_lim_y,
2130 inner_limit, hev_thresh);
2132 dst[2] + 4 * uvlinesize,
2133 uvlinesize, bedge_lim_uv,
2134 inner_limit, hev_thresh);
2144 int mbedge_lim, bedge_lim;
2153 bedge_lim = 2 * filter_level + inner_limit;
2154 mbedge_lim = bedge_lim + 4;
2173 #define MARGIN (16 << 2)
2183 for (mb_y = 0; mb_y < s->
mb_height; mb_y++) {
2185 ((s->
mb_width + 1) * (mb_y + 1) + 1);
2192 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_xy++, mb++) {
2197 prev_frame && prev_frame->
seg_map ?
2198 prev_frame->
seg_map->
data + mb_xy : NULL, 1, is_vp7);
2220 #define check_thread_pos(td, otd, mb_x_check, mb_y_check) \
2222 int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF); \
2223 if (otd->thread_mb_pos < tmp) { \
2224 pthread_mutex_lock(&otd->lock); \
2225 td->wait_mb_pos = tmp; \
2227 if (otd->thread_mb_pos >= tmp) \
2229 pthread_cond_wait(&otd->cond, &otd->lock); \
2231 td->wait_mb_pos = INT_MAX; \
2232 pthread_mutex_unlock(&otd->lock); \
2236 #define update_pos(td, mb_y, mb_x) \
2238 int pos = (mb_y << 16) | (mb_x & 0xFFFF); \
2239 int sliced_threading = (avctx->active_thread_type == FF_THREAD_SLICE) && \
2241 int is_null = !next_td || !prev_td; \
2242 int pos_check = (is_null) ? 1 \
2243 : (next_td != td && \
2244 pos >= next_td->wait_mb_pos) || \
2246 pos >= prev_td->wait_mb_pos); \
2247 td->thread_mb_pos = pos; \
2248 if (sliced_threading && pos_check) { \
2249 pthread_mutex_lock(&td->lock); \
2250 pthread_cond_broadcast(&td->cond); \
2251 pthread_mutex_unlock(&td->lock); \
2255 #define check_thread_pos(td, otd, mb_x_check, mb_y_check)
2256 #define update_pos(td, mb_y, mb_x)
2260 int jobnr,
int threadnr,
int is_vp7)
2265 int mb_x, mb_xy = mb_y * s->
mb_width;
2278 prev_td = &s->
thread_data[(jobnr + num_jobs - 1) % num_jobs];
2282 next_td = &s->
thread_data[(jobnr + 1) % num_jobs];
2292 memset(mb - 1, 0,
sizeof(*mb));
2296 if (!is_vp7 || mb_y == 0)
2302 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_xy++, mb++) {
2304 if (prev_td != td) {
2305 if (threadnr != 0) {
2307 mb_x + (is_vp7 ? 2 : 1),
2308 mb_y - (is_vp7 ? 2 : 1));
2311 mb_x + (is_vp7 ? 2 : 1) + s->
mb_width + 3,
2312 mb_y - (is_vp7 ? 2 : 1));
2319 dst[2] - dst[1], 2);
2323 prev_frame && prev_frame->seg_map ?
2324 prev_frame->seg_map->data + mb_xy : NULL, 0, is_vp7);
2355 if (s->
deblock_filter && num_jobs != 1 && threadnr == num_jobs - 1) {
2381 int jobnr,
int threadnr)
2387 int jobnr,
int threadnr)
2393 int jobnr,
int threadnr,
int is_vp7)
2415 prev_td = &s->
thread_data[(jobnr + num_jobs - 1) % num_jobs];
2419 next_td = &s->
thread_data[(jobnr + 1) % num_jobs];
2421 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb++) {
2425 (mb_x + 1) + (s->
mb_width + 3), mb_y - 1);
2430 if (num_jobs == 1) {
2442 filter_mb(s, dst, f, mb_x, mb_y, is_vp7);
2452 int jobnr,
int threadnr)
2458 int jobnr,
int threadnr)
2465 int threadnr,
int is_vp7)
2474 for (mb_y = jobnr; mb_y < s->
mb_height; mb_y += num_jobs) {
2494 int jobnr,
int threadnr)
2500 int jobnr,
int threadnr)
2511 int ret, i, referenced, num_jobs;
2540 for (i = 0; i < 5; i++)
2542 &s->
frames[i] != prev_frame &&
2558 "Discarding interframe without a prior keyframe!\n");
2563 curframe->tf.f->key_frame = s->
keyframe;
2590 s->
linesize = curframe->tf.f->linesize[0];
2663 #if CONFIG_VP7_DECODER
2708 if (CONFIG_VP7_DECODER && is_vp7) {
2713 }
else if (CONFIG_VP8_DECODER && !is_vp7) {
2731 #if CONFIG_VP7_DECODER
2743 #if CONFIG_VP8_DECODER
2759 #define REBASE(pic) ((pic) ? (pic) - &s_src->frames[0] + &s->frames[0] : NULL)
2774 s->
prob[0] = s_src->
prob[!s_src->update_probabilities];
2780 if (s_src->frames[i].tf.f->data[0]) {
2781 int ret = vp8_ref_frame(s, &s->
frames[i], &s_src->frames[i]);
2787 s->
framep[0] = REBASE(s_src->next_framep[0]);
2788 s->
framep[1] = REBASE(s_src->next_framep[1]);
2789 s->
framep[2] = REBASE(s_src->next_framep[2]);
2790 s->
framep[3] = REBASE(s_src->next_framep[3]);
2796 #if CONFIG_VP7_DECODER
2803 .
init = vp7_decode_init,
2805 .
decode = vp7_decode_frame,
2811 #if CONFIG_VP8_DECODER