Update libyuv to r397

Change-Id: I70f5a527de52ae8ae80b189873c9a094035dfa2c
Signed-off-by: Hendrik Dahlkamp <hendrik@google.com>
diff --git a/files/libyuv.gyp b/files/libyuv.gyp
index d5abab7..1813753 100644
--- a/files/libyuv.gyp
+++ b/files/libyuv.gyp
@@ -1,4 +1,4 @@
-# Copyright (c) 2011 The LibYuv project authors. All Rights Reserved.
+# Copyright 2011 The LibYuv Project Authors. All rights reserved.
 #
 # Use of this source code is governed by a BSD-style license
 # that can be found in the LICENSE file in the root of the source
@@ -7,60 +7,85 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 {
+  'variables': {
+     'use_system_libjpeg%': 0,
+  },
   'targets': [
     {
       'target_name': 'libyuv',
       'type': 'static_library',
+      # 'type': 'shared_library',
+      'conditions': [
+         ['use_system_libjpeg==0', {
+          'dependencies': [
+             '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
+          ],
+        }, {
+          'link_settings': {
+            'libraries': [
+              '-ljpeg',
+            ],
+          },
+        }],
+      ],
+      'defines': [
+        'HAVE_JPEG',
+        # 'LIBYUV_BUILDING_SHARED_LIBRARY',
+      ],
       'include_dirs': [
-        'common',
         'include',
+        '.',
       ],
       'direct_dependent_settings': {
         'include_dirs': [
-          'common',
           'include',
+          '.',
         ],
       },
       'sources': [
-        # includes
-        'include/convert.h',
-        'include/general.h',
-        'include/scale.h',
-        'include/planar_functions.h',
+        # includes.
+        'include/libyuv.h',
+        'include/libyuv/basic_types.h',
+        'include/libyuv/compare.h',
+        'include/libyuv/convert.h',
+        'include/libyuv/convert_argb.h',
+        'include/libyuv/convert_from.h',
+        'include/libyuv/cpu_id.h',
+        'include/libyuv/format_conversion.h',
+        'include/libyuv/mjpeg_decoder.h',
+        'include/libyuv/planar_functions.h',
+        'include/libyuv/rotate.h',
+        'include/libyuv/rotate_argb.h',
+        'include/libyuv/row.h',
+        'include/libyuv/scale.h',
+        'include/libyuv/scale_argb.h',
+        'include/libyuv/version.h',
+        'include/libyuv/video_common.h',
 
-        # headers
-        'common/basic_types.h',
-        'common/common.h',
-        'common/constructor_magic.h',
-        'source/cpu_id.h',
-        'source/rotate.h'
-        'source/row.h',
-        'source/video_common.h',
-
-        # sources
+        # sources.
+        'source/compare.cc',
+        'source/compare_neon.cc',
         'source/convert.cc',
+        'source/convert_argb.cc',
+        'source/convert_from.cc',
         'source/cpu_id.cc',
         'source/format_conversion.cc',
-        'source/general.cc',
+        'source/mjpeg_decoder.cc',
         'source/planar_functions.cc',
         'source/rotate.cc',
-        'source/row_table.cc',
+        'source/rotate_argb.cc',
+        'source/rotate_neon.cc',
+        'source/row_common.cc',
+        'source/row_neon.cc',
+        'source/row_posix.cc',
+        'source/row_win.cc',
         'source/scale.cc',
+        'source/scale_neon.cc',
+        'source/scale_argb.cc',
         'source/video_common.cc',
       ],
-      'conditions': [
-        ['OS=="win"', {
-         'sources': [
-           'source/row_win.cc',
-         ],
-        },{ # else
-         'sources': [
-            'source/row_posix.cc',
-          ],
-        }],
-      ]
     },
-  ], # targets
+  ], # targets.
 }
 
 # Local Variables: