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++)
224 for (i = 0; i < 4; i++)
227 for (i = 0; i < 4; i++)
231 for (i = 0; i < 3; i++)
240 for (i = 0; i < 4; i++) {
273 if (buf_size - size < 0)
316 for (i = 0; i < 4; i++) {
369 for (i = 0; i < 4; i++)
370 for (j = 0; j < 16; j++)
380 for (i = 0; i < 4; i++)
381 for (j = 0; j < 8; j++)
382 for (k = 0; k < 3; k++)
391 #define VP7_MVC_SIZE 17
392 #define VP8_MVC_SIZE 19
401 for (i = 0; i < 4; i++)
404 for (i = 0; i < 3; i++)
408 for (i = 0; i < 2; i++)
409 for (j = 0; j < mvc_size; j++)
429 for (j = 1; j < 3; j++) {
430 for (i = 0; i < height / 2; i++)
437 const uint8_t *src,
int src_linesize,
442 for (j = 0; j <
height; j++) {
443 for (i = 0; i <
width; i++) {
444 uint8_t y = src[j * src_linesize + i];
445 dst[j * dst_linesize + i] = av_clip_uint8(y + ((y * beta) >> 8) + alpha);
456 if (!s->
keyframe && (alpha || beta)) {
483 width, height, alpha, beta);
492 int part1_size, hscale, vscale, i, j,
ret;
496 s->
profile = (buf[0] >> 1) & 7;
504 part1_size =
AV_RL24(buf) >> 4;
506 if (buf_size < 4 - s->
profile + part1_size) {
518 buf_size -= part1_size;
526 if (hscale || vscale)
535 for (i = 0; i < 2; i++)
547 for (i = 0; i < 4; i++) {
552 for (j = 0; j < 3; j++)
557 for (j = 0; j < 4; j++)
611 for (i = 1; i < 16; i++)
638 int header_size, hscale, vscale,
ret;
645 header_size =
AV_RL24(buf) >> 5;
659 if (header_size > buf_size - 7 * s->
keyframe) {
665 if (
AV_RL24(buf) != 0x2a019d) {
667 "Invalid start code 0x%x\n",
AV_RL24(buf));
670 width =
AV_RL16(buf + 3) & 0x3fff;
671 height =
AV_RL16(buf + 5) & 0x3fff;
672 hscale = buf[4] >> 6;
673 vscale = buf[6] >> 6;
677 if (hscale || vscale)
694 buf_size -= header_size;
774 for (i = 0; i < 3; i++)
776 for (i = (vp7 ? 7 : 9); i > 3; i--)
831 const uint8_t *mbsplits_top, *mbsplits_cur, *firstidx;
841 top_mv = top_mb->
bmv;
857 for (n = 0; n < num; n++) {
859 uint32_t left, above;
863 left =
AV_RN32A(&left_mv[mbsplits_left[k + 3]]);
865 left =
AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]);
867 above =
AV_RN32A(&top_mv[mbsplits_top[k + 12]]);
869 above =
AV_RN32A(&cur_mv[mbsplits_cur[k - 4]]);
906 int xoffset,
int yoffset,
int boundary,
907 int *edge_x,
int *edge_y)
909 int vwidth = mb_width + 1;
910 int new = (mb_y + yoffset) * vwidth + mb_x + xoffset;
911 if (
new < boundary ||
new % vwidth == vwidth - 1)
913 *edge_y =
new / vwidth;
914 *edge_x =
new % vwidth;
925 int mb_x,
int mb_y,
int layout)
928 enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR };
929 enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
953 if (
AV_RN32A(&near_mv[CNT_NEAREST])) {
954 if (mv ==
AV_RN32A(&near_mv[CNT_NEAREST])) {
956 }
else if (
AV_RN32A(&near_mv[CNT_NEAR])) {
957 if (mv !=
AV_RN32A(&near_mv[CNT_NEAR]))
965 AV_WN32A(&near_mv[CNT_NEAREST], mv);
986 if (cnt[CNT_NEAREST] > cnt[CNT_NEAR])
987 AV_WN32A(&mb->
mv, cnt[CNT_ZERO] > cnt[CNT_NEAREST] ? 0 :
AV_RN32A(&near_mv[CNT_NEAREST]));
1000 mb->
mv = near_mv[CNT_NEAR];
1001 mb->
bmv[0] = mb->
mv;
1004 mb->
mv = near_mv[CNT_NEAREST];
1005 mb->
bmv[0] = mb->
mv;
1010 mb->
bmv[0] = mb->
mv;
1016 int mb_x,
int mb_y,
int layout)
1021 enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
1022 enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
1031 mb_edge[0] = mb + 2;
1032 mb_edge[2] = mb + 1;
1043 #define MV_EDGE_CHECK(n) \
1045 VP8Macroblock *edge = mb_edge[n]; \
1046 int edge_ref = edge->ref_frame; \
1047 if (edge_ref != VP56_FRAME_CURRENT) { \
1048 uint32_t mv = AV_RN32A(&edge->mv); \
1050 if (cur_sign_bias != sign_bias[edge_ref]) { \
1053 mv = ((mv & 0x7fff7fff) + \
1054 0x00010001) ^ (mv & 0x80008000); \
1056 if (!n || mv != AV_RN32A(&near_mv[idx])) \
1057 AV_WN32A(&near_mv[++idx], mv); \
1058 cnt[idx] += 1 + (n != 2); \
1060 cnt[CNT_ZERO] += 1 + (n != 2); \
1073 if (cnt[CNT_SPLITMV] &&
1074 AV_RN32A(&near_mv[1 + VP8_EDGE_TOP]) ==
AV_RN32A(&near_mv[1 + VP8_EDGE_TOPLEFT]))
1075 cnt[CNT_NEAREST] += 1;
1078 if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) {
1080 FFSWAP(
VP56mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]);
1086 clamp_mv(s, &mb->
mv, &near_mv[CNT_ZERO + (cnt[CNT_NEAREST] >= cnt[CNT_ZERO])]);
1097 mb->
bmv[0] = mb->
mv;
1101 mb->
bmv[0] = mb->
mv;
1105 mb->
bmv[0] = mb->
mv;
1110 mb->
bmv[0] = mb->
mv;
1116 int mb_x,
int keyframe,
int layout)
1132 for (y = 0; y < 4; y++) {
1133 for (x = 0; x < 4; x++) {
1137 left[
y] = top[x] = *intra4x4;
1143 for (i = 0; i < 16; i++)
1154 const char *vp7_feature_name[] = {
"q-index",
1156 "partial-golden-update",
1161 for (i = 0; i < 4; i++) {
1167 "Feature %s present in macroblock (value 0x%x)\n",
1176 *segment = ref ? *ref : *segment;
1243 int i,
uint8_t *token_prob, int16_t qmul[2],
1244 const uint8_t scan[16],
int vp7)
1258 token_prob = probs[i][0];
1266 token_prob = probs[i + 1][1];
1286 int cat = (a << 1) + b;
1287 coeff = 3 + (8 << cat);
1291 token_prob = probs[i + 1][2];
1303 int16_t
dc = block[0];
1312 block[0] = pred[0] =
dc;
1317 block[0] = pred[0] =
dc;
1331 token_prob, qmul, scan,
IS_VP7);
1334 #ifndef vp8_decode_block_coeffs_internal
1362 int i,
int zero_nhood, int16_t qmul[2],
1363 const uint8_t scan[16],
int vp7)
1365 uint8_t *token_prob = probs[i][zero_nhood];
1369 token_prob, qmul, scan)
1379 int i, x,
y, luma_start = 0, luma_ctx = 3;
1380 int nnz_pred, nnz, nnz_total = 0;
1385 nnz_pred = t_nnz[8] + l_nnz[8];
1391 l_nnz[8] = t_nnz[8] = !!nnz;
1411 for (y = 0; y < 4; y++)
1412 for (x = 0; x < 4; x++) {
1413 nnz_pred = l_nnz[
y] + t_nnz[x];
1416 luma_start, nnz_pred,
1422 t_nnz[x] = l_nnz[
y] = !!nnz;
1429 for (i = 4; i < 6; i++)
1430 for (y = 0; y < 2; y++)
1431 for (x = 0; x < 2; x++) {
1432 nnz_pred = l_nnz[i + 2 *
y] + t_nnz[i + 2 * x];
1438 t_nnz[i + 2 * x] = l_nnz[i + 2 *
y] = !!nnz;
1452 int linesize,
int uvlinesize,
int simple)
1454 AV_COPY128(top_border, src_y + 15 * linesize);
1456 AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
1457 AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
1463 uint8_t *src_cr,
int linesize,
int uvlinesize,
int mb_x,
1464 int mb_y,
int mb_width,
int simple,
int xchg)
1466 uint8_t *top_border_m1 = top_border - 32;
1468 src_cb -= uvlinesize;
1469 src_cr -= uvlinesize;
1471 #define XCHG(a, b, xchg) \
1479 XCHG(top_border_m1 + 8, src_y - 8, xchg);
1480 XCHG(top_border, src_y, xchg);
1481 XCHG(top_border + 8, src_y + 8, 1);
1482 if (mb_x < mb_width - 1)
1483 XCHG(top_border + 32, src_y + 16, 1);
1487 if (!simple || !mb_y) {
1488 XCHG(top_border_m1 + 16, src_cb - 8, xchg);
1489 XCHG(top_border_m1 + 24, src_cr - 8, xchg);
1490 XCHG(top_border + 16, src_cb, 1);
1491 XCHG(top_border + 24, src_cr, 1);
1541 int *copy_buf,
int vp7)
1545 if (!mb_x && mb_y) {
1579 int x,
y,
mode, nnz;
1595 const uint8_t lo = is_vp7 ? 128 : 127;
1596 const uint8_t hi = is_vp7 ? 128 : 129;
1597 uint8_t tr_top[4] = { lo, lo, lo, lo };
1605 if (mb_y && mb_x == s->
mb_width - 1) {
1606 tr = tr_right[-1] * 0x01010101
u;
1613 for (y = 0; y < 4; y++) {
1615 for (x = 0; x < 4; x++) {
1620 if ((y == 0 || x == 3) && mb_y == 0) {
1623 topright = tr_right;
1626 mb_y + y, ©, is_vp7);
1628 dst = copy_dst + 12;
1632 AV_WN32A(copy_dst + 4, lo * 0x01010101U);
1638 copy_dst[3] = ptr[4 * x - s->
linesize - 1];
1647 copy_dst[11] = ptr[4 * x - 1];
1648 copy_dst[19] = ptr[4 * x + s->
linesize - 1];
1649 copy_dst[27] = ptr[4 * x + s->
linesize * 2 - 1];
1650 copy_dst[35] = ptr[4 * x + s->
linesize * 3 - 1];
1679 mb_x, mb_y, is_vp7);
1690 { 0, 1, 2, 1, 2, 1, 2, 1 },
1692 { 0, 3, 5, 3, 5, 3, 5, 3 },
1693 { 0, 2, 3, 2, 3, 2, 3, 2 },
1715 int x_off,
int y_off,
int block_w,
int block_h,
1722 int src_linesize = linesize;
1724 int mx = (mv->
x << 1) & 7, mx_idx = subpel_idx[0][mx];
1725 int my = (mv->
y << 1) & 7, my_idx = subpel_idx[0][my];
1727 x_off += mv->
x >> 2;
1728 y_off += mv->
y >> 2;
1732 src += y_off * linesize + x_off;
1733 if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
1734 y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
1736 src - my_idx * linesize - mx_idx,
1738 block_w + subpel_idx[1][mx],
1739 block_h + subpel_idx[1][my],
1740 x_off - mx_idx, y_off - my_idx,
1745 mc_func[my_idx][mx_idx](dst, linesize,
src, src_linesize, block_h, mx, my);
1748 mc_func[0][0](dst, linesize, src + y_off * linesize + x_off,
1749 linesize, block_h, 0, 0);
1773 int x_off,
int y_off,
int block_w,
int block_h,
1780 int mx = mv->
x & 7, mx_idx = subpel_idx[0][mx];
1781 int my = mv->
y & 7, my_idx = subpel_idx[0][my];
1783 x_off += mv->
x >> 3;
1784 y_off += mv->
y >> 3;
1787 src1 += y_off * linesize + x_off;
1788 src2 += y_off * linesize + x_off;
1790 if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
1791 y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
1793 src1 - my_idx * linesize - mx_idx,
1795 block_w + subpel_idx[1][mx],
1796 block_h + subpel_idx[1][my],
1797 x_off - mx_idx, y_off - my_idx, width, height);
1799 mc_func[my_idx][mx_idx](dst1, linesize, src1,
EDGE_EMU_LINESIZE, block_h, mx, my);
1802 src2 - my_idx * linesize - mx_idx,
1803 EDGE_EMU_LINESIZE, linesize,
1804 block_w + subpel_idx[1][mx],
1805 block_h + subpel_idx[1][my],
1806 x_off - mx_idx, y_off - my_idx, width, height);
1808 mc_func[my_idx][mx_idx](dst2, linesize, src2,
EDGE_EMU_LINESIZE, block_h, mx, my);
1810 mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my);
1811 mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my);
1815 mc_func[0][0](dst1, linesize, src1 + y_off * linesize + x_off, linesize, block_h, 0, 0);
1816 mc_func[0][0](dst2, linesize, src2 + y_off * linesize + x_off, linesize, block_h, 0, 0);
1823 int bx_off,
int by_off,
int block_w,
int block_h,
1830 ref_frame, mv, x_off + bx_off, y_off + by_off,
1831 block_w, block_h, width, height, s->
linesize,
1850 dst[2] + by_off * s->
uvlinesize + bx_off, ref_frame,
1851 &uvmv, x_off + bx_off, y_off + by_off,
1852 block_w, block_h, width, height, s->
uvlinesize,
1863 if (s->
ref_count[ref - 1] > (mb_xy >> 5)) {
1864 int x_off = mb_x << 4, y_off = mb_y << 4;
1865 int mx = (mb->
mv.
x >> 2) + x_off + 8;
1866 int my = (mb->
mv.
y >> 2) + y_off;
1868 int off = mx + (my + (mb_x & 3) * 4) * s->
linesize + 64;
1873 off = (mx >> 1) + ((my >> 1) + (mb_x & 7)) * s->
uvlinesize + 64;
1885 int x_off = mb_x << 4, y_off = mb_y << 4;
1893 0, 0, 16, 16, width,
height, &mb->
mv);
1900 for (y = 0; y < 4; y++) {
1901 for (x = 0; x < 4; x++) {
1903 ref, &bmv[4 * y + x],
1904 4 * x + x_off, 4 * y + y_off, 4, 4,
1915 for (y = 0; y < 2; y++) {
1916 for (x = 0; x < 2; x++) {
1917 uvmv.
x = mb->
bmv[2 * y * 4 + 2 * x ].
x +
1918 mb->
bmv[2 * y * 4 + 2 * x + 1].
x +
1919 mb->
bmv[(2 * y + 1) * 4 + 2 * x ].x +
1920 mb->
bmv[(2 * y + 1) * 4 + 2 * x + 1].
x;
1921 uvmv.
y = mb->
bmv[2 * y * 4 + 2 * x ].
y +
1922 mb->
bmv[2 * y * 4 + 2 * x + 1].
y +
1923 mb->
bmv[(2 * y + 1) * 4 + 2 * x ].y +
1924 mb->
bmv[(2 * y + 1) * 4 + 2 * x + 1].
y;
1933 &uvmv, 4 * x + x_off, 4 * y + y_off, 4, 4,
1942 0, 0, 16, 8, width,
height, &bmv[0]);
1944 0, 8, 16, 8, width,
height, &bmv[1]);
1948 0, 0, 8, 16, width,
height, &bmv[0]);
1950 8, 0, 8, 16, width,
height, &bmv[1]);
1954 0, 0, 8, 8, width,
height, &bmv[0]);
1956 8, 0, 8, 8, width,
height, &bmv[1]);
1958 0, 8, 8, 8, width,
height, &bmv[2]);
1960 8, 8, 8, 8, width,
height, &bmv[3]);
1972 for (y = 0; y < 4; y++) {
1975 if (nnz4 & ~0x01010101) {
1976 for (x = 0; x < 4; x++) {
1997 for (ch = 0; ch < 2; ch++) {
2000 uint8_t *ch_dst = dst[1 + ch];
2001 if (nnz4 & ~0x01010101) {
2002 for (y = 0; y < 2; y++) {
2003 for (x = 0; x < 2; x++) {
2006 td->
block[4 + ch][(y << 1) + x],
2010 td->
block[4 + ch][(y << 1) + x],
2014 goto chroma_idct_end;
2031 int interior_limit, filter_level;
2045 filter_level = av_clip_uintp2(filter_level, 6);
2047 interior_limit = filter_level;
2052 interior_limit =
FFMAX(interior_limit, 1);
2062 int mb_x,
int mb_y,
int is_vp7)
2064 int mbedge_lim, bedge_lim_y, bedge_lim_uv, hev_thresh;
2070 static const uint8_t hev_thresh_lut[2][64] = {
2071 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2072 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2073 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2075 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2076 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2077 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2085 bedge_lim_y = filter_level;
2086 bedge_lim_uv = filter_level * 2;
2087 mbedge_lim = filter_level + 2;
2090 bedge_lim_uv = filter_level * 2 + inner_limit;
2091 mbedge_lim = bedge_lim_y + 4;
2094 hev_thresh = hev_thresh_lut[s->
keyframe][filter_level];
2098 mbedge_lim, inner_limit, hev_thresh);
2100 mbedge_lim, inner_limit, hev_thresh);
2103 #define H_LOOP_FILTER_16Y_INNER(cond) \
2104 if (cond && inner_filter) { \
2105 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 4, linesize, \
2106 bedge_lim_y, inner_limit, \
2108 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 8, linesize, \
2109 bedge_lim_y, inner_limit, \
2111 s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 12, linesize, \
2112 bedge_lim_y, inner_limit, \
2114 s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4, \
2115 uvlinesize, bedge_lim_uv, \
2116 inner_limit, hev_thresh); \
2123 mbedge_lim, inner_limit, hev_thresh);
2125 mbedge_lim, inner_limit, hev_thresh);
2130 linesize, bedge_lim_y,
2131 inner_limit, hev_thresh);
2133 linesize, bedge_lim_y,
2134 inner_limit, hev_thresh);
2136 linesize, bedge_lim_y,
2137 inner_limit, hev_thresh);
2139 dst[2] + 4 * uvlinesize,
2140 uvlinesize, bedge_lim_uv,
2141 inner_limit, hev_thresh);
2151 int mbedge_lim, bedge_lim;
2160 bedge_lim = 2 * filter_level + inner_limit;
2161 mbedge_lim = bedge_lim + 4;
2180 #define MARGIN (16 << 2)
2190 for (mb_y = 0; mb_y < s->
mb_height; mb_y++) {
2192 ((s->
mb_width + 1) * (mb_y + 1) + 1);
2199 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_xy++, mb++) {
2204 prev_frame && prev_frame->
seg_map ?
2227 #define check_thread_pos(td, otd, mb_x_check, mb_y_check) \
2229 int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF); \
2230 if (otd->thread_mb_pos < tmp) { \
2231 pthread_mutex_lock(&otd->lock); \
2232 td->wait_mb_pos = tmp; \
2234 if (otd->thread_mb_pos >= tmp) \
2236 pthread_cond_wait(&otd->cond, &otd->lock); \
2238 td->wait_mb_pos = INT_MAX; \
2239 pthread_mutex_unlock(&otd->lock); \
2243 #define update_pos(td, mb_y, mb_x) \
2245 int pos = (mb_y << 16) | (mb_x & 0xFFFF); \
2246 int sliced_threading = (avctx->active_thread_type == FF_THREAD_SLICE) && \
2248 int is_null = !next_td || !prev_td; \
2249 int pos_check = (is_null) ? 1 \
2250 : (next_td != td && \
2251 pos >= next_td->wait_mb_pos) || \
2253 pos >= prev_td->wait_mb_pos); \
2254 td->thread_mb_pos = pos; \
2255 if (sliced_threading && pos_check) { \
2256 pthread_mutex_lock(&td->lock); \
2257 pthread_cond_broadcast(&td->cond); \
2258 pthread_mutex_unlock(&td->lock); \
2262 #define check_thread_pos(td, otd, mb_x_check, mb_y_check)
2263 #define update_pos(td, mb_y, mb_x)
2267 int jobnr,
int threadnr,
int is_vp7)
2272 int mb_x, mb_xy = mb_y * s->
mb_width;
2285 prev_td = &s->
thread_data[(jobnr + num_jobs - 1) % num_jobs];
2289 next_td = &s->
thread_data[(jobnr + 1) % num_jobs];
2299 memset(mb - 1, 0,
sizeof(*mb));
2303 if (!is_vp7 || mb_y == 0)
2309 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_xy++, mb++) {
2311 if (prev_td != td) {
2312 if (threadnr != 0) {
2314 mb_x + (is_vp7 ? 2 : 1),
2315 mb_y - (is_vp7 ? 2 : 1));
2318 mb_x + (is_vp7 ? 2 : 1) + s->
mb_width + 3,
2319 mb_y - (is_vp7 ? 2 : 1));
2326 dst[2] - dst[1], 2);
2330 prev_frame && prev_frame->seg_map ?
2331 prev_frame->seg_map->data + mb_xy :
NULL, 0, is_vp7);
2362 if (s->
deblock_filter && num_jobs != 1 && threadnr == num_jobs - 1) {
2388 int jobnr,
int threadnr)
2394 int jobnr,
int threadnr)
2400 int jobnr,
int threadnr,
int is_vp7)
2422 prev_td = &s->
thread_data[(jobnr + num_jobs - 1) % num_jobs];
2426 next_td = &s->
thread_data[(jobnr + 1) % num_jobs];
2428 for (mb_x = 0; mb_x < s->
mb_width; mb_x++, mb++) {
2432 (mb_x + 1) + (s->
mb_width + 3), mb_y - 1);
2437 if (num_jobs == 1) {
2449 filter_mb(s, dst, f, mb_x, mb_y, is_vp7);
2459 int jobnr,
int threadnr)
2465 int jobnr,
int threadnr)
2472 int threadnr,
int is_vp7)
2481 for (mb_y = jobnr; mb_y < s->
mb_height; mb_y += num_jobs) {
2501 int jobnr,
int threadnr)
2507 int jobnr,
int threadnr)
2518 int ret, i, referenced, num_jobs;
2547 for (i = 0; i < 5; i++)
2549 &s->
frames[i] != prev_frame &&
2572 "Discarding interframe without a prior keyframe!\n");
2577 curframe->tf.f->key_frame = s->
keyframe;
2604 s->
linesize = curframe->tf.f->linesize[0];
2677 #if CONFIG_VP7_DECODER
2722 if (CONFIG_VP7_DECODER && is_vp7) {
2727 }
else if (CONFIG_VP8_DECODER && !is_vp7) {
2745 #if CONFIG_VP7_DECODER
2757 #if CONFIG_VP8_DECODER
2773 #define REBASE(pic) ((pic) ? (pic) - &s_src->frames[0] + &s->frames[0] : NULL)
2788 s->
prob[0] = s_src->
prob[!s_src->update_probabilities];
2794 if (s_src->frames[i].tf.f->data[0]) {
2795 int ret = vp8_ref_frame(s, &s->
frames[i], &s_src->frames[i]);
2801 s->
framep[0] = REBASE(s_src->next_framep[0]);
2802 s->
framep[1] = REBASE(s_src->next_framep[1]);
2803 s->
framep[2] = REBASE(s_src->next_framep[2]);
2804 s->
framep[3] = REBASE(s_src->next_framep[3]);
2810 #if CONFIG_VP7_DECODER
2817 .
init = vp7_decode_init,
2819 .
decode = vp7_decode_frame,
2825 #if CONFIG_VP8_DECODER