Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: media/base/simd/convert_yuv_to_rgb.cc

Issue 7003082: Implements RGB to YV12 conversion in YASM. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/simd/convert_yuv_to_rgb.cc
===================================================================
--- media/base/simd/convert_yuv_to_rgb.cc (revision 0)
+++ media/base/simd/convert_yuv_to_rgb.cc (revision 0)
@@ -0,0 +1,73 @@
+// Copyright (c) 2011 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.
+
+#include "media/base/simd/convert_yuv_to_rgb.h"
+
+#include "build/build_config.h"
+#include "media/base/cpu_features.h"
+#include "media/base/simd/convert_yuv_to_rgb_ssse3.h"
+
+namespace media {
+namespace simd {
+
+void ConvertYUVtoRGB32(const uint8* y_buf,
+ const uint8* u_buf,
+ const uint8* v_buf,
+ uint8* rgb_buf,
+ int width,
+ int height,
+ int y_pitch,
+ int uv_pitch,
+ int rgb_pitch,
+ YUVType yuv_type) {
+ int uv_pitch0 = media::YV12 ? 0 : uv_pitch;
+ for (; height >= 2; height -= 2) {
+ ConvertYUVtoARGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
+ rgb_buf += rgb_pitch;
+ y_buf += y_pitch;
+ u_buf += uv_pitch0;
+ v_buf += uv_pitch0;
+
+ ConvertYUVtoARGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
+ rgb_buf += rgb_pitch;
+ y_buf += y_pitch;
+ u_buf += uv_pitch;
+ v_buf += uv_pitch;
+ }
+
+ if (height)
+ ConvertYUVtoARGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
+}
+
+void ConvertYUVtoRGB24(const uint8* y_buf,
+ const uint8* u_buf,
+ const uint8* v_buf,
+ uint8* rgb_buf,
+ int width,
+ int height,
+ int y_pitch,
+ int uv_pitch,
+ int rgb_pitch,
+ YUVType yuv_type) {
+ int uv_pitch0 = media::YV12 ? 0 : uv_pitch;
+ for (; height >= 2; height -= 2) {
+ ConvertYUVtoRGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
+ rgb_buf += rgb_pitch;
+ y_buf += y_pitch;
+ u_buf += uv_pitch0;
+ v_buf += uv_pitch0;
+
+ ConvertYUVtoRGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
+ rgb_buf += rgb_pitch;
+ y_buf += y_pitch;
+ u_buf += uv_pitch;
+ v_buf += uv_pitch;
+ }
+
+ if (height)
+ ConvertYUVtoRGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
+}
+
+} // namespace simd
+} // namespace media
Property changes on: media\base\simd\convert_yuv_to_rgb.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698