Merge "Take out skip_recode speed feature" into nextgenv2
This commit is contained in:
@@ -77,7 +77,6 @@ struct macroblock {
|
|||||||
MB_MODE_INFO_EXT *mbmi_ext;
|
MB_MODE_INFO_EXT *mbmi_ext;
|
||||||
int skip_block;
|
int skip_block;
|
||||||
int select_tx_size;
|
int select_tx_size;
|
||||||
int skip_recode;
|
|
||||||
int skip_optimize;
|
int skip_optimize;
|
||||||
int q_index;
|
int q_index;
|
||||||
|
|
||||||
|
@@ -1707,7 +1707,6 @@ static void rd_pick_sb_modes(VP10_COMP *cpi,
|
|||||||
ctx->is_coded = 0;
|
ctx->is_coded = 0;
|
||||||
ctx->skippable = 0;
|
ctx->skippable = 0;
|
||||||
ctx->pred_pixel_ready = 0;
|
ctx->pred_pixel_ready = 0;
|
||||||
x->skip_recode = 0;
|
|
||||||
|
|
||||||
// Set to zero to make sure we do not use the previous encoded frame stats
|
// Set to zero to make sure we do not use the previous encoded frame stats
|
||||||
mbmi->skip = 0;
|
mbmi->skip = 0;
|
||||||
@@ -2263,8 +2262,6 @@ static void encode_sb(VP10_COMP *cpi, ThreadData *td,
|
|||||||
|
|
||||||
set_offsets(cpi, tile, x, mi_row, mi_col, bsize);
|
set_offsets(cpi, tile, x, mi_row, mi_col, bsize);
|
||||||
if (!x->skip) {
|
if (!x->skip) {
|
||||||
// TODO(geza.lore): Investigate if this can be relaxed
|
|
||||||
x->skip_recode = 0;
|
|
||||||
memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
|
memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
|
||||||
|
|
||||||
x->skip_optimize = 0;
|
x->skip_optimize = 0;
|
||||||
@@ -4970,9 +4967,6 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td,
|
|||||||
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
|
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
|
||||||
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
||||||
|
|
||||||
x->skip_recode = 0;
|
|
||||||
|
|
||||||
if (!x->skip_recode)
|
|
||||||
memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
|
memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
|
||||||
|
|
||||||
x->skip_optimize = ctx->is_coded;
|
x->skip_optimize = ctx->is_coded;
|
||||||
|
@@ -436,10 +436,9 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
|
|||||||
// Assert not magic number (uninitialised).
|
// Assert not magic number (uninitialised).
|
||||||
assert(x->blk_skip[plane][(blk_row << bwl) + blk_col] != 234);
|
assert(x->blk_skip[plane][(blk_row << bwl) + blk_col] != 234);
|
||||||
|
|
||||||
if (!x->skip_recode &&
|
if (x->blk_skip[plane][(blk_row << bwl) + blk_col] == 0) {
|
||||||
x->blk_skip[plane][(blk_row << bwl) + blk_col] == 0) {
|
|
||||||
#else
|
#else
|
||||||
if (!x->skip_recode) {
|
{
|
||||||
#endif
|
#endif
|
||||||
if (x->quant_fp) {
|
if (x->quant_fp) {
|
||||||
// Encoding process for rtc mode
|
// Encoding process for rtc mode
|
||||||
@@ -479,12 +478,11 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
|
|||||||
}
|
}
|
||||||
#if CONFIG_VAR_TX
|
#if CONFIG_VAR_TX
|
||||||
else {
|
else {
|
||||||
if (!x->skip_recode)
|
|
||||||
p->eobs[block] = 0;
|
p->eobs[block] = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
|
if (x->optimize) {
|
||||||
int ctx;
|
int ctx;
|
||||||
#if CONFIG_VAR_TX
|
#if CONFIG_VAR_TX
|
||||||
switch (tx_size) {
|
switch (tx_size) {
|
||||||
@@ -661,10 +659,9 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
|||||||
int block = 0;
|
int block = 0;
|
||||||
int step = 1 << (max_tx_size * 2);
|
int step = 1 << (max_tx_size * 2);
|
||||||
#endif
|
#endif
|
||||||
if (!x->skip_recode)
|
|
||||||
vp10_subtract_plane(x, bsize, plane);
|
vp10_subtract_plane(x, bsize, plane);
|
||||||
|
|
||||||
if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
|
if (x->optimize) {
|
||||||
#if CONFIG_VAR_TX
|
#if CONFIG_VAR_TX
|
||||||
vp10_get_entropy_contexts(bsize, TX_4X4, pd,
|
vp10_get_entropy_contexts(bsize, TX_4X4, pd,
|
||||||
ctx.ta[plane], ctx.tl[plane]);
|
ctx.ta[plane], ctx.tl[plane]);
|
||||||
@@ -761,24 +758,15 @@ void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col,
|
|||||||
src_stride, dst, dst_stride);
|
src_stride, dst, dst_stride);
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if CONFIG_EXT_INTRA
|
|
||||||
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
|
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
|
||||||
VP10_XFORM_QUANT_B);
|
VP10_XFORM_QUANT_B);
|
||||||
#else
|
|
||||||
if (!x->skip_recode)
|
|
||||||
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
|
|
||||||
VP10_XFORM_QUANT_B);
|
|
||||||
else
|
|
||||||
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
|
|
||||||
VP10_XFORM_QUANT_SKIP_QUANT);
|
|
||||||
#endif // CONFIG_EXT_INTRA
|
|
||||||
|
|
||||||
if (args->ctx != NULL) {
|
if (args->ctx != NULL) {
|
||||||
struct optimize_ctx *const ctx = args->ctx;
|
struct optimize_ctx *const ctx = args->ctx;
|
||||||
ENTROPY_CONTEXT *a, *l;
|
ENTROPY_CONTEXT *a, *l;
|
||||||
a = &ctx->ta[plane][blk_col];
|
a = &ctx->ta[plane][blk_col];
|
||||||
l = &ctx->tl[plane][blk_row];
|
l = &ctx->tl[plane][blk_row];
|
||||||
if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
|
if (x->optimize) {
|
||||||
int ctx;
|
int ctx;
|
||||||
ctx = combine_entropy_contexts(*a, *l);
|
ctx = combine_entropy_contexts(*a, *l);
|
||||||
*a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0;
|
*a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0;
|
||||||
@@ -814,8 +802,7 @@ void vp10_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane,
|
|||||||
struct optimize_ctx ctx;
|
struct optimize_ctx ctx;
|
||||||
struct encode_b_args arg = {x, &ctx, &xd->mi[0]->mbmi.skip};
|
struct encode_b_args arg = {x, &ctx, &xd->mi[0]->mbmi.skip};
|
||||||
|
|
||||||
if (enable_optimize_b && x->optimize &&
|
if (enable_optimize_b && x->optimize) {
|
||||||
(!x->skip_recode || !x->skip_optimize)) {
|
|
||||||
const struct macroblockd_plane* const pd = &xd->plane[plane];
|
const struct macroblockd_plane* const pd = &xd->plane[plane];
|
||||||
const TX_SIZE tx_size = plane ? get_uv_tx_size(&xd->mi[0]->mbmi, pd) :
|
const TX_SIZE tx_size = plane ? get_uv_tx_size(&xd->mi[0]->mbmi, pd) :
|
||||||
xd->mi[0]->mbmi.tx_size;
|
xd->mi[0]->mbmi.tx_size;
|
||||||
|
@@ -563,7 +563,6 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
|||||||
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
|
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
|
||||||
p[i].eobs = ctx->eobs_pbuf[i][1];
|
p[i].eobs = ctx->eobs_pbuf[i][1];
|
||||||
}
|
}
|
||||||
x->skip_recode = 0;
|
|
||||||
|
|
||||||
vp10_init_mv_probs(cm);
|
vp10_init_mv_probs(cm);
|
||||||
vp10_initialize_rd_consts(cpi);
|
vp10_initialize_rd_consts(cpi);
|
||||||
|
@@ -131,7 +131,6 @@ static void set_good_speed_feature(VP10_COMP *cpi, VP10_COMMON *cm,
|
|||||||
const int boosted = frame_is_boosted(cpi);
|
const int boosted = frame_is_boosted(cpi);
|
||||||
|
|
||||||
sf->adaptive_rd_thresh = 1;
|
sf->adaptive_rd_thresh = 1;
|
||||||
sf->allow_skip_recode = 1;
|
|
||||||
|
|
||||||
if (speed >= 1) {
|
if (speed >= 1) {
|
||||||
if ((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) ||
|
if ((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) ||
|
||||||
@@ -335,7 +334,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
|
|||||||
sf->mv.subpel_iters_per_step = 1;
|
sf->mv.subpel_iters_per_step = 1;
|
||||||
sf->adaptive_rd_thresh = 4;
|
sf->adaptive_rd_thresh = 4;
|
||||||
sf->mode_skip_start = 6;
|
sf->mode_skip_start = 6;
|
||||||
sf->allow_skip_recode = 0;
|
|
||||||
sf->optimize_coefficients = 0;
|
sf->optimize_coefficients = 0;
|
||||||
sf->disable_split_mask = DISABLE_ALL_SPLIT;
|
sf->disable_split_mask = DISABLE_ALL_SPLIT;
|
||||||
sf->lpf_pick = LPF_PICK_FROM_Q;
|
sf->lpf_pick = LPF_PICK_FROM_Q;
|
||||||
@@ -369,7 +367,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
|
|||||||
sf->inter_mode_mask[BLOCK_128X128] = INTER_NEAREST;
|
sf->inter_mode_mask[BLOCK_128X128] = INTER_NEAREST;
|
||||||
#endif // CONFIG_EXT_PARTITION
|
#endif // CONFIG_EXT_PARTITION
|
||||||
sf->max_intra_bsize = BLOCK_32X32;
|
sf->max_intra_bsize = BLOCK_32X32;
|
||||||
sf->allow_skip_recode = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (speed >= 5) {
|
if (speed >= 5) {
|
||||||
@@ -382,7 +379,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
|
|||||||
(frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1);
|
(frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1);
|
||||||
sf->max_delta_qindex = is_keyframe ? 20 : 15;
|
sf->max_delta_qindex = is_keyframe ? 20 : 15;
|
||||||
sf->partition_search_type = REFERENCE_PARTITION;
|
sf->partition_search_type = REFERENCE_PARTITION;
|
||||||
sf->allow_skip_recode = 0;
|
|
||||||
sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO;
|
sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO;
|
||||||
sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO;
|
sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO;
|
||||||
sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO;
|
sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO;
|
||||||
@@ -532,7 +528,6 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
|
|||||||
}
|
}
|
||||||
sf->use_rd_breakout = 0;
|
sf->use_rd_breakout = 0;
|
||||||
sf->use_uv_intra_rd_estimate = 0;
|
sf->use_uv_intra_rd_estimate = 0;
|
||||||
sf->allow_skip_recode = 0;
|
|
||||||
sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE;
|
sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE;
|
||||||
sf->use_fast_coef_updates = TWO_LOOP;
|
sf->use_fast_coef_updates = TWO_LOOP;
|
||||||
sf->use_fast_coef_costing = 0;
|
sf->use_fast_coef_costing = 0;
|
||||||
@@ -567,12 +562,6 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
|
|||||||
else if (oxcf->mode == GOOD)
|
else if (oxcf->mode == GOOD)
|
||||||
set_good_speed_feature(cpi, cm, sf, oxcf->speed);
|
set_good_speed_feature(cpi, cm, sf, oxcf->speed);
|
||||||
|
|
||||||
#if CONFIG_REF_MV
|
|
||||||
// TODO(geza): Temporarily turn this off for ref-mv to fix tests.
|
|
||||||
// Investigate/reimplement skip_recode better to enable this.
|
|
||||||
sf->allow_skip_recode = 0;
|
|
||||||
#endif // CONFIG_REF_MV
|
|
||||||
|
|
||||||
// sf->partition_search_breakout_dist_thr is set assuming max 64x64
|
// sf->partition_search_breakout_dist_thr is set assuming max 64x64
|
||||||
// blocks. Normalise this if the blocks are bigger.
|
// blocks. Normalise this if the blocks are bigger.
|
||||||
if (MAX_SB_SIZE_LOG2 > 6) {
|
if (MAX_SB_SIZE_LOG2 > 6) {
|
||||||
|
@@ -288,10 +288,6 @@ typedef struct SPEED_FEATURES {
|
|||||||
// mode to be evaluated. A high value means we will be faster.
|
// mode to be evaluated. A high value means we will be faster.
|
||||||
int adaptive_rd_thresh;
|
int adaptive_rd_thresh;
|
||||||
|
|
||||||
// Speed feature to allow or disallow skipping of recode at block
|
|
||||||
// level within a frame.
|
|
||||||
int allow_skip_recode;
|
|
||||||
|
|
||||||
// Coefficient probability model approximation step size
|
// Coefficient probability model approximation step size
|
||||||
int coeff_prob_appx_step;
|
int coeff_prob_appx_step;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user