Commit fc1cfd8e authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review
Browse files

Merge "Make intra predictor reference buffer configurable"

parents 4c10515f 861cb06c
......@@ -318,6 +318,7 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
int bwl_in,
TX_SIZE tx_size,
int mode,
uint8_t *reference, int ref_stride,
uint8_t *predictor, int pre_stride) {
const int bwl = bwl_in - tx_size;
const int wmask = (1 << bwl) - 1;
......@@ -327,7 +328,7 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
const int txfm_block_size = 4 << tx_size;
assert(bwl >= 0);
vp9_build_intra_predictors(predictor, pre_stride,
vp9_build_intra_predictors(reference, ref_stride,
predictor, pre_stride,
mode,
txfm_block_size,
......
......@@ -25,6 +25,6 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
int block_idx,
int bwl_in,
TX_SIZE tx_size,
int mode,
int mode, uint8_t *ref, int ref_stride,
uint8_t *predictor, int pre_stride);
#endif // VP9_COMMON_VP9_RECONINTRA_H_
......@@ -261,6 +261,7 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
plane_b_size = b_width_log2(bsize) - pd->subsampling_x;
vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
dst, pd->dst.stride,
dst, pd->dst.stride);
// Early exit if there are no coefficients
......
......@@ -642,6 +642,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
plane_b_size = b_width_log2(bsize) - pd->subsampling_x;
vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
dst, pd->dst.stride,
dst, pd->dst.stride);
vp9_subtract_block(txfm_b_size, txfm_b_size, src_diff, bw,
src, p->src.stride, dst, pd->dst.stride);
......
......@@ -216,6 +216,7 @@ typedef struct {
int static_segmentation;
int comp_inter_joint_search_thresh;
int adpative_rd_thresh;
int skip_encode_sb;
int use_lastframe_partitioning;
int use_largest_txform;
int use_8tap_always;
......
......@@ -647,7 +647,9 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
int rate = 0;
int64_t distortion;
VP9_COMMON *const cm = &cpi->common;
const int src_stride = x->plane[0].src.stride;
struct macroblock_plane *p = &x->plane[0];
struct macroblockd_plane *pd = &xd->plane[0];
const int src_stride = p->src.stride;
uint8_t *src, *dst;
int16_t *src_diff, *coeff;
......@@ -681,18 +683,20 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
block = ib + idy * 2 + idx;
xd->mode_info_context->bmi[block].as_mode.first = mode;
src = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
x->plane[0].src.buf, src_stride);
p->src.buf, src_stride);
src_diff = raster_block_offset_int16(xd, BLOCK_SIZE_SB8X8, 0, block,
x->plane[0].src_diff);
p->src_diff);
coeff = BLOCK_OFFSET(x->plane[0].coeff, block, 16);
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
pd->dst.buf,
pd->dst.stride);
vp9_predict_intra_block(xd, block, b_width_log2(BLOCK_SIZE_SB8X8),
TX_4X4, mode, dst, xd->plane[0].dst.stride);
TX_4X4, mode,
dst, pd->dst.stride,
dst, pd->dst.stride);
vp9_subtract_block(4, 4, src_diff, 8,
src, src_stride,
dst, xd->plane[0].dst.stride);
dst, pd->dst.stride);
tx_type = get_tx_type_4x4(xd, block);
if (tx_type != DCT_DCT) {
......@@ -705,15 +709,15 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
ratey += cost_coeffs(cm, x, 0, block, PLANE_TYPE_Y_WITH_DC,
tempa + idx, templ + idy, TX_4X4, 16);
distortion += vp9_block_error(coeff, BLOCK_OFFSET(xd->plane[0].dqcoeff,
block, 16), 16) >> 2;
distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff,
block, 16), 16) >> 2;
if (best_tx_type != DCT_DCT)
vp9_short_iht4x4_add(BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16),
dst, xd->plane[0].dst.stride, best_tx_type);
vp9_short_iht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block, 16),
dst, pd->dst.stride, best_tx_type);
else
xd->inv_txm4x4_add(BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16),
dst, xd->plane[0].dst.stride);
xd->inv_txm4x4_add(BLOCK_OFFSET(pd->dqcoeff, block, 16),
dst, pd->dst.stride);
}
}
......@@ -733,7 +737,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
for (idx = 0; idx < bw; ++idx) {
block = ib + idy * 2 + idx;
vpx_memcpy(best_dqcoeff[idy * 2 + idx],
BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16),
BLOCK_OFFSET(pd->dqcoeff, block, 16),
sizeof(best_dqcoeff[0]));
}
}
......@@ -745,18 +749,19 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
block = ib + idy * 2 + idx;
xd->mode_info_context->bmi[block].as_mode.first = *best_mode;
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
xd->plane[0].dst.buf,
xd->plane[0].dst.stride);
pd->dst.buf,
pd->dst.stride);
vp9_predict_intra_block(xd, block, b_width_log2(BLOCK_SIZE_SB8X8), TX_4X4,
*best_mode, dst, xd->plane[0].dst.stride);
*best_mode, dst, pd->dst.stride,
dst, pd->dst.stride);
// inverse transform
if (best_tx_type != DCT_DCT)
vp9_short_iht4x4_add(best_dqcoeff[idy * 2 + idx], dst,
xd->plane[0].dst.stride, best_tx_type);
pd->dst.stride, best_tx_type);
else
xd->inv_txm4x4_add(best_dqcoeff[idy * 2 + idx], dst,
xd->plane[0].dst.stride);
pd->dst.stride);
}
}
......
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