Rewrite encoder input format handling.

The previous approach can't scale to all of or new formats. This also
fixes YV12 input.

Change-Id: Ic4ad333770bbbd0e921f519199b57862afcbe1ab
diff --git a/tools_common.h b/tools_common.h
index 2124882..e033de2 100644
--- a/tools_common.h
+++ b/tools_common.h
@@ -89,7 +89,7 @@
   enum VideoFileType file_type;
   uint32_t width;
   uint32_t height;
-  int use_i420;
+  vpx_img_fmt_t fmt;
   int only_i420;
   uint32_t fourcc;
   struct VpxRational framerate;