Merge "Remove kjellander and add magjed+phoglund in OWNERS"
diff --git a/README.version b/README.version
index 7b69958..6ce5d06 100644
--- a/README.version
+++ b/README.version
@@ -1,3 +1,3 @@
-Version: r1649
+Version: r1652
 BugComponent: 42195
 Owner: lajos
diff --git a/files/Android.bp b/files/Android.bp
index bdc2f4d..b9b07e5 100644
--- a/files/Android.bp
+++ b/files/Android.bp
@@ -70,3 +70,25 @@
     name: "libyuv_static",
     whole_static_libs: ["libyuv"],
 }
+
+cc_test {
+    name: "libyuv_unittest",
+    static_libs: ["libyuv"],
+    shared_libs: ["libjpeg"],
+
+    srcs: [
+        "unit_test/unit_test.cc",
+        "unit_test/basictypes_test.cc",
+        "unit_test/color_test.cc",
+        "unit_test/compare_test.cc",
+        "unit_test/convert_test.cc",
+        "unit_test/cpu_test.cc",
+        "unit_test/math_test.cc",
+        "unit_test/planar_test.cc",
+        "unit_test/rotate_argb_test.cc",
+        "unit_test/rotate_test.cc",
+        "unit_test/scale_argb_test.cc",
+        "unit_test/scale_test.cc",
+        "unit_test/video_common_test.cc",
+    ],
+}
diff --git a/files/BUILD.gn b/files/BUILD.gn
index 4f56cdc..a50aab5 100644
--- a/files/BUILD.gn
+++ b/files/BUILD.gn
@@ -9,6 +9,11 @@
 import("libyuv.gni")
 import("//testing/test.gni")
 
