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

Side by Side Diff: media/base/simd/convert_yuv_to_rgb_x86.cc

Issue 7891039: Resubmit - Rewrite color space conversions suite using YASM" (Closed) Base URL: svn://svn.chromium.org/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
« no previous file with comments | « media/base/simd/convert_yuv_to_rgb_sse.asm ('k') | media/base/simd/filter_yuv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if defined(_MSC_VER)
6 #include <intrin.h>
7 #else
8 #include <mmintrin.h>
9 #endif
10
11 #include "media/base/cpu_features.h"
12 #include "media/base/simd/convert_yuv_to_rgb.h"
13 #include "media/base/yuv_convert.h"
14
15 namespace media {
16
17 void ConvertYUVToRGB32_MMX(const uint8* yplane,
18 const uint8* uplane,
19 const uint8* vplane,
20 uint8* rgbframe,
21 int width,
22 int height,
23 int ystride,
24 int uvstride,
25 int rgbstride,
26 YUVType yuv_type) {
27 unsigned int y_shift = yuv_type;
28 for (int y = 0; y < height; ++y) {
29 uint8* rgb_row = rgbframe + y * rgbstride;
30 const uint8* y_ptr = yplane + y * ystride;
31 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride;
32 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride;
33
34 ConvertYUVToRGB32Row_MMX(y_ptr,
35 u_ptr,
36 v_ptr,
37 rgb_row,
38 width);
39 }
40
41 _mm_empty();
42 }
43
44 void ConvertYUVToRGB32_SSE(const uint8* yplane,
45 const uint8* uplane,
46 const uint8* vplane,
47 uint8* rgbframe,
48 int width,
49 int height,
50 int ystride,
51 int uvstride,
52 int rgbstride,
53 YUVType yuv_type) {
54 unsigned int y_shift = yuv_type;
55 for (int y = 0; y < height; ++y) {
56 uint8* rgb_row = rgbframe + y * rgbstride;
57 const uint8* y_ptr = yplane + y * ystride;
58 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride;
59 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride;
60
61 ConvertYUVToRGB32Row_SSE(y_ptr,
62 u_ptr,
63 v_ptr,
64 rgb_row,
65 width);
66 }
67
68 _mm_empty();
69 }
70
71 } // namespace media
OLDNEW
« no previous file with comments | « media/base/simd/convert_yuv_to_rgb_sse.asm ('k') | media/base/simd/filter_yuv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698