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

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

Issue 7888012: Reorganize YUV scalers (Continued) (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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/yuv_convert.h" 5 #include "media/base/simd/convert_rgb_to_yuv.h"
6 #include "media/base/yuv_convert_internal.h"
7 6
8 namespace media { 7 namespace media {
9 8
10 static int clip_byte(int x) { 9 static int clip_byte(int x) {
11 if (x > 255) 10 if (x > 255)
12 return 255; 11 return 255;
13 else if (x < 0) 12 else if (x < 0)
14 return 0; 13 return 0;
15 else 14 else
16 return x; 15 return x;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 72
74 rgbframe += rgbstride; 73 rgbframe += rgbstride;
75 yplane += ystride; 74 yplane += ystride;
76 if (i % 2 == 0) { 75 if (i % 2 == 0) {
77 uplane += uvstride; 76 uplane += uvstride;
78 vplane += uvstride; 77 vplane += uvstride;
79 } 78 }
80 } 79 }
81 } 80 }
82 81
83 void ConvertYUY2ToYUV_C(const uint8* src,
84 uint8* yplane,
85 uint8* uplane,
86 uint8* vplane,
87 int width,
88 int height) {
89 for (int i = 0; i < height / 2; ++i) {
90 for (int j = 0; j < (width / 2); ++j) {
91 yplane[0] = src[0];
92 *uplane = src[1];
93 yplane[1] = src[2];
94 *vplane = src[3];
95 src += 4;
96 yplane += 2;
97 uplane++;
98 vplane++;
99 }
100 for (int j = 0; j < (width / 2); ++j) {
101 yplane[0] = src[0];
102 yplane[1] = src[2];
103 src += 4;
104 yplane += 2;
105 }
106 }
107 }
108
109 } // namespace media 82 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698