Commit c7dc1d78 authored by Ronald S. Bultje's avatar Ronald S. Bultje

vp10: add extended-intra prediction edges experiment.

This experiment allows using full above/right edges for all transform
sizes whenever available (for d45/d63), and adds bottom/left edges for
d207.

See issue 1043.

Change-Id: I5cf7f345e783e8539bb6b6d2c9972fb1d6d0a78b
parent dea99899
......@@ -266,6 +266,7 @@ EXPERIMENT_LIST="
emulate_hardware
misc_fixes
universal_hp
ext_ipred_bltr
"
CONFIG_LIST="
dependency_tracking
......
......@@ -31,6 +31,8 @@ static const uint8_t num_4x4_blocks_high_lookup[BLOCK_SIZES] =
// Log 2 conversion lookup tables for modeinfo width and height
static const uint8_t mi_width_log2_lookup[BLOCK_SIZES] =
{0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3};
static const uint8_t mi_height_log2_lookup[BLOCK_SIZES] =
{0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3};
static const uint8_t num_8x8_blocks_wide_lookup[BLOCK_SIZES] =
{1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8};
static const uint8_t num_8x8_blocks_high_lookup[BLOCK_SIZES] =
......
This diff is collapsed.
......@@ -20,7 +20,7 @@ extern "C" {
void vp10_init_intra_predictors(void);
void vp10_predict_intra_block(const MACROBLOCKD *xd, int bwl_in,
void vp10_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int bhl_in,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride,
uint8_t *dst, int dst_stride,
......
......@@ -360,7 +360,7 @@ static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd,
if (plane == 0)
mode = xd->mi[0]->bmi[(row << 1) + col].as_mode;
vp10_predict_intra_block(xd, pd->n4_wl, tx_size, mode,
vp10_predict_intra_block(xd, pd->n4_wl, pd->n4_hl, tx_size, mode,
dst, pd->dst.stride, dst, pd->dst.stride,
col, row, plane);
......
......@@ -963,6 +963,7 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
const scan_order *const scan_order = get_scan(tx_size, tx_type);
PREDICTION_MODE mode;
const int bwl = b_width_log2_lookup[plane_bsize];
const int bhl = b_height_log2_lookup[plane_bsize];
const int diff_stride = 4 * (1 << bwl);
uint8_t *src, *dst;
int16_t *src_diff;
......@@ -976,7 +977,7 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
src_diff = &p->src_diff[4 * (j * diff_stride + i)];
mode = plane == 0 ? get_y_mode(xd->mi[0], block) : mbmi->uv_mode;
vp10_predict_intra_block(xd, bwl, tx_size, mode, dst, dst_stride,
vp10_predict_intra_block(xd, bwl, bhl, tx_size, mode, dst, dst_stride,
dst, dst_stride, i, j, plane);
#if CONFIG_VP9_HIGHBITDEPTH
......
......@@ -146,7 +146,7 @@ static int find_best_16x16_intra(VP10_COMP *cpi, PREDICTION_MODE *pbest_mode) {
unsigned int err;
xd->mi[0]->mbmi.mode = mode;
vp10_predict_intra_block(xd, 2, TX_16X16, mode,
vp10_predict_intra_block(xd, 2, 2, TX_16X16, mode,
x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
0, 0, 0);
......
......@@ -958,7 +958,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
p->src_diff);
tran_low_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
xd->mi[0]->bmi[block].as_mode = mode;
vp10_predict_intra_block(xd, 1, TX_4X4, mode, dst, dst_stride,
vp10_predict_intra_block(xd, 1, 1, TX_4X4, mode, dst, dst_stride,
dst, dst_stride,
col + idx, row + idy, 0);
vpx_highbd_subtract_block(4, 4, src_diff, 8, src, src_stride,
......@@ -1058,7 +1058,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
vp10_raster_block_offset_int16(BLOCK_8X8, block, p->src_diff);
tran_low_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
xd->mi[0]->bmi[block].as_mode = mode;
vp10_predict_intra_block(xd, 1, TX_4X4, mode, dst, dst_stride,
vp10_predict_intra_block(xd, 1, 1, TX_4X4, mode, dst, dst_stride,
dst, dst_stride, col + idx, row + idy, 0);
vpx_subtract_block(4, 4, src_diff, 8, src, src_stride, dst, dst_stride);
......
......@@ -29,7 +29,7 @@ void vp8_init_intra4x4_predictors_internal(void)
pred[B_LD_PRED] = vpx_d45e_predictor_4x4;
pred[B_RD_PRED] = vpx_d135_predictor_4x4;
pred[B_VR_PRED] = vpx_d117_predictor_4x4;
pred[B_VL_PRED] = vpx_d63e_predictor_4x4;
pred[B_VL_PRED] = vpx_d63f_predictor_4x4;
pred[B_HD_PRED] = vpx_d153_predictor_4x4;
pred[B_HU_PRED] = vpx_d207_predictor_4x4;
}
......
......@@ -44,6 +44,21 @@ static INLINE void d207_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
dst[r * stride + c] = dst[(r + 1) * stride + c - 2];
}
static INLINE void d207e_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
const uint8_t *above, const uint8_t *left) {
int r, c;
(void) above;
for (r = 0; r < bs; ++r) {
for (c = 0; c < bs; ++c) {
dst[c] = c & 1 ? AVG3(left[(c >> 1) + r], left[(c >> 1) + r + 1],
left[(c >> 1) + r + 2])
: AVG2(left[(c >> 1) + r], left[(c >> 1) + r + 1]);
}
dst += stride;
}
}
static INLINE void d63_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
const uint8_t *above, const uint8_t *left) {
int r, c;
......@@ -61,6 +76,20 @@ static INLINE void d63_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
}
}
static INLINE void d63e_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
const uint8_t *above, const uint8_t *left) {
int r, c;
(void) left;
for (r = 0; r < bs; ++r) {
for (c = 0; c < bs; ++c) {
dst[c] = r & 1 ? AVG3(above[(r >> 1) + c], above[(r >> 1) + c + 1],
above[(r >> 1) + c + 2])
: AVG2(above[(r >> 1) + c], above[(r >> 1) + c + 1]);
}
dst += stride;
}
}
static INLINE void d45_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
const uint8_t *above, const uint8_t *left) {
const uint8_t above_right = above[bs - 1];
......@@ -80,6 +109,19 @@ static INLINE void d45_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
}
}
static INLINE void d45e_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
const uint8_t *above, const uint8_t *left) {
int r, c;
(void) left;
for (r = 0; r < bs; ++r) {
for (c = 0; c < bs; ++c) {
dst[c] = AVG3(above[r + c], above[r + c + 1],
above[r + c + 1 + (r + c + 2 < bs * 2)]);
}
dst += stride;
}
}
static INLINE void d117_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
const uint8_t *above, const uint8_t *left) {
int r, c;
......@@ -319,7 +361,7 @@ void vpx_d63_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
DST(3, 3) = AVG3(E, F, G); // differs from vp8
}
void vpx_d63e_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
void vpx_d63f_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
const uint8_t *above, const uint8_t *left) {
const int A = above[0];
const int B = above[1];
......@@ -486,6 +528,23 @@ static INLINE void highbd_d207_predictor(uint16_t *dst, ptrdiff_t stride,
}
}
static INLINE void highbd_d207e_predictor(uint16_t *dst, ptrdiff_t stride,
int bs, const uint16_t *above,
const uint16_t *left, int bd) {
int r, c;
(void) above;
(void) bd;
for (r = 0; r < bs; ++r) {
for (c = 0; c < bs; ++c) {
dst[c] = c & 1 ? AVG3(left[(c >> 1) + r], left[(c >> 1) + r + 1],
left[(c >> 1) + r + 2])
: AVG2(left[(c >> 1) + r], left[(c >> 1) + r + 1]);
}
dst += stride;
}
}
static INLINE void highbd_d63_predictor(uint16_t *dst, ptrdiff_t stride,
int bs, const uint16_t *above,
const uint16_t *left, int bd) {
......@@ -502,6 +561,8 @@ static INLINE void highbd_d63_predictor(uint16_t *dst, ptrdiff_t stride,
}
}
#define highbd_d63e_predictor highbd_d63_predictor
static INLINE void highbd_d45_predictor(uint16_t *dst, ptrdiff_t stride, int bs,
const uint16_t *above,
const uint16_t *left, int bd) {
......@@ -527,7 +588,7 @@ static INLINE void highbd_d45e_predictor(uint16_t *dst, ptrdiff_t stride,
for (r = 0; r < bs; ++r) {
for (c = 0; c < bs; ++c) {
dst[c] = AVG3(above[r + c], above[r + c + 1],
above[r + c + 1 + (r + c + 2 < 8)]);
above[r + c + 1 + (r + c + 2 < bs * 2)]);
}
dst += stride;
}
......@@ -771,6 +832,11 @@ static INLINE void highbd_dc_predictor(uint16_t *dst, ptrdiff_t stride,
intra_pred_no_4x4(d207)
intra_pred_no_4x4(d63)
intra_pred_no_4x4(d45)
#if CONFIG_EXT_IPRED_BLTR
intra_pred_allsizes(d207e)
intra_pred_allsizes(d63e)
intra_pred_no_4x4(d45e)
#endif
intra_pred_no_4x4(d117)
intra_pred_no_4x4(d135)
intra_pred_no_4x4(d153)
......@@ -781,7 +847,7 @@ intra_pred_allsizes(dc_128)
intra_pred_allsizes(dc_left)
intra_pred_allsizes(dc_top)
intra_pred_allsizes(dc)
#if CONFIG_VP9_HIGHBITDEPTH && CONFIG_MISC_FIXES
#if CONFIG_VP9_HIGHBITDEPTH && CONFIG_MISC_FIXES && !CONFIG_EXT_IPRED_BLTR
intra_pred_highbd_sized(d45e, 4)
#endif
#undef intra_pred_allsizes
This diff is collapsed.
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