Pruning obmc code refactoring
Removed obmc_probs_thresh.
Change-Id: I4b793fbe1beb5bd08b2d185f4fc3c5fee88b27a8
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 67fdc4b..d033806 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1643,7 +1643,7 @@
}
// Gather obmc count to update the probability.
- if (cpi->sf.prune_obmc_using_stats) {
+ if (cpi->sf.prune_obmc_prob_thresh > 0) {
const int inter_block = is_inter_block(mbmi);
const int seg_ref_active =
segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
@@ -5327,7 +5327,7 @@
}
}
- if (cpi->sf.prune_obmc_using_stats) {
+ if (cpi->sf.prune_obmc_prob_thresh > 0) {
const FRAME_UPDATE_TYPE update_type = get_frame_update_type(&cpi->gf_group);
for (i = 0; i < BLOCK_SIZES_ALL; i++) {
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index a4018f1..ebb0f73 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -5046,13 +5046,9 @@
}
}
- if (cpi->sf.prune_obmc_using_stats &&
+ if (cpi->sf.prune_obmc_prob_thresh > 0 &&
cm->current_frame.frame_type == KEY_FRAME) {
av1_copy(cpi->obmc_probs, default_obmc_probs);
- if (cpi->sf.prune_obmc_using_stats == 1)
- cpi->obmc_probs_thresh = 8;
- else
- cpi->obmc_probs_thresh = 16;
}
// Loop variables
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 3781139..fca8a40 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -986,7 +986,6 @@
BLOCK_SIZE vbp_bsize_min;
int obmc_probs[FRAME_UPDATE_TYPES][BLOCK_SIZES_ALL];
- int obmc_probs_thresh;
int tx_type_probs[FRAME_UPDATE_TYPES][TX_SIZES_ALL][TX_TYPES];
int tx_type_probs_thresh[FRAME_UPDATE_TYPES];
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 8c456a4..a764236 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -9749,8 +9749,7 @@
const FRAME_UPDATE_TYPE update_type = get_frame_update_type(&cpi->gf_group);
const int prune_obmc =
- cpi->sf.prune_obmc_using_stats &&
- (cpi->obmc_probs[update_type][bsize] < cpi->obmc_probs_thresh);
+ cpi->obmc_probs[update_type][bsize] < cpi->sf.prune_obmc_prob_thresh;
if ((cpi->oxcf.enable_obmc == 0 || cpi->sf.use_fast_nonrd_pick_mode ||
prune_obmc) &&
mbmi->motion_mode == OBMC_CAUSAL)
@@ -11910,8 +11909,7 @@
av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
const FRAME_UPDATE_TYPE update_type = get_frame_update_type(&cpi->gf_group);
const int prune_obmc =
- cpi->sf.prune_obmc_using_stats &&
- (cpi->obmc_probs[update_type][bsize] < cpi->obmc_probs_thresh);
+ cpi->obmc_probs[update_type][bsize] < cpi->sf.prune_obmc_prob_thresh;
if (cpi->oxcf.enable_obmc && !prune_obmc) {
if (check_num_overlappable_neighbors(mbmi) &&
is_motion_variation_allowed_bsize(bsize)) {
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 4ed735f..eced9d5 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -188,9 +188,9 @@
if (is_480p_or_larger) sf->tx_type_search.prune_tx_type_using_stats = 1;
if (is_720p_or_larger)
- sf->prune_obmc_using_stats = 2;
+ sf->prune_obmc_prob_thresh = 16;
else
- sf->prune_obmc_using_stats = 1;
+ sf->prune_obmc_prob_thresh = 8;
}
if (speed >= 3) {
@@ -214,7 +214,7 @@
if (is_480p_or_larger) sf->tx_type_search.prune_tx_type_using_stats = 2;
- sf->prune_obmc_using_stats = 2;
+ sf->prune_obmc_prob_thresh = 16;
}
}
@@ -910,7 +910,7 @@
sf->prune_comp_type_by_model_rd = 0;
sf->disable_smooth_intra = 0;
sf->perform_best_rd_based_gating_for_chroma = 0;
- sf->prune_obmc_using_stats = 0;
+ sf->prune_obmc_prob_thresh = 0;
if (oxcf->mode == GOOD)
set_good_speed_features_framesize_independent(cpi, sf, speed);
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 7cb63c6..eaeaa92 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -791,7 +791,7 @@
int adaptive_overlay_encoding;
// Prune obmc search using previous frame stats.
- int prune_obmc_using_stats;
+ int prune_obmc_prob_thresh;
// Use ALTREF frame in non-RD mode decision.
int use_nonrd_altref_frame;