OLD | NEW |
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 #ifndef MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ | 5 #ifndef MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ |
6 #define MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ | 6 #define MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "media/base/yuv_convert.h" | 9 #include "media/base/yuv_convert.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
13 // Converts an ARGB image to a YV12 image. This function calls ASM functions | 13 // These methods are exported for testing purposes only. Library users should |
14 // implemented in "convert_rgb_to_yuv_ssse3.asm" to convert the specified ARGB | 14 // only call the methods listed in yuv_convert.h. |
15 // image to a YV12 image. | |
16 void ConvertRGB32ToYUV_SSSE3(const uint8* rgbframe, | |
17 uint8* yplane, | |
18 uint8* uplane, | |
19 uint8* vplane, | |
20 int width, | |
21 int height, | |
22 int rgbstride, | |
23 int ystride, | |
24 int uvstride); | |
25 | 15 |
26 // Converts an RGB image to a YV12 image. This function is almost same as | 16 MEDIA_EXPORT void ConvertRGB32ToYUV_SSSE3(const uint8* rgbframe, |
27 // ConvertRGB32ToYUV_SSSE3 except its first argument is a pointer to RGB pixels. | 17 uint8* yplane, |
28 void ConvertRGB24ToYUV_SSSE3(const uint8* rgbframe, | 18 uint8* uplane, |
29 uint8* yplane, | 19 uint8* vplane, |
30 uint8* uplane, | 20 int width, |
31 uint8* vplane, | 21 int height, |
32 int width, | 22 int rgbstride, |
33 int height, | 23 int ystride, |
34 int rgbstride, | 24 int uvstride); |
35 int ystride, | |
36 int uvstride); | |
37 | 25 |
38 // SSE2 version of converting RGBA to YV12. | 26 MEDIA_EXPORT void ConvertRGB24ToYUV_SSSE3(const uint8* rgbframe, |
39 void ConvertRGB32ToYUV_SSE2(const uint8* rgbframe, | 27 uint8* yplane, |
40 uint8* yplane, | 28 uint8* uplane, |
41 uint8* uplane, | 29 uint8* vplane, |
42 uint8* vplane, | 30 int width, |
43 int width, | 31 int height, |
44 int height, | 32 int rgbstride, |
45 int rgbstride, | 33 int ystride, |
46 int ystride, | 34 int uvstride); |
47 int uvstride); | |
48 | 35 |
49 // This is a C reference implementation of the above routine. | 36 MEDIA_EXPORT void ConvertRGB32ToYUV_SSE2(const uint8* rgbframe, |
50 // This method should only be used in unit test. | 37 uint8* yplane, |
51 // TODO(hclam): Should use this as the C version of RGB to YUV. | 38 uint8* uplane, |
52 void ConvertRGB32ToYUV_SSE2_Reference(const uint8* rgbframe, | 39 uint8* vplane, |
| 40 int width, |
| 41 int height, |
| 42 int rgbstride, |
| 43 int ystride, |
| 44 int uvstride); |
| 45 |
| 46 MEDIA_EXPORT void ConvertRGB32ToYUV_SSE2_Reference(const uint8* rgbframe, |
| 47 uint8* yplane, |
| 48 uint8* uplane, |
| 49 uint8* vplane, |
| 50 int width, |
| 51 int height, |
| 52 int rgbstride, |
| 53 int ystride, |
| 54 int uvstride); |
| 55 |
| 56 MEDIA_EXPORT void ConvertRGB32ToYUV_C(const uint8* rgbframe, |
53 uint8* yplane, | 57 uint8* yplane, |
54 uint8* uplane, | 58 uint8* uplane, |
55 uint8* vplane, | 59 uint8* vplane, |
56 int width, | 60 int width, |
57 int height, | 61 int height, |
58 int rgbstride, | 62 int rgbstride, |
59 int ystride, | 63 int ystride, |
60 int uvstride); | 64 int uvstride); |
61 | 65 |
62 // C version of converting RGBA to YV12. | 66 MEDIA_EXPORT void ConvertRGB24ToYUV_C(const uint8* rgbframe, |
63 void ConvertRGB32ToYUV_C(const uint8* rgbframe, | 67 uint8* yplane, |
64 uint8* yplane, | 68 uint8* uplane, |
65 uint8* uplane, | 69 uint8* vplane, |
66 uint8* vplane, | 70 int width, |
67 int width, | 71 int height, |
68 int height, | 72 int rgbstride, |
69 int rgbstride, | 73 int ystride, |
70 int ystride, | 74 int uvstride); |
71 int uvstride); | |
72 | |
73 // C version of converting RGB24 to YV12. | |
74 void ConvertRGB24ToYUV_C(const uint8* rgbframe, | |
75 uint8* yplane, | |
76 uint8* uplane, | |
77 uint8* vplane, | |
78 int width, | |
79 int height, | |
80 int rgbstride, | |
81 int ystride, | |
82 int uvstride); | |
83 | 75 |
84 } // namespace media | 76 } // namespace media |
85 | 77 |
86 #endif // MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ | 78 #endif // MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ |
OLD | NEW |