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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/base/simd/convert_yuv_to_rgb.h"
6
7 #include "build/build_config.h"
8 #include "media/base/cpu_features.h"
9 #include "media/base/simd/convert_yuv_to_rgb_ssse3.h"
10
11 namespace media {
12 namespace simd {
13
14 void ConvertYUVtoRGB32(const uint8* y_buf,
15 const uint8* u_buf,
16 const uint8* v_buf,
17 uint8* rgb_buf,
18 int width,
19 int height,
20 int y_pitch,
21 int uv_pitch,
22 int rgb_pitch,
23 YUVType yuv_type) {
24 int uv_pitch0 = media::YV12 ? 0 : uv_pitch;
25 for (; height >= 2; height -= 2) {
26 ConvertYUVtoARGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
27 rgb_buf += rgb_pitch;
28 y_buf += y_pitch;
29 u_buf += uv_pitch0;
30 v_buf += uv_pitch0;
31
32 ConvertYUVtoARGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
33 rgb_buf += rgb_pitch;
34 y_buf += y_pitch;
35 u_buf += uv_pitch;
36 v_buf += uv_pitch;
37 }
38
39 if (height)
40 ConvertYUVtoARGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
41 }
42
43 void ConvertYUVtoRGB24(const uint8* y_buf,
44 const uint8* u_buf,
45 const uint8* v_buf,
46 uint8* rgb_buf,
47 int width,
48 int height,
49 int y_pitch,
50 int uv_pitch,
51 int rgb_pitch,
52 YUVType yuv_type) {
53 int uv_pitch0 = media::YV12 ? 0 : uv_pitch;
54 for (; height >= 2; height -= 2) {
55 ConvertYUVtoRGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
56 rgb_buf += rgb_pitch;
57 y_buf += y_pitch;
58 u_buf += uv_pitch0;
59 v_buf += uv_pitch0;
60
61 ConvertYUVtoRGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
62 rgb_buf += rgb_pitch;
63 y_buf += y_pitch;
64 u_buf += uv_pitch;
65 v_buf += uv_pitch;
66 }
67
68 if (height)
69 ConvertYUVtoRGBRow(y_buf, u_buf, v_buf, rgb_buf, width);
70 }
71
72 } // namespace simd
73 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698