Commit ae103195 authored by Jingning Han's avatar Jingning Han Committed by Paul Wilkins
Browse files

Make comp_inter_inter support 4x4 partition coding

This commit refactors the iterative motion search for compound
inter-inter mode, to make it support all partition types including
4x4/4x8/8x4 block sizes.

Change-Id: I5f1212b0f307377291763e45c6bdc9693b5f04c8
parent 33ecd6ad
...@@ -2104,26 +2104,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2104,26 +2104,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (is_comp_pred) { if (is_comp_pred) {
if (cpi->sf.comp_inter_joint_serach) { if (cpi->sf.comp_inter_joint_serach) {
const int b_sz[BLOCK_SIZE_TYPES][2] = { int pw = 4 << b_width_log2(bsize), ph = 4 << b_height_log2(bsize);
{4, 4},
{4, 8},
{8, 4},
{8, 8},
{8, 16},
{16, 8},
{16, 16},
{16, 32},
{32, 16},
{32, 32},
{32, 64},
{64, 32},
{64, 64}
};
int ite; int ite;
// Prediction buffer from second frame. // Prediction buffer from second frame.
uint8_t *second_pred = vpx_memalign(16, b_sz[bsize][0] * uint8_t *second_pred = vpx_memalign(16, pw * ph * sizeof(uint8_t));
b_sz[bsize][1] * sizeof(uint8_t));
// Do joint motion search in compound mode to get more accurate mv. // Do joint motion search in compound mode to get more accurate mv.
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}}; struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
...@@ -2186,10 +2170,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2186,10 +2170,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// Get pred block from second frame. // Get pred block from second frame.
vp9_build_inter_predictor(ref_yv12[!id].buf, vp9_build_inter_predictor(ref_yv12[!id].buf,
ref_yv12[!id].stride, ref_yv12[!id].stride,
second_pred, b_sz[bsize][0], second_pred, pw,
&frame_mv[NEWMV][refs[!id]], &frame_mv[NEWMV][refs[!id]],
&xd->scale_factor[!id], &xd->scale_factor[!id],
b_sz[bsize][0], b_sz[bsize][1], 0, pw, ph, 0,
&xd->subpix); &xd->subpix);
// Compound motion search on first ref frame. // Compound motion search on first ref frame.
...@@ -2209,7 +2193,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2209,7 +2193,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
&cpi->fn_ptr[block_size], &cpi->fn_ptr[block_size],
x->nmvjointcost, x->mvcost, x->nmvjointcost, x->mvcost,
&ref_mv[id], second_pred, &ref_mv[id], second_pred,
b_sz[bsize][0], b_sz[bsize][1]); pw, ph);
x->mv_col_min = tmp_col_min; x->mv_col_min = tmp_col_min;
x->mv_col_max = tmp_col_max; x->mv_col_max = tmp_col_max;
...@@ -2226,8 +2210,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2226,8 +2210,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
&cpi->fn_ptr[block_size], &cpi->fn_ptr[block_size],
x->nmvjointcost, x->mvcost, x->nmvjointcost, x->mvcost,
&dis, &sse, second_pred, &dis, &sse, second_pred,
b_sz[bsize][0], pw, ph);
b_sz[bsize][1]);
} }
if (id) if (id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment