summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorHui Su <huisu@google.com>2018-12-10 18:17:57 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-12-10 18:17:57 +0000
commitc172de2f282a42a3c24abbb0d95b39315122480d (patch)
treed57709334b3fc2e71ea860da84db42695fc00e97 /vp9
parent1db36f4d3833f2e0d5e99486f6daca2059f10cea (diff)
parentb23a05422e98bc246692df1297474bb0cb78ad51 (diff)
downloadlibvpx-c172de2f282a42a3c24abbb0d95b39315122480d.tar
libvpx-c172de2f282a42a3c24abbb0d95b39315122480d.tar.gz
libvpx-c172de2f282a42a3c24abbb0d95b39315122480d.tar.bz2
libvpx-c172de2f282a42a3c24abbb0d95b39315122480d.zip
Merge "Add enum definition for subpel search precision"
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_pickmode.c6
-rw-r--r--vp9/encoder/vp9_speed_features.c12
-rw-r--r--vp9/encoder/vp9_speed_features.h14
3 files changed, 15 insertions, 17 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index fe8f24444..babfe4a33 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -233,10 +233,10 @@ static int combined_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
}
if (rv && search_subpel) {
- int subpel_force_stop = cpi->sf.mv.subpel_force_stop;
- if (use_base_mv && cpi->sf.base_mv_aggressive) subpel_force_stop = 2;
+ SUBPEL_FORCE_STOP subpel_force_stop = cpi->sf.mv.subpel_force_stop;
+ if (use_base_mv && cpi->sf.base_mv_aggressive) subpel_force_stop = HALF_PEL;
if (cpi->sf.mv.enable_adaptive_subpel_force_stop) {
- int mv_thresh = cpi->sf.mv.adapt_subpel_force_stop.mv_thresh;
+ const int mv_thresh = cpi->sf.mv.adapt_subpel_force_stop.mv_thresh;
if (abs(tmp_mv->as_mv.row) >= mv_thresh ||
abs(tmp_mv->as_mv.col) >= mv_thresh)
subpel_force_stop = cpi->sf.mv.adapt_subpel_force_stop.force_stop_above;
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 4f3d470d6..141b721fa 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -533,7 +533,7 @@ static void set_rt_speed_feature_framesize_independent(
sf->adjust_partitioning_from_last_frame =
cm->last_frame_type != cm->frame_type ||
(0 == (frames_since_key + 1) % sf->last_partitioning_redo_frequency);
- sf->mv.subpel_force_stop = 1;
+ sf->mv.subpel_force_stop = QUARTER_PEL;
for (i = 0; i < TX_SIZES; i++) {
sf->intra_y_mode_mask[i] = INTRA_DC_H_V;
sf->intra_uv_mode_mask[i] = INTRA_DC;
@@ -730,7 +730,7 @@ static void set_rt_speed_feature_framesize_independent(
if (cpi->row_mt && cpi->oxcf.max_threads > 1)
sf->adaptive_rd_thresh_row_mt = 1;
- if (content == VP9E_CONTENT_SCREEN) sf->mv.subpel_force_stop = 3;
+ if (content == VP9E_CONTENT_SCREEN) sf->mv.subpel_force_stop = FULL_PEL;
if (content == VP9E_CONTENT_SCREEN) sf->lpf_pick = LPF_PICK_MINIMAL_LPF;
// Only keep INTRA_DC mode for speed 8.
if (!is_keyframe) {
@@ -766,8 +766,8 @@ static void set_rt_speed_feature_framesize_independent(
sf->mv.adapt_subpel_force_stop.mv_thresh = 2;
if (cpi->rc.avg_frame_low_motion < 40)
sf->mv.adapt_subpel_force_stop.mv_thresh = 1;
- sf->mv.adapt_subpel_force_stop.force_stop_below = 1;
- sf->mv.adapt_subpel_force_stop.force_stop_above = 2;
+ sf->mv.adapt_subpel_force_stop.force_stop_below = QUARTER_PEL;
+ sf->mv.adapt_subpel_force_stop.force_stop_above = HALF_PEL;
// Disable partition blocks below 16x16, except for low-resolutions.
if (cm->frame_type != KEY_FRAME && cm->width >= 320 && cm->height >= 240)
sf->disable_16x16part_nonkey = 1;
@@ -868,7 +868,7 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
sf->recode_loop = ALLOW_RECODE_FIRST;
sf->mv.subpel_search_method = SUBPEL_TREE;
sf->mv.subpel_search_level = 2;
- sf->mv.subpel_force_stop = 0;
+ sf->mv.subpel_force_stop = EIGHTH_PEL;
sf->optimize_coefficients = !is_lossless_requested(&cpi->oxcf);
sf->mv.reduce_first_step_size = 0;
sf->coeff_prob_appx_step = 1;
@@ -985,7 +985,7 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
sf->optimize_coefficients = 0;
}
- if (sf->mv.subpel_force_stop == 3) {
+ if (sf->mv.subpel_force_stop == FULL_PEL) {
// Whole pel only
cpi->find_fractional_mv_step = vp9_skip_sub_pixel_tree;
} else if (sf->mv.subpel_search_method == SUBPEL_TREE) {
diff --git a/vp9/encoder/vp9_speed_features.h b/vp9/encoder/vp9_speed_features.h
index 02673e602..9b09ec474 100644
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -167,15 +167,17 @@ typedef enum {
ONE_LOOP_REDUCED = 1
} FAST_COEFF_UPDATE;
+typedef enum { EIGHTH_PEL, QUARTER_PEL, HALF_PEL, FULL_PEL } SUBPEL_FORCE_STOP;
+
typedef struct ADAPT_SUBPEL_FORCE_STOP {
// Threshold for full pixel motion vector;
int mv_thresh;
// subpel_force_stop if full pixel MV is below the threshold.
- int force_stop_below;
+ SUBPEL_FORCE_STOP force_stop_below;
// subpel_force_stop if full pixel MV is equal to or above the threshold.
- int force_stop_above;
+ SUBPEL_FORCE_STOP force_stop_above;
} ADAPT_SUBPEL_FORCE_STOP;
typedef struct MV_SPEED_FEATURES {
@@ -200,12 +202,8 @@ typedef struct MV_SPEED_FEATURES {
// extensive subpel search.
int subpel_search_level;
- // Control when to stop subpel search:
- // 0: Full subpel search.
- // 1: Stop at quarter pixel.
- // 2: Stop at half pixel.
- // 3: Stop at full pixel.
- int subpel_force_stop;
+ // When to stop subpel motion search.
+ SUBPEL_FORCE_STOP subpel_force_stop;
// If it's enabled, different subpel_force_stop will be used for different MV.
int enable_adaptive_subpel_force_stop;