summaryrefslogtreecommitdiffstats
path: root/media/base/yuv_row.h
diff options
context:
space:
mode:
authorfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 23:18:05 +0000
committerfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 23:18:05 +0000
commit4343dfbb634893311ae654e412d704831c8ba5ac (patch)
tree3ae77ab903d1017876fabc3ae26122255f684789 /media/base/yuv_row.h
parent4ae9839c98ddb20de44d0c776e278a9cdbea37d4 (diff)
downloadchromium_src-4343dfbb634893311ae654e412d704831c8ba5ac.zip
chromium_src-4343dfbb634893311ae654e412d704831c8ba5ac.tar.gz
chromium_src-4343dfbb634893311ae654e412d704831c8ba5ac.tar.bz2
YUV scaling and conversion refactored into low levels per platform that do a row and high levels that step thru the image.
Low level is implemented in MMX assembly. Mac and Linux use reference code for this version. Review URL: http://codereview.chromium.org/113247 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16011 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/yuv_row.h')
-rw-r--r--media/base/yuv_row.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/media/base/yuv_row.h b/media/base/yuv_row.h
new file mode 100644
index 0000000..11fc71f
--- /dev/null
+++ b/media/base/yuv_row.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// yuv_row internal functions to handle YUV conversion and scaling to RGB.
+// These functions are used from both yuv_convert.cc and yuv_scale.cc.
+
+#ifndef MEDIA_BASE_YUV_ROW_H_
+#define MEDIA_BASE_YUV_ROW_H_
+
+#include "base/basictypes.h"
+
+namespace media {
+
+void ConvertYV12ToRGB32Row(const uint8* y_buf,
+ const uint8* u_buf,
+ const uint8* v_buf,
+ uint8* rgb_buf,
+ int width);
+
+void HalfYV12ToRGB32Row(const uint8* y_buf,
+ const uint8* u_buf,
+ const uint8* v_buf,
+ uint8* rgb_buf,
+ int width);
+
+void ScaleYV12ToRGB32Row(const uint8* y_buf,
+ const uint8* u_buf,
+ const uint8* v_buf,
+ uint8* rgb_buf,
+ int width,
+ int scaled_dx);
+
+void Half2Row(const uint8* in_row0,
+ const uint8* in_row1,
+ uint8* out_row,
+ int out_width);
+
+// MMX for Windows
+// C++ code provided as a fall back.
+
+#ifndef USE_MMX
+#if defined(_MSC_VER)
+#define USE_MMX 1
+#else
+#define USE_MMX 0
+#endif
+#endif
+
+#if USE_MMX
+#if defined(_MSC_VER)
+#define EMMS() __asm emms
+#else
+#define EMMS() asm("emms")
+#endif
+#else
+#define EMMS()
+#endif
+
+} // namespace media
+
+#endif // MEDIA_BASE_YUV_ROW_H_
+