summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2015-09-08 14:48:33 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2015-09-16 19:35:54 -0400
commit50f944272cedc7b150963f5e9492f2ba99244634 (patch)
treeea42851fa3cf8541c77909ea5dae31012581dc07
parented29c2f94599d2a0eb31ba2c6595bb3d514bbaea (diff)
downloadlibvpx-50f944272cedc7b150963f5e9492f2ba99244634.tar
libvpx-50f944272cedc7b150963f5e9492f2ba99244634.tar.gz
libvpx-50f944272cedc7b150963f5e9492f2ba99244634.tar.bz2
libvpx-50f944272cedc7b150963f5e9492f2ba99244634.zip
vp10: do sub8x8 block reconstruction in full subblocks.
This means that we don't reconstruct in 4x4 dimensions, but in blocksize dimensions, e.g. 4x8 or 8x4. This may in some cases lead to performance improvements. Also, if we decide to re-introduce scalable coding support, this would fix the fact that you need to re-scale the MV halfway the block in sub8x8 non-4x4 blocks. See issue 1013. Change-Id: If39c890cad20dff96635720d8c75b910cafac495
-rw-r--r--vp10/common/reconinter.c20
-rw-r--r--vp10/decoder/decodeframe.c9
2 files changed, 21 insertions, 8 deletions
diff --git a/vp10/common/reconinter.c b/vp10/common/reconinter.c
index 18e29a917..97c4abc6a 100644
--- a/vp10/common/reconinter.c
+++ b/vp10/common/reconinter.c
@@ -135,20 +135,26 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
const int mi_x = mi_col * MI_SIZE;
const int mi_y = mi_row * MI_SIZE;
for (plane = plane_from; plane <= plane_to; ++plane) {
- const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize,
- &xd->plane[plane]);
- const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
- const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
- const int bw = 4 * num_4x4_w;
- const int bh = 4 * num_4x4_h;
+ const struct macroblockd_plane *pd = &xd->plane[plane];
+ const int bw = 4 * num_4x4_blocks_wide_lookup[bsize] >> pd->subsampling_x;
+ const int bh = 4 * num_4x4_blocks_high_lookup[bsize] >> pd->subsampling_y;
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
+ const PARTITION_TYPE bp = bsize - xd->mi[0]->mbmi.sb_type;
+ const int have_vsplit = bp != PARTITION_HORZ;
+ const int have_hsplit = bp != PARTITION_VERT;
+ const int num_4x4_w = 2 >> ((!have_vsplit) | pd->subsampling_x);
+ const int num_4x4_h = 2 >> ((!have_hsplit) | pd->subsampling_y);
+ const int pw = 8 >> (have_vsplit | pd->subsampling_x);
+ const int ph = 8 >> (have_hsplit | pd->subsampling_y);
int x, y;
+ assert(bp != PARTITION_NONE && bp < PARTITION_TYPES);
assert(bsize == BLOCK_8X8);
+ assert(pw * num_4x4_w == bw && ph * num_4x4_h == bh);
for (y = 0; y < num_4x4_h; ++y)
for (x = 0; x < num_4x4_w; ++x)
build_inter_predictors(xd, plane, y * 2 + x, bw, bh,
- 4 * x, 4 * y, 4, 4, mi_x, mi_y);
+ 4 * x, 4 * y, pw, ph, mi_x, mi_y);
} else {
build_inter_predictors(xd, plane, 0, bw, bh,
0, 0, bw, bh, mi_x, mi_y);
diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c
index d3c04784a..50d50f88e 100644
--- a/vp10/decoder/decodeframe.c
+++ b/vp10/decoder/decodeframe.c
@@ -707,12 +707,19 @@ static void dec_build_inter_predictors_sb(VP10Decoder *const pbi,
const int is_scaled = vp10_is_scaled(sf);
if (sb_type < BLOCK_8X8) {
+ const PARTITION_TYPE bp = BLOCK_8X8 - sb_type;
+ const int have_vsplit = bp != PARTITION_HORZ;
+ const int have_hsplit = bp != PARTITION_VERT;
+ const int num_4x4_w = 2 >> ((!have_vsplit) | pd->subsampling_x);
+ const int num_4x4_h = 2 >> ((!have_hsplit) | pd->subsampling_y);
+ const int pw = 8 >> (have_vsplit | pd->subsampling_x);
+ const int ph = 8 >> (have_hsplit | pd->subsampling_y);
int x, y;
for (y = 0; y < num_4x4_h; ++y) {
for (x = 0; x < num_4x4_w; ++x) {
const MV mv = average_split_mvs(pd, mi, ref, y * 2 + x);
dec_build_inter_predictors(pbi, xd, plane, n4w_x4, n4h_x4,
- 4 * x, 4 * y, 4, 4, mi_x, mi_y, kernel,
+ 4 * x, 4 * y, pw, ph, mi_x, mi_y, kernel,
sf, pre_buf, dst_buf, &mv,
ref_frame_buf, is_scaled, ref);
}