OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/simd/convert_rgb_to_yuv.h" | 5 #include "media/base/simd/convert_rgb_to_yuv.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "media/base/simd/convert_rgb_to_yuv_ssse3.h" | 8 #include "media/base/simd/convert_rgb_to_yuv_ssse3.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 void ConvertRGB32ToYUV_SSSE3(const uint8* rgbframe, | 12 void ConvertRGB32ToYUV_SSSE3(const uint8_t* rgbframe, |
13 uint8* yplane, | 13 uint8_t* yplane, |
14 uint8* uplane, | 14 uint8_t* uplane, |
15 uint8* vplane, | 15 uint8_t* vplane, |
16 int width, | 16 int width, |
17 int height, | 17 int height, |
18 int rgbstride, | 18 int rgbstride, |
19 int ystride, | 19 int ystride, |
20 int uvstride) { | 20 int uvstride) { |
21 for (; height >= 2; height -= 2) { | 21 for (; height >= 2; height -= 2) { |
22 ConvertARGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); | 22 ConvertARGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); |
23 rgbframe += rgbstride; | 23 rgbframe += rgbstride; |
24 yplane += ystride; | 24 yplane += ystride; |
25 | 25 |
26 ConvertARGBToYUVRow_SSSE3(rgbframe, yplane, NULL, NULL, width); | 26 ConvertARGBToYUVRow_SSSE3(rgbframe, yplane, NULL, NULL, width); |
27 rgbframe += rgbstride; | 27 rgbframe += rgbstride; |
28 yplane += ystride; | 28 yplane += ystride; |
29 | 29 |
30 uplane += uvstride; | 30 uplane += uvstride; |
31 vplane += uvstride; | 31 vplane += uvstride; |
32 } | 32 } |
33 | 33 |
34 if (height) | 34 if (height) |
35 ConvertARGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); | 35 ConvertARGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); |
36 } | 36 } |
37 | 37 |
38 void ConvertRGB24ToYUV_SSSE3(const uint8* rgbframe, | 38 void ConvertRGB24ToYUV_SSSE3(const uint8_t* rgbframe, |
39 uint8* yplane, | 39 uint8_t* yplane, |
40 uint8* uplane, | 40 uint8_t* uplane, |
41 uint8* vplane, | 41 uint8_t* vplane, |
42 int width, | 42 int width, |
43 int height, | 43 int height, |
44 int rgbstride, | 44 int rgbstride, |
45 int ystride, | 45 int ystride, |
46 int uvstride) { | 46 int uvstride) { |
47 for (; height >= 2; height -= 2) { | 47 for (; height >= 2; height -= 2) { |
48 ConvertRGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); | 48 ConvertRGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); |
49 rgbframe += rgbstride; | 49 rgbframe += rgbstride; |
50 yplane += ystride; | 50 yplane += ystride; |
51 | 51 |
52 ConvertRGBToYUVRow_SSSE3(rgbframe, yplane, NULL, NULL, width); | 52 ConvertRGBToYUVRow_SSSE3(rgbframe, yplane, NULL, NULL, width); |
53 rgbframe += rgbstride; | 53 rgbframe += rgbstride; |
54 yplane += ystride; | 54 yplane += ystride; |
55 | 55 |
56 uplane += uvstride; | 56 uplane += uvstride; |
57 vplane += uvstride; | 57 vplane += uvstride; |
58 } | 58 } |
59 | 59 |
60 if (height) | 60 if (height) |
61 ConvertRGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); | 61 ConvertRGBToYUVRow_SSSE3(rgbframe, yplane, uplane, vplane, width); |
62 } | 62 } |
63 | 63 |
64 } // namespace media | 64 } // namespace media |
OLD | NEW |