Add option for optimize_b only in final encode

This adds a third option to the optimize_coefficients speed
feature, which turns off optimize_b in the search but uses
it in the final encode. This option is not currently being
used by default.

Change-Id: Ic10c9fd8ef16bc453f5e232733cda34d0ddb7692
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 9f0a7a1..ba1b31f 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -276,6 +276,12 @@
   GM_DISABLE_SEARCH
 } GM_SEARCH_TYPE;
 
+typedef enum {
+  NO_TRELLIS_OPT,         // No trellis optimization
+  FULL_TRELLIS_OPT,       // Trellis optimization in all stages
+  FINAL_PASS_TRELLIS_OPT  // Trellis optimization in only the final encode pass
+} TRELLIS_OPT_TYPE;
+
 typedef struct SPEED_FEATURES {
   MV_SPEED_FEATURES mv;
 
@@ -284,8 +290,8 @@
 
   RECODE_LOOP_TYPE recode_loop;
 
-  // Trellis (dynamic programming) optimization of quantized values (+1, 0).
-  int optimize_coefficients;
+  // Trellis (dynamic programming) optimization of quantized values
+  TRELLIS_OPT_TYPE optimize_coefficients;
 
   // Always set to 0. If on it enables 0 cost background transmission
   // (except for the initial transmission of the segmentation). The feature is