|
|
|
@ -27,19 +27,19 @@ |
|
|
|
|
(VP56mv) { .x = ROUNDED_DIV(a.x + b.x + c.x + d.x, 4), \
|
|
|
|
|
.y = ROUNDED_DIV(a.y + b.y + c.y + d.y, 4) } |
|
|
|
|
|
|
|
|
|
static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
static void FN(inter_pred)(VP9TileData *td) |
|
|
|
|
{ |
|
|
|
|
static const uint8_t bwlog_tab[2][N_BS_SIZES] = { |
|
|
|
|
{ 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, |
|
|
|
|
{ 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, |
|
|
|
|
}; |
|
|
|
|
VP9Context *s = avctx->priv_data; |
|
|
|
|
VP9Block *b = s->b; |
|
|
|
|
int row = s->row, col = s->col; |
|
|
|
|
VP9Context *s = td->s; |
|
|
|
|
VP9Block *b = td->b; |
|
|
|
|
int row = td->row, col = td->col; |
|
|
|
|
ThreadFrame *tref1 = &s->s.refs[s->s.h.refidx[b->ref[0]]], *tref2; |
|
|
|
|
AVFrame *ref1 = tref1->f, *ref2; |
|
|
|
|
int w1 = ref1->width, h1 = ref1->height, w2, h2; |
|
|
|
|
ptrdiff_t ls_y = s->y_stride, ls_uv = s->uv_stride; |
|
|
|
|
ptrdiff_t ls_y = td->y_stride, ls_uv = td->uv_stride; |
|
|
|
|
int bytesperpixel = BYTES_PER_PIXEL; |
|
|
|
|
|
|
|
|
|
if (b->comp) { |
|
|
|
@ -55,26 +55,26 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
|
|
|
|
|
#if SCALED == 0 |
|
|
|
|
if (b->bs == BS_8x4) { |
|
|
|
|
mc_luma_dir(s, mc[3][b->filter][0], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[3][b->filter][0], td->dst[0], ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
row << 3, col << 3, &b->mv[0][0],,,,, 8, 4, w1, h1, 0); |
|
|
|
|
mc_luma_dir(s, mc[3][b->filter][0], |
|
|
|
|
s->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[3][b->filter][0], |
|
|
|
|
td->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
(row << 3) + 4, col << 3, &b->mv[2][0],,,,, 8, 4, w1, h1, 0); |
|
|
|
|
w1 = (w1 + s->ss_h) >> s->ss_h; |
|
|
|
|
if (s->ss_v) { |
|
|
|
|
h1 = (h1 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]); |
|
|
|
|
mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 2, col << (3 - s->ss_h), |
|
|
|
|
&uvmv,,,,, 8 >> s->ss_h, 4, w1, h1, 0); |
|
|
|
|
} else { |
|
|
|
|
mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 3, col << (3 - s->ss_h), |
|
|
|
@ -87,8 +87,8 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
} else { |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]); |
|
|
|
|
} |
|
|
|
|
mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
(row << 3) + 4, col << (3 - s->ss_h), |
|
|
|
@ -96,26 +96,26 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (b->comp) { |
|
|
|
|
mc_luma_dir(s, mc[3][b->filter][1], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[3][b->filter][1], td->dst[0], ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
row << 3, col << 3, &b->mv[0][1],,,,, 8, 4, w2, h2, 1); |
|
|
|
|
mc_luma_dir(s, mc[3][b->filter][1], |
|
|
|
|
s->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[3][b->filter][1], |
|
|
|
|
td->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
(row << 3) + 4, col << 3, &b->mv[2][1],,,,, 8, 4, w2, h2, 1); |
|
|
|
|
w2 = (w2 + s->ss_h) >> s->ss_h; |
|
|
|
|
if (s->ss_v) { |
|
|
|
|
h2 = (h2 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]); |
|
|
|
|
mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 2, col << (3 - s->ss_h), |
|
|
|
|
&uvmv,,,,, 8 >> s->ss_h, 4, w2, h2, 1); |
|
|
|
|
} else { |
|
|
|
|
mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 3, col << (3 - s->ss_h), |
|
|
|
@ -128,8 +128,8 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
} else { |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]); |
|
|
|
|
} |
|
|
|
|
mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[3 + s->ss_h][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
(row << 3) + 4, col << (3 - s->ss_h), |
|
|
|
@ -137,32 +137,32 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (b->bs == BS_4x8) { |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][0], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][0], td->dst[0], ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
row << 3, col << 3, &b->mv[0][0],,,,, 4, 8, w1, h1, 0); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][0], s->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][0], td->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
row << 3, (col << 3) + 4, &b->mv[1][0],,,,, 4, 8, w1, h1, 0); |
|
|
|
|
h1 = (h1 + s->ss_v) >> s->ss_v; |
|
|
|
|
if (s->ss_h) { |
|
|
|
|
w1 = (w1 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[1][0]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << (3 - s->ss_v), col << 2, |
|
|
|
|
&uvmv,,,,, 4, 8 >> s->ss_v, w1, h1, 0); |
|
|
|
|
} else { |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << (3 - s->ss_v), col << 3, |
|
|
|
|
&b->mv[0][0],,,,, 4, 8 >> s->ss_v, w1, h1, 0); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << (3 - s->ss_v), (col << 3) + 4, |
|
|
|
@ -170,32 +170,32 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (b->comp) { |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][1], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][1], td->dst[0], ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
row << 3, col << 3, &b->mv[0][1],,,,, 4, 8, w2, h2, 1); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][1], s->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][1], td->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
row << 3, (col << 3) + 4, &b->mv[1][1],,,,, 4, 8, w2, h2, 1); |
|
|
|
|
h2 = (h2 + s->ss_v) >> s->ss_v; |
|
|
|
|
if (s->ss_h) { |
|
|
|
|
w2 = (w2 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[1][1]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << (3 - s->ss_v), col << 2, |
|
|
|
|
&uvmv,,,,, 4, 8 >> s->ss_v, w2, h2, 1); |
|
|
|
|
} else { |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << (3 - s->ss_v), col << 3, |
|
|
|
|
&b->mv[0][1],,,,, 4, 8 >> s->ss_v, w2, h2, 1); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << (3 - s->ss_v), (col << 3) + 4, |
|
|
|
@ -211,21 +211,21 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
|
|
|
|
|
// FIXME if two horizontally adjacent blocks have the same MV,
|
|
|
|
|
// do a w8 instead of a w4 call
|
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][0], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][0], td->dst[0], ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
row << 3, col << 3, &b->mv[0][0], |
|
|
|
|
0, 0, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][0], s->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][0], td->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
row << 3, (col << 3) + 4, &b->mv[1][0], |
|
|
|
|
4, 0, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
(row << 3) + 4, col << 3, &b->mv[2][0], |
|
|
|
|
0, 4, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
(row << 3) + 4, (col << 3) + 4, &b->mv[3][0], |
|
|
|
|
4, 4, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
@ -235,24 +235,24 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
w1 = (w1 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx4(b->mv[0][0], b->mv[1][0], |
|
|
|
|
b->mv[2][0], b->mv[3][0]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 2, col << 2, |
|
|
|
|
&uvmv, 0, 0, 4, 4, 4, 4, w1, h1, 0); |
|
|
|
|
} else { |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 2, col << 3, |
|
|
|
|
&uvmv, 0, 0, 8, 4, 4, 4, w1, h1, 0); |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[1][0], b->mv[3][0]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 2, (col << 3) + 4, |
|
|
|
@ -262,8 +262,8 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
if (s->ss_h) { |
|
|
|
|
w1 = (w1 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[1][0]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 3, col << 2, |
|
|
|
@ -272,35 +272,35 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
// bottom block
|
|
|
|
|
// https://code.google.com/p/webm/issues/detail?id=993
|
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[1][0], b->mv[2][0]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
(row << 3) + 4, col << 2, |
|
|
|
|
&uvmv, 0, 4, 4, 8, 4, 4, w1, h1, 0); |
|
|
|
|
} else { |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 3, col << 3, |
|
|
|
|
&b->mv[0][0], 0, 0, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << 3, (col << 3) + 4, |
|
|
|
|
&b->mv[1][0], 4, 0, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
(row << 3) + 4, col << 3, |
|
|
|
|
&b->mv[2][0], 0, 4, 8, 8, 4, 4, w1, h1, 0); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][0], |
|
|
|
|
s->dst[1] + 4 * ls_uv + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][0], |
|
|
|
|
td->dst[1] + 4 * ls_uv + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
(row << 3) + 4, (col << 3) + 4, |
|
|
|
@ -309,18 +309,18 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (b->comp) { |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][1], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][1], td->dst[0], ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
row << 3, col << 3, &b->mv[0][1], 0, 0, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][1], s->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][1], td->dst[0] + 4 * bytesperpixel, ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
row << 3, (col << 3) + 4, &b->mv[1][1], 4, 0, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[0] + 4 * ls_y, ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
(row << 3) + 4, col << 3, &b->mv[2][1], 0, 4, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
mc_luma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y, |
|
|
|
|
mc_luma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
(row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
if (s->ss_v) { |
|
|
|
@ -329,24 +329,24 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
w2 = (w2 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx4(b->mv[0][1], b->mv[1][1], |
|
|
|
|
b->mv[2][1], b->mv[3][1]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 2, col << 2, |
|
|
|
|
&uvmv, 0, 0, 4, 4, 4, 4, w2, h2, 1); |
|
|
|
|
} else { |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 2, col << 3, |
|
|
|
|
&uvmv, 0, 0, 8, 4, 4, 4, w2, h2, 1); |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[1][1], b->mv[3][1]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 2, (col << 3) + 4, |
|
|
|
@ -356,8 +356,8 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
if (s->ss_h) { |
|
|
|
|
w2 = (w2 + 1) >> 1; |
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[1][1]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 3, col << 2, |
|
|
|
@ -366,35 +366,35 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
// bottom block
|
|
|
|
|
// https://code.google.com/p/webm/issues/detail?id=993
|
|
|
|
|
uvmv = ROUNDED_DIV_MVx2(b->mv[1][1], b->mv[2][1]); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
(row << 3) + 4, col << 2, |
|
|
|
|
&uvmv, 0, 4, 4, 8, 4, 4, w2, h2, 1); |
|
|
|
|
} else { |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 3, col << 3, |
|
|
|
|
&b->mv[0][1], 0, 0, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << 3, (col << 3) + 4, |
|
|
|
|
&b->mv[1][1], 4, 0, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * ls_uv, td->dst[2] + 4 * ls_uv, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
(row << 3) + 4, col << 3, |
|
|
|
|
&b->mv[2][1], 0, 4, 8, 8, 4, 4, w2, h2, 1); |
|
|
|
|
mc_chroma_dir(s, mc[4][b->filter][1], |
|
|
|
|
s->dst[1] + 4 * ls_uv + 4 * bytesperpixel, |
|
|
|
|
s->dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[4][b->filter][1], |
|
|
|
|
td->dst[1] + 4 * ls_uv + 4 * bytesperpixel, |
|
|
|
|
td->dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
(row << 3) + 4, (col << 3) + 4, |
|
|
|
@ -410,26 +410,26 @@ static void FN(inter_pred)(AVCodecContext *avctx) |
|
|
|
|
int uvbw = ff_vp9_bwh_tab[s->ss_h][b->bs][0] * 4; |
|
|
|
|
int uvbh = ff_vp9_bwh_tab[s->ss_v][b->bs][1] * 4; |
|
|
|
|
|
|
|
|
|
mc_luma_dir(s, mc[bwl][b->filter][0], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[bwl][b->filter][0], td->dst[0], ls_y, |
|
|
|
|
ref1->data[0], ref1->linesize[0], tref1, |
|
|
|
|
row << 3, col << 3, &b->mv[0][0], 0, 0, bw, bh, bw, bh, w1, h1, 0); |
|
|
|
|
w1 = (w1 + s->ss_h) >> s->ss_h; |
|
|
|
|
h1 = (h1 + s->ss_v) >> s->ss_v; |
|
|
|
|
mc_chroma_dir(s, mc[bwl + s->ss_h][b->filter][0], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[bwl + s->ss_h][b->filter][0], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref1->data[1], ref1->linesize[1], |
|
|
|
|
ref1->data[2], ref1->linesize[2], tref1, |
|
|
|
|
row << (3 - s->ss_v), col << (3 - s->ss_h), |
|
|
|
|
&b->mv[0][0], 0, 0, uvbw, uvbh, uvbw, uvbh, w1, h1, 0); |
|
|
|
|
|
|
|
|
|
if (b->comp) { |
|
|
|
|
mc_luma_dir(s, mc[bwl][b->filter][1], s->dst[0], ls_y, |
|
|
|
|
mc_luma_dir(td, mc[bwl][b->filter][1], td->dst[0], ls_y, |
|
|
|
|
ref2->data[0], ref2->linesize[0], tref2, |
|
|
|
|
row << 3, col << 3, &b->mv[0][1], 0, 0, bw, bh, bw, bh, w2, h2, 1); |
|
|
|
|
w2 = (w2 + s->ss_h) >> s->ss_h; |
|
|
|
|
h2 = (h2 + s->ss_v) >> s->ss_v; |
|
|
|
|
mc_chroma_dir(s, mc[bwl + s->ss_h][b->filter][1], |
|
|
|
|
s->dst[1], s->dst[2], ls_uv, |
|
|
|
|
mc_chroma_dir(td, mc[bwl + s->ss_h][b->filter][1], |
|
|
|
|
td->dst[1], td->dst[2], ls_uv, |
|
|
|
|
ref2->data[1], ref2->linesize[1], |
|
|
|
|
ref2->data[2], ref2->linesize[2], tref2, |
|
|
|
|
row << (3 - s->ss_v), col << (3 - s->ss_h), |
|
|
|
|