summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2013-05-22 21:09:28 -0700
committerPaul Wilkins <paulwilkins@google.com>2013-05-23 13:13:42 +0100
commitae1031952003af1ba1ceaa11f211c05920c76a83 (patch)
tree93d7d72ba180451ff93d729974e63bfc8a61e823 /vp9/encoder
parent33ecd6ad548f9e8c34c695fcef0c822164ec9fae (diff)
downloadlibvpx-ae1031952003af1ba1ceaa11f211c05920c76a83.tar
libvpx-ae1031952003af1ba1ceaa11f211c05920c76a83.tar.gz
libvpx-ae1031952003af1ba1ceaa11f211c05920c76a83.tar.bz2
libvpx-ae1031952003af1ba1ceaa11f211c05920c76a83.zip
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
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_rdopt.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 815fa05d7..1ca323e72 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2104,26 +2104,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (is_comp_pred) {
if (cpi->sf.comp_inter_joint_serach) {
- const int b_sz[BLOCK_SIZE_TYPES][2] = {
- {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 pw = 4 << b_width_log2(bsize), ph = 4 << b_height_log2(bsize);
int ite;
// Prediction buffer from second frame.
- uint8_t *second_pred = vpx_memalign(16, b_sz[bsize][0] *
- b_sz[bsize][1] * sizeof(uint8_t));
+ uint8_t *second_pred = vpx_memalign(16, pw * ph * sizeof(uint8_t));
// Do joint motion search in compound mode to get more accurate mv.
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
@@ -2186,10 +2170,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// Get pred block from second frame.
vp9_build_inter_predictor(ref_yv12[!id].buf,
ref_yv12[!id].stride,
- second_pred, b_sz[bsize][0],
+ second_pred, pw,
&frame_mv[NEWMV][refs[!id]],
&xd->scale_factor[!id],
- b_sz[bsize][0], b_sz[bsize][1], 0,
+ pw, ph, 0,
&xd->subpix);
// Compound motion search on first ref frame.
@@ -2209,7 +2193,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
&cpi->fn_ptr[block_size],
x->nmvjointcost, x->mvcost,
&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_max = tmp_col_max;
@@ -2226,8 +2210,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
&cpi->fn_ptr[block_size],
x->nmvjointcost, x->mvcost,
&dis, &sse, second_pred,
- b_sz[bsize][0],
- b_sz[bsize][1]);
+ pw, ph);
}
if (id)