Add the speed feature structure for codec dev

This commit re-structures the speed feature setup for the codec
development purpose. Instead of progressively reducing encoder
complexity at the expense of incremental coding loss, we allow a
separate set of speed features, each corresponds to a certain
category of coding units:

1 << 0: transform coding
1 << 1: inter prediction
1 << 2: intra prediction
1 << 3: block partition
1 << 4: loop filters
1 << 5: rd early skip

[6 - 7] are left open for next adjustment.

It is constructed to facilitate the codec development purpose.
When working on a coding functions, one could choose to turn on
one or more less related coding units to speed up the evaluation
process. For example, to test a transform related experiment, one
could set
--dev-sf=2, 6, or 22
which corresponds to turning on:
2 - inter prediction speed features,
6 - both inter / intra speed features,
22 - inter / intra, and loop filter features.

The goal is to allow faster experimental verification during the
development process. With the experiment in a stable state, we
can evaluate its performance in speed 0 at higher confidence level.

Change-Id: Ib46c7dea2d2a60204c399dc01f10262c976adf0d
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index e55625d..09dd3a2 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -31,6 +31,7 @@
 
 struct av1_extracfg {
   int cpu_used;  // available cpu percentage in 1/16
+  int dev_sf;
   unsigned int enable_auto_alt_ref;
   unsigned int enable_auto_bwd_ref;
   unsigned int noise_sensitivity;
@@ -95,6 +96,7 @@
 
 static struct av1_extracfg default_extra_cfg = {
   0,  // cpu_used
+  0,  // dev_sf
   1,  // enable_auto_alt_ref
   0,  // enable_auto_bwd_ref
   0,  // noise_sensitivity
@@ -279,6 +281,7 @@
   RANGE_CHECK_HI(extra_cfg, enable_auto_alt_ref, 2);
   RANGE_CHECK_HI(extra_cfg, enable_auto_bwd_ref, 2);
   RANGE_CHECK(extra_cfg, cpu_used, 0, 8);
+  RANGE_CHECK(extra_cfg, dev_sf, 0, UINT8_MAX);
   RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6);
   RANGE_CHECK(extra_cfg, superblock_size, AOM_SUPERBLOCK_SIZE_64X64,
               AOM_SUPERBLOCK_SIZE_DYNAMIC);
@@ -572,6 +575,7 @@
   oxcf->key_freq = cfg->kf_max_dist;
 
   oxcf->speed = extra_cfg->cpu_used;
+  oxcf->dev_sf = extra_cfg->dev_sf;
   oxcf->enable_auto_arf = extra_cfg->enable_auto_alt_ref;
   oxcf->enable_auto_brf = extra_cfg->enable_auto_bwd_ref;
   oxcf->noise_sensitivity = extra_cfg->noise_sensitivity;
@@ -750,6 +754,12 @@
   return update_extra_cfg(ctx, &extra_cfg);
 }
 
+static aom_codec_err_t ctrl_set_devsf(aom_codec_alg_priv_t *ctx, va_list args) {
+  struct av1_extracfg extra_cfg = ctx->extra_cfg;
+  extra_cfg.dev_sf = CAST(AOME_SET_DEVSF, args);
+  return update_extra_cfg(ctx, &extra_cfg);
+}
+
 static aom_codec_err_t ctrl_set_enable_auto_alt_ref(aom_codec_alg_priv_t *ctx,
                                                     va_list args) {
   struct av1_extracfg extra_cfg = ctx->extra_cfg;
@@ -1588,6 +1598,7 @@
   { AOME_SET_ACTIVEMAP, ctrl_set_active_map },
   { AOME_SET_SCALEMODE, ctrl_set_scale_mode },
   { AOME_SET_CPUUSED, ctrl_set_cpuused },
+  { AOME_SET_DEVSF, ctrl_set_devsf },
   { AOME_SET_ENABLEAUTOALTREF, ctrl_set_enable_auto_alt_ref },
   { AOME_SET_ENABLEAUTOBWDREF, ctrl_set_enable_auto_bwd_ref },
   { AOME_SET_SHARPNESS, ctrl_set_sharpness },