ref: 9c1299e1785a384c1e5df0bff64d0dace62badfe
parent: fbac7790a65595fe0582c4283c2389a0d1d2b7bd
parent: 49b7e8cda4420d9a4ee307c49dfa74e5e978dab3
author: Hui Su <huisu@google.com>
date: Thu Oct 11 19:41:57 EDT 2018
Merge "ML_VAR_PARTITION: adjust model threshold"
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -4504,15 +4504,9 @@
int mi_col) {
VP9_COMMON *const cm = &cpi->common;
const NN_CONFIG *nn_config = NULL;
- float thresh_low = -0.2f;
- float thresh_high = 0.0f;
switch (bsize) {
- case BLOCK_64X64:
- nn_config = &vp9_var_part_nnconfig_64;
- thresh_low = -0.3f;
- thresh_high = -0.1f;
- break;
+ case BLOCK_64X64: nn_config = &vp9_var_part_nnconfig_64; break;
case BLOCK_32X32: nn_config = &vp9_var_part_nnconfig_32; break;
case BLOCK_16X16: nn_config = &vp9_var_part_nnconfig_16; break;
case BLOCK_8X8: break;
@@ -4524,6 +4518,7 @@
vpx_clear_system_state();
{
+ const float thresh = 0.0f;
float features[FEATURES] = { 0.0f };
const int dc_q = vp9_dc_quant(cm->base_qindex, 0, cm->bit_depth);
int feature_idx = 0;
@@ -4564,8 +4559,8 @@
assert(feature_idx == FEATURES);
nn_predict(features, nn_config, score);
- if (score[0] > thresh_high) return 3;
- if (score[0] < thresh_low) return 0;
+ if (score[0] > thresh) return PARTITION_SPLIT;
+ if (score[0] < thresh) return PARTITION_NONE;
return -1;
}
}
@@ -4643,8 +4638,8 @@
if (partition_none_allowed && do_split) {
const int ml_predicted_partition =
ml_predict_var_paritioning(cpi, x, bsize, mi_row, mi_col);
- if (ml_predicted_partition == 0) do_split = 0;
- if (ml_predicted_partition == 3) partition_none_allowed = 0;
+ if (ml_predicted_partition == PARTITION_NONE) do_split = 0;
+ if (ml_predicted_partition == PARTITION_SPLIT) partition_none_allowed = 0;
}
}
#endif // CONFIG_ML_VAR_PARTITION