+declare_args() {
+  # Set to false to disable building with gflags.
+  libyuv_use_gflags = true
+}
+
 config("libyuv_config") {
   include_dirs = [ "include" ]
   if (is_android && current_cpu == "arm64") {
@@ -28,7 +33,7 @@
   if (libyuv_include_tests) {
     deps += [
       ":compare",
-      ":convert",
+      ":yuvconvert",
       ":cpuid",
       ":libyuv_unittest",
       ":psnr",
@@ -231,9 +236,14 @@
     deps = [
       ":libyuv",
       "//testing/gtest",
-      "//third_party/gflags",
     ]
 
+    defines = []
+    if (libyuv_use_gflags) {
+      defines += [ "LIBYUV_USE_GFLAGS" ]
+      deps += [ "//third_party/gflags" ]
+    }
+
     configs += [ ":libyuv_unittest_warnings_config" ]
 
     public_deps = [
@@ -241,8 +251,6 @@
     ]
     public_configs = [ ":libyuv_unittest_config" ]
 
-    defines = []
-
     if (is_linux) {
       cflags = [ "-fexceptions" ]
     }
@@ -289,10 +297,10 @@
     }
   }
 
-  executable("convert") {
+  executable("yuvconvert") {
     sources = [
       # sources
-      "util/convert.cc",
+      "util/yuvconvert.cc",
     ]
     deps = [
       ":libyuv",
diff --git a/files/CMakeLists.txt b/files/CMakeLists.txt
index 7c95487..6420371 100644
--- a/files/CMakeLists.txt
+++ b/files/CMakeLists.txt
@@ -31,14 +31,14 @@
 SET_TARGET_PROPERTIES	( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
 
 # this creates the conversion tool
-ADD_EXECUTABLE			( convert ${ly_base_dir}/util/convert.cc )
-TARGET_LINK_LIBRARIES	( convert ${ly_lib_static} )
+ADD_EXECUTABLE			( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
+TARGET_LINK_LIBRARIES	( yuvconvert ${ly_lib_static} )
 
 
 INCLUDE ( FindJPEG )
 if (JPEG_FOUND)
   include_directories( ${JPEG_INCLUDE_DIR} )
-  target_link_libraries( convert ${JPEG_LIBRARY} )
+  target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
   add_definitions( -DHAVE_JPEG )
 endif()
 
@@ -73,7 +73,7 @@
 
 
 # install the conversion tool, .so, .a, and all the header files
-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/convert			DESTINATION bin RENAME yuvconvert )
+INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert			DESTINATION bin )
 INSTALL ( TARGETS ${ly_lib_static}						DESTINATION lib )
 INSTALL ( TARGETS ${ly_lib_shared} LIBRARY				DESTINATION lib )
 INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/		DESTINATION include )
diff --git a/files/DEPS b/files/DEPS
index 2073e8c..803f481 100644
--- a/files/DEPS
+++ b/files/DEPS
@@ -1,30 +1,30 @@
 vars = {
   'chromium_git': 'https://chromium.googlesource.com',
-  'chromium_revision': '7950721f084767700b62bb6e1c90ea155efae980',
+  'chromium_revision': 'da7cc8ca4c326895886b10df62d513fac256d74f',
   'swarming_revision': '11e31afa5d330756ff87aa12064bb5d032896cb5',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling lss
   # and whatever else without interference from each other.
-  'lss_revision': '3f6478ac95edf86cd3da300c2c0d34a438f5dbeb',
+  'lss_revision': '63f24c8221a229f677d26ebe8f3d1528a9d787ac',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling catapult
   # and whatever else without interference from each other.
-  'catapult_revision': '353ee60a4567ec80252bb4047e54b2df3151717e',
+  'catapult_revision': '49eb11f63eb4d552d634833a01d2710208ba0523',
 }
 
 deps = {
   'src/build':
-    Var('chromium_git') + '/chromium/src/build' + '@' + 'bf8911f59bebb1cdd075e612c78e985cb14eca29',
+    Var('chromium_git') + '/chromium/src/build' + '@' + '15013685bdd59b8e548ffdef88b6fddae4f0e49c',
   'src/buildtools':
-    Var('chromium_git') + '/chromium/buildtools.git' + '@' + 'b3771b1935ea74c388b6fb1750e83f5d83b39dec',
+    Var('chromium_git') + '/chromium/buildtools.git' + '@' + '88811f48a6b79786ef35be86825642fc33011151',
   'src/testing':
-    Var('chromium_git') + '/chromium/src/testing' + '@' + 'c2c74bc1d165ccc01ed03e424f72aa313eeb9120',
+    Var('chromium_git') + '/chromium/src/testing' + '@' + '6885521e316f349c47c4f23f5bce9bd44cb0eece',
   'src/testing/gtest':
     Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + '6f8a66431cb592dad629028a50b3dd418a408c87',
   'src/testing/gmock':
     Var('chromium_git') + '/external/googlemock.git' + '@' + '0421b6f358139f02e102c9c332ce19a33faf75be', # from svn revision 566
   'src/third_party':
-    Var('chromium_git') + '/chromium/src/third_party' + '@' + '4c0908d22e7c4cd423da28f69c64c6fd293b0e99',
+    Var('chromium_git') + '/chromium/src/third_party' + '@' + 'be0a7d2accc6d1e69eb9fa005d98e1558b9227ff',
   'src/third_party/catapult':
    Var('chromium_git') + '/external/github.com/catapult-project/catapult.git' + '@' + Var('catapult_revision'),
   'src/third_party/colorama/src':
@@ -34,7 +34,7 @@
   'src/third_party/yasm/source/patched-yasm':
     Var('chromium_git') + '/chromium/deps/yasm/patched-yasm.git' + '@' + '7da28c6c7c6a1387217352ce02b31754deb54d2a',
   'src/tools':
-    Var('chromium_git') + '/chromium/src/tools' + '@' + '14318cc69b7116d7b4aa23ee58cdf3d7c71d4038',
+    Var('chromium_git') + '/chromium/src/tools' + '@' + '80ce3971a8a250e9d0180e38a29553273877166c',
   'src/tools/gyp':
     Var('chromium_git') + '/external/gyp.git' + '@' + 'e7079f0e0e14108ab0dba58728ff219637458563',
    'src/tools/swarming_client':
@@ -52,13 +52,13 @@
 deps_os = {
   'android': {
     'src/base':
-      Var('chromium_git') + '/chromium/src/base' + '@' + 'd75864a2c554db298f34b188c07a11133c8bd88b',
+      Var('chromium_git') + '/chromium/src/base' + '@' + '636a52bf9d2ab7ea4e97d0a933bbd5706acbbc7c',
     'src/third_party/android_tools':
-      Var('chromium_git') + '/android_tools.git' + '@' + 'b43a6a289a7588b1769814f04dd6c7d7176974cc',
+      Var('chromium_git') + '/android_tools.git' + '@' + 'b65c4776dac2cf1b80e969b3b2d4e081b9c84f29',
     'src/third_party/ced/src':
-      Var('chromium_git') + '/external/github.com/google/compact_enc_det.git' + '@' + '368a9cc09ad868a3d28f0b5ad4a733f263c46409',
+      Var('chromium_git') + '/external/github.com/google/compact_enc_det.git' + '@' + 'e21eb6aed10b9f6e2727f136c52420033214d458',
     'src/third_party/icu':
-      Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '450be73c9ee8ae29d43d4fdc82febb2a5f62bfb5',
+      Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'b34251f8b762f8e2112a89c587855ca4297fed96',
     'src/third_party/jsr-305/src':
       Var('chromium_git') + '/external/jsr-305.git' + '@' + '642c508235471f7220af6d5df2d3210e3bfc0919',
     'src/third_party/junit/src':
@@ -74,7 +74,7 @@
   },
   'ios': {
     'src/ios':
-      Var('chromium_git') + '/chromium/src/ios' + '@' + '8b8111f841dfdc04bb5591dfd1315120f95709a4',
+      Var('chromium_git') + '/chromium/src/ios' + '@' + '9d4d917abc902ad9eb512839948b880194f76338',
   },
   'unix': {
     'src/third_party/lss':
@@ -425,15 +425,6 @@
     ],
   },
   {
-    # Pull sanitizer-instrumented third-party libraries if requested via
-    # GYP_DEFINES.
-    # See src/third_party/instrumented_libraries/scripts/download_binaries.py.
-    # TODO(kjellander): Update comment when GYP is completely cleaned up.
-    'name': 'instrumented_libraries',
-    'pattern': '\\.sha1',
-    'action': ['python', 'src/third_party/instrumented_libraries/scripts/download_binaries.py'],
-  },
-  {
     'name': 'clang_format_merge_driver',
     'pattern': '.',
     'action': [ 'python',
diff --git a/files/README.chromium b/files/README.chromium
index 2512b38..8a0f066 100644
--- a/files/README.chromium
+++ b/files/README.chromium
@@ -1,6 +1,6 @@
 Name: libyuv
 URL: http://code.google.com/p/libyuv/
-Version: 1649
+Version: 1652
 License: BSD
 License File: LICENSE
 
diff --git a/files/docs/deprecated_builds.md b/files/docs/deprecated_builds.md
index f623e50..d54a028 100644
--- a/files/docs/deprecated_builds.md
+++ b/files/docs/deprecated_builds.md
@@ -238,7 +238,7 @@
     ninja -C out/Debug libyuv
     ninja -C out/Debug libyuv_unittest
     ninja -C out/Debug compare
-    ninja -C out/Debug convert
+    ninja -C out/Debug yuvconvert
     ninja -C out/Debug psnr
     ninja -C out/Debug cpuid
 
diff --git a/files/include/libyuv/convert_from.h b/files/include/libyuv/convert_from.h
index 7ddebd4..a050e44 100644
--- a/files/include/libyuv/convert_from.h
+++ b/files/include/libyuv/convert_from.h
@@ -200,6 +200,18 @@
                  int width,
                  int height);
 
+LIBYUV_API
+int I422ToRGB565(const uint8* src_y,
+                 int src_stride_y,
+                 const uint8* src_u,
+                 int src_stride_u,
+                 const uint8* src_v,
+                 int src_stride_v,
+                 uint8* dst_frame,
+                 int dst_stride_frame,
+                 int width,
+                 int height);
+
 // Convert I420 To RGB565 with 4x4 dither matrix (16 bytes).
 // Values in dither matrix from 0 to 7 recommended.
 // The order of the dither matrix is first byte is upper left.
diff --git a/files/include/libyuv/version.h b/files/include/libyuv/version.h
index 5d56cf0..5b5f539 100644
--- a/files/include/libyuv/version.h
+++ b/files/include/libyuv/version.h
@@ -11,6 +11,6 @@
 #ifndef INCLUDE_LIBYUV_VERSION_H_
 #define INCLUDE_LIBYUV_VERSION_H_
 
-#define LIBYUV_VERSION 1649
+#define LIBYUV_VERSION 1652
 
 #endif  // INCLUDE_LIBYUV_VERSION_H_
diff --git a/files/libyuv_test.gyp b/files/libyuv_test.gyp
index 88860f5..87e7a5b 100644
--- a/files/libyuv_test.gyp
+++ b/files/libyuv_test.gyp
@@ -123,14 +123,14 @@
       ], # conditions
     },
     {
-      'target_name': 'convert',
+      'target_name': 'yuvconvert',
       'type': 'executable',
       'dependencies': [
         'libyuv.gyp:libyuv',
       ],
       'sources': [
         # sources
-        'util/convert.cc',
+        'util/yuvconvert.cc',
       ],
       'conditions': [
         ['OS=="linux"', {
diff --git a/files/source/convert_from.cc b/files/source/convert_from.cc
index ab5afc0..d623731 100644
--- a/files/source/convert_from.cc
+++ b/files/source/convert_from.cc
@@ -890,6 +890,75 @@
   return 0;
 }
 
+// Convert I422 to RGB565.
+LIBYUV_API
+int I422ToRGB565(const uint8* src_y,
+                 int src_stride_y,
+                 const uint8* src_u,
+                 int src_stride_u,
+                 const uint8* src_v,
+                 int src_stride_v,
+                 uint8* dst_rgb565,
+                 int dst_stride_rgb565,
+                 int width,
+                 int height) {
+  int y;
+  void (*I422ToRGB565Row)(const uint8* y_buf, const uint8* u_buf,
+                          const uint8* v_buf, uint8* rgb_buf,
+                          const struct YuvConstants* yuvconstants, int width) =
+      I422ToRGB565Row_C;
+  if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) {
+    return -1;
+  }
+  // Negative height means invert the image.
+  if (height < 0) {
+    height = -height;
+    dst_rgb565 = dst_rgb565 + (height - 1) * dst_stride_rgb565;
+    dst_stride_rgb565 = -dst_stride_rgb565;
+  }
+#if defined(HAS_I422TORGB565ROW_SSSE3)
+  if (TestCpuFlag(kCpuHasSSSE3)) {
+    I422ToRGB565Row = I422ToRGB565Row_Any_SSSE3;
+    if (IS_ALIGNED(width, 8)) {
+      I422ToRGB565Row = I422ToRGB565Row_SSSE3;
+    }
+  }
+#endif
+#if defined(HAS_I422TORGB565ROW_AVX2)
+  if (TestCpuFlag(kCpuHasAVX2)) {
+    I422ToRGB565Row = I422ToRGB565Row_Any_AVX2;
+    if (IS_ALIGNED(width, 16)) {
+      I422ToRGB565Row = I422ToRGB565Row_AVX2;
+    }
+  }
+#endif
+#if defined(HAS_I422TORGB565ROW_NEON)
+  if (TestCpuFlag(kCpuHasNEON)) {
+    I422ToRGB565Row = I422ToRGB565Row_Any_NEON;
+    if (IS_ALIGNED(width, 8)) {
+      I422ToRGB565Row = I422ToRGB565Row_NEON;
+    }
+  }
+#endif
+#if defined(HAS_I422TORGB565ROW_MSA)
+  if (TestCpuFlag(kCpuHasMSA)) {
+    I422ToRGB565Row = I422ToRGB565Row_Any_MSA;
+    if (IS_ALIGNED(width, 8)) {
+      I422ToRGB565Row = I422ToRGB565Row_MSA;
+    }
+  }
+#endif
+
+  for (y = 0; y < height; ++y) {
+    I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, &kYuvI601Constants, width);
+    dst_rgb565 += dst_stride_rgb565;
+    src_y += src_stride_y;
+    src_u += src_stride_u;
+    src_v += src_stride_v;
+  }
+  return 0;
+}
+
 // Ordered 8x8 dither for 888 to 565.  Values from 0 to 7.
 static const uint8 kDither565_4x4[16] = {
     0, 4, 1, 5, 6, 2, 7, 3, 1, 5, 0, 4, 7, 3, 6, 2,
diff --git a/files/source/rotate_win.cc b/files/source/rotate_win.cc
index 044048d..93a5c28 100644
--- a/files/source/rotate_win.cc
+++ b/files/source/rotate_win.cc
@@ -137,9 +137,9 @@
     mov       ecx, [ecx + 16 + 28]  // w
 
     align      4
- convertloop:
-                     // Read in the data from the source pointer.
-        // First round of bit swap.
+    // Read in the data from the source pointer.
+    // First round of bit swap.
+  convertloop:
     movdqu    xmm0, [eax]
     movdqu    xmm1, [eax + edi]
     lea       eax, [eax + 2 * edi]
@@ -166,7 +166,7 @@
     lea       eax, [eax + 2 * edi]
     movdqu    [esp], xmm5  // backup xmm5
     neg       edi
-    movdqa    xmm5, xmm6             // use xmm5 as temp register.
+    movdqa    xmm5, xmm6  // use xmm5 as temp register.
     punpcklbw xmm6, xmm7
     punpckhbw xmm5, xmm7
     movdqa    xmm7, xmm5
@@ -187,10 +187,11 @@
     movdqa    xmm6, xmm5
     movdqu    xmm5, [esp]  // restore xmm5
     movdqu    [esp], xmm6  // backup xmm6
-    movdqa    xmm6, xmm5             // use xmm6 as temp register.
+    movdqa    xmm6, xmm5  // use xmm6 as temp register.
     punpcklwd xmm5, xmm7
     punpckhwd xmm6, xmm7
     movdqa    xmm7, xmm6
+
     // Third round of bit swap.
     // Write to the destination pointer.
     movdqa    xmm6, xmm0
diff --git a/files/source/row_any.cc b/files/source/row_any.cc
index 88c2cf1..1092a9c 100644
--- a/files/source/row_any.cc
+++ b/files/source/row_any.cc
@@ -654,18 +654,18 @@
 #undef ANY11B
 
 // Any 1 to 1 with parameter.
-#define ANY11P(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK)                         \
-  void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, T shuffler, int width) { \
-    SIMD_ALIGNED(uint8 temp[64 * 2]);                                         \
-    memset(temp, 0, 64); /* for msan */                                       \
-    int r = width & MASK;                                                     \
-    int n = width & ~MASK;                                                    \
-    if (n > 0) {                                                              \
-      ANY_SIMD(src_ptr, dst_ptr, shuffler, n);                                \
-    }                                                                         \
-    memcpy(temp, src_ptr + n * SBPP, r * SBPP);                               \
-    ANY_SIMD(temp, temp + 64, shuffler, MASK + 1);                            \
-    memcpy(dst_ptr + n * BPP, temp + 64, r * BPP);                            \
+#define ANY11P(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK)                      \
+  void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, T param, int width) { \
+    SIMD_ALIGNED(uint8 temp[64 * 2]);                                      \
+    memset(temp, 0, 64); /* for msan */                                    \
+    int r = width & MASK;                                                  \
+    int n = width & ~MASK;                                                 \
+    if (n > 0) {                                                           \
+      ANY_SIMD(src_ptr, dst_ptr, param, n);                                \
+    }                                                                      \
+    memcpy(temp, src_ptr + n * SBPP, r * SBPP);                            \
+    ANY_SIMD(temp, temp + 64, param, MASK + 1);                            \
+    memcpy(dst_ptr + n * BPP, temp + 64, r * BPP);                         \
   }
 
 #if defined(HAS_ARGBTORGB565DITHERROW_SSE2)
@@ -718,19 +718,18 @@
 #undef ANY11P
 
 // Any 1 to 1 with parameter and shorts.  BPP measures in shorts.
-#define ANY11P16(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK)            \
-  void NAMEANY(const uint16* src_ptr, uint16* dst_ptr, T shuffler, \
-               int width) {                                        \
-    SIMD_ALIGNED(uint16 temp[16 * 2]);                             \
-    memset(temp, 0, 32); /* for msan */                            \
-    int r = width & MASK;                                          \
-    int n = width & ~MASK;                                         \
-    if (n > 0) {                                                   \
-      ANY_SIMD(src_ptr, dst_ptr, shuffler, n);                     \
-    }                                                              \
-    memcpy(temp, src_ptr + n, r * SBPP);                           \
-    ANY_SIMD(temp, temp + 16, shuffler, MASK + 1);                 \
-    memcpy(dst_ptr + n, temp + 16, r * BPP);                       \
+#define ANY11P16(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK)                      \
+  void NAMEANY(const uint16* src_ptr, uint16* dst_ptr, T param, int width) { \
+    SIMD_ALIGNED(uint16 temp[16 * 2]);                                       \
+    memset(temp, 0, 32); /* for msan */                                      \
+    int r = width & MASK;                                                    \
+    int n = width & ~MASK;                                                   \
+    if (n > 0) {                                                             \
+      ANY_SIMD(src_ptr, dst_ptr, param, n);                                  \
+    }                                                                        \
+    memcpy(temp, src_ptr + n, r * SBPP);                                     \
+    ANY_SIMD(temp, temp + 16, param, MASK + 1);                              \
+    memcpy(dst_ptr + n, temp + 16, r * BPP);                                 \
   }
 
 #ifdef HAS_HALFFLOATROW_SSE2
diff --git a/files/tools/OWNERS b/files/tools/OWNERS
index ac607d4..f096352 100644
--- a/files/tools/OWNERS
+++ b/files/tools/OWNERS
@@ -9,6 +9,12 @@
 scottmg@chromium.org
 thakis@chromium.org
 
+# These aren't actually great contact points for this directory, but
+# changes in this directory are rare and most changes happen in better-owned
+# subdirectories.
+#
+# TEAM: infra-dev@chromium.org
+# COMPONENT: Build
 
 per-file bisect*.py=anantha@chromium.org
 per-file bisect*.py=prasadv@chromium.org
diff --git a/files/unit_test/convert_test.cc b/files/unit_test/convert_test.cc
index 0f1c743..04d5a40 100644
--- a/files/unit_test/convert_test.cc
+++ b/files/unit_test/convert_test.cc
@@ -576,6 +576,7 @@
 TESTPLANARTOB(I420, 2, 2, ARGB1555, 2, 2, 1, 9, ARGB, 4)
 TESTPLANARTOB(I420, 2, 2, ARGB4444, 2, 2, 1, 17, ARGB, 4)
 TESTPLANARTOB(I422, 2, 1, ARGB, 4, 4, 1, 2, ARGB, 4)
+TESTPLANARTOB(I422, 2, 1, RGB565, 2, 2, 1, 9, ARGB, 4)
 TESTPLANARTOB(J422, 2, 1, ARGB, 4, 4, 1, 2, ARGB, 4)
 TESTPLANARTOB(J422, 2, 1, ABGR, 4, 4, 1, 2, ARGB, 4)
 TESTPLANARTOB(H422, 2, 1, ARGB, 4, 4, 1, 2, ARGB, 4)
@@ -1800,7 +1801,7 @@
 TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB565, 2)
 TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB1555, 2)
 TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB4444, 2)
-TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, ARGB, 4)
+TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4,  RGB565, 2)
 TESTPLANARTOE(J422, 2, 1, ARGB, 1, 4, ARGB, 4)
 TESTPLANARTOE(J422, 2, 1, ABGR, 1, 4, ARGB, 4)
 TESTPLANARTOE(H422, 2, 1, ARGB, 1, 4, ARGB, 4)
diff --git a/files/unit_test/unit_test.cc b/files/unit_test/unit_test.cc
index 7f8bcf8..55297e3 100644
--- a/files/unit_test/unit_test.cc
+++ b/files/unit_test/unit_test.cc
@@ -14,7 +14,9 @@
 
 #include <cstring>
 
+#ifdef LIBYUV_USE_GFLAGS
 #include "gflags/gflags.h"
+#endif
 
 // Change this to 1000 for benchmarking.
 // TODO(fbarchard): Add command line parsing to pass this as option.
@@ -22,6 +24,7 @@
 
 unsigned int fastrand_seed = 0xfb;
 
+#ifdef LIBYUV_USE_GFLAGS
 DEFINE_int32(libyuv_width, 0, "width of test image.");
 DEFINE_int32(libyuv_height, 0, "height of test image.");
 DEFINE_int32(libyuv_repeat, 0, "number of times to repeat test.");
@@ -29,6 +32,14 @@
 DEFINE_int32(libyuv_cpu_info,
              0,
              "cpu flags for benchmark code. 1 = C, -1 = SIMD");
+#else
+// Disable command line parameters if gflags disabled.
+static const int32 FLAGS_libyuv_width = 0;
+static const int32 FLAGS_libyuv_height = 0;
+static const int32 FLAGS_libyuv_repeat = 0;
+static const int32 FLAGS_libyuv_flags = 0;
+static const int32 FLAGS_libyuv_cpu_info = 0;
+#endif
 
 // For quicker unittests, default is 128 x 72.  But when benchmarking,
 // default to 720p.  Allow size to specify.
@@ -390,9 +401,11 @@
 
 int main(int argc, char** argv) {
   ::testing::InitGoogleTest(&argc, argv);
+#ifdef LIBYUV_USE_GFLAGS
   // AllowCommandLineParsing allows us to ignore flags passed on to us by
   // Chromium build bots without having to explicitly disable them.
   google::AllowCommandLineReparsing();
   google::ParseCommandLineFlags(&argc, &argv, true);
+#endif
   return RUN_ALL_TESTS();
 }
diff --git a/files/util/convert.cc b/files/util/yuvconvert.cc
similarity index 99%
rename from files/util/convert.cc
rename to files/util/yuvconvert.cc
index acaf43a..bc01d9f 100644
--- a/files/util/convert.cc
+++ b/files/util/yuvconvert.cc
@@ -9,7 +9,7 @@
  */
 
 // Convert an ARGB image to YUV.
-// Usage: convert src_argb.raw dst_yuv.raw
+// Usage: yuvconvert src_argb.raw dst_yuv.raw
 
 #ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS