Make intra predictor reference buffer configurable
This commit enables configurable reference buffer pointer for intra predictor. This allows later removal of spatial dependency between blocks inside a 64x64 superblock in the rate-distortion optimization loop. Change-Id: I02418c2077efe19adc86e046a6b49364a980f5b1
This commit is contained in:
parent
d19ea3861d
commit
861cb06c67
@ -300,6 +300,7 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
|
|||||||
int bwl_in,
|
int bwl_in,
|
||||||
TX_SIZE tx_size,
|
TX_SIZE tx_size,
|
||||||
int mode,
|
int mode,
|
||||||
|
uint8_t *reference, int ref_stride,
|
||||||
uint8_t *predictor, int pre_stride) {
|
uint8_t *predictor, int pre_stride) {
|
||||||
const int bwl = bwl_in - tx_size;
|
const int bwl = bwl_in - tx_size;
|
||||||
const int wmask = (1 << bwl) - 1;
|
const int wmask = (1 << bwl) - 1;
|
||||||
@ -309,7 +310,7 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
|
|||||||
const int txfm_block_size = 4 << tx_size;
|
const int txfm_block_size = 4 << tx_size;
|
||||||
|
|
||||||
assert(bwl >= 0);
|
assert(bwl >= 0);
|
||||||
vp9_build_intra_predictors(predictor, pre_stride,
|
vp9_build_intra_predictors(reference, ref_stride,
|
||||||
predictor, pre_stride,
|
predictor, pre_stride,
|
||||||
mode,
|
mode,
|
||||||
txfm_block_size,
|
txfm_block_size,
|
||||||
|
@ -25,6 +25,6 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
|
|||||||
int block_idx,
|
int block_idx,
|
||||||
int bwl_in,
|
int bwl_in,
|
||||||
TX_SIZE tx_size,
|
TX_SIZE tx_size,
|
||||||
int mode,
|
int mode, uint8_t *ref, int ref_stride,
|
||||||
uint8_t *predictor, int pre_stride);
|
uint8_t *predictor, int pre_stride);
|
||||||
#endif // VP9_COMMON_VP9_RECONINTRA_H_
|
#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;
|
plane_b_size = b_width_log2(bsize) - pd->subsampling_x;
|
||||||
vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
|
vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
|
||||||
|
dst, pd->dst.stride,
|
||||||
dst, pd->dst.stride);
|
dst, pd->dst.stride);
|
||||||
|
|
||||||
// Early exit if there are no coefficients
|
// Early exit if there are no coefficients
|
||||||
|
@ -643,6 +643,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
|
|||||||
|
|
||||||
plane_b_size = b_width_log2(bsize) - pd->subsampling_x;
|
plane_b_size = b_width_log2(bsize) - pd->subsampling_x;
|
||||||
vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
|
vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
|
||||||
|
dst, pd->dst.stride,
|
||||||
dst, pd->dst.stride);
|
dst, pd->dst.stride);
|
||||||
vp9_subtract_block(txfm_b_size, txfm_b_size, src_diff, bw,
|
vp9_subtract_block(txfm_b_size, txfm_b_size, src_diff, bw,
|
||||||
src, p->src.stride, dst, pd->dst.stride);
|
src, p->src.stride, dst, pd->dst.stride);
|
||||||
|
@ -216,6 +216,7 @@ typedef struct {
|
|||||||
int static_segmentation;
|
int static_segmentation;
|
||||||
int comp_inter_joint_search_thresh;
|
int comp_inter_joint_search_thresh;
|
||||||
int adpative_rd_thresh;
|
int adpative_rd_thresh;
|
||||||
|
int skip_encode_sb;
|
||||||
int use_lastframe_partitioning;
|
int use_lastframe_partitioning;
|
||||||
int use_largest_txform;
|
int use_largest_txform;
|
||||||
int use_8tap_always;
|
int use_8tap_always;
|
||||||
|
@ -644,7 +644,9 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
|||||||
int rate = 0;
|
int rate = 0;
|
||||||
int64_t distortion;
|
int64_t distortion;
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
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;
|
uint8_t *src, *dst;
|
||||||
int16_t *src_diff, *coeff;
|
int16_t *src_diff, *coeff;
|
||||||
|
|
||||||
@ -678,18 +680,20 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
|||||||
block = ib + idy * 2 + idx;
|
block = ib + idy * 2 + idx;
|
||||||
xd->mode_info_context->bmi[block].as_mode.first = mode;
|
xd->mode_info_context->bmi[block].as_mode.first = mode;
|
||||||
src = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
|
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,
|
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);
|
coeff = BLOCK_OFFSET(x->plane[0].coeff, block, 16);
|
||||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
|
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
|
||||||
xd->plane[0].dst.buf,
|
pd->dst.buf,
|
||||||
xd->plane[0].dst.stride);
|
pd->dst.stride);
|
||||||
vp9_predict_intra_block(xd, block, b_width_log2(BLOCK_SIZE_SB8X8),
|
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,
|
vp9_subtract_block(4, 4, src_diff, 8,
|
||||||
src, src_stride,
|
src, src_stride,
|
||||||
dst, xd->plane[0].dst.stride);
|
dst, pd->dst.stride);
|
||||||
|
|
||||||
tx_type = get_tx_type_4x4(xd, block);
|
tx_type = get_tx_type_4x4(xd, block);
|
||||||
if (tx_type != DCT_DCT) {
|
if (tx_type != DCT_DCT) {
|
||||||
@ -702,15 +706,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,
|
ratey += cost_coeffs(cm, x, 0, block, PLANE_TYPE_Y_WITH_DC,
|
||||||
tempa + idx, templ + idy, TX_4X4, 16);
|
tempa + idx, templ + idy, TX_4X4, 16);
|
||||||
distortion += vp9_block_error(coeff, BLOCK_OFFSET(xd->plane[0].dqcoeff,
|
distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff,
|
||||||
block, 16), 16) >> 2;
|
block, 16), 16) >> 2;
|
||||||
|
|
||||||
if (best_tx_type != DCT_DCT)
|
if (best_tx_type != DCT_DCT)
|
||||||
vp9_short_iht4x4_add(BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16),
|
vp9_short_iht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block, 16),
|
||||||
dst, xd->plane[0].dst.stride, best_tx_type);
|
dst, pd->dst.stride, best_tx_type);
|
||||||
else
|
else
|
||||||
xd->inv_txm4x4_add(BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16),
|
xd->inv_txm4x4_add(BLOCK_OFFSET(pd->dqcoeff, block, 16),
|
||||||
dst, xd->plane[0].dst.stride);
|
dst, pd->dst.stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,7 +734,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
|||||||
for (idx = 0; idx < bw; ++idx) {
|
for (idx = 0; idx < bw; ++idx) {
|
||||||
block = ib + idy * 2 + idx;
|
block = ib + idy * 2 + idx;
|
||||||
vpx_memcpy(best_dqcoeff[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]));
|
sizeof(best_dqcoeff[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -742,18 +746,19 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
|||||||
block = ib + idy * 2 + idx;
|
block = ib + idy * 2 + idx;
|
||||||
xd->mode_info_context->bmi[block].as_mode.first = *best_mode;
|
xd->mode_info_context->bmi[block].as_mode.first = *best_mode;
|
||||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
|
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
|
||||||
xd->plane[0].dst.buf,
|
pd->dst.buf,
|
||||||
xd->plane[0].dst.stride);
|
pd->dst.stride);
|
||||||
|
|
||||||
vp9_predict_intra_block(xd, block, b_width_log2(BLOCK_SIZE_SB8X8), TX_4X4,
|
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
|
// inverse transform
|
||||||
if (best_tx_type != DCT_DCT)
|
if (best_tx_type != DCT_DCT)
|
||||||
vp9_short_iht4x4_add(best_dqcoeff[idy * 2 + idx], dst,
|
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
|
else
|
||||||
xd->inv_txm4x4_add(best_dqcoeff[idy * 2 + idx], dst,
|
xd->inv_txm4x4_add(best_dqcoeff[idy * 2 + idx], dst,
|
||||||
xd->plane[0].dst.stride);
|
pd->dst.stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user