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 |
Ami GONE FROM CHROMIUM
2013/05/18 02:22:04
Worth calling out in a comment that the entirety o
DaleCurtis
2013/05/23 23:43:23
Done.
| |
13 // Converts an ARGB image to a YV12 image. This function calls ASM functions | 13 // Converts an ARGB image to a YV12 image. This function calls ASM functions |
14 // implemented in "convert_rgb_to_yuv_ssse3.asm" to convert the specified ARGB | 14 // implemented in "convert_rgb_to_yuv_ssse3.asm" to convert the specified ARGB |
15 // image to a YV12 image. | 15 // image to a YV12 image. |
16 void ConvertRGB32ToYUV_SSSE3(const uint8* rgbframe, | 16 MEDIA_EXPORT void ConvertRGB32ToYUV_SSSE3(const uint8* rgbframe, |
17 uint8* yplane, | 17 uint8* yplane, |
18 uint8* uplane, | 18 uint8* uplane, |
19 uint8* vplane, | 19 uint8* vplane, |
20 int width, | 20 int width, |
21 int height, | 21 int height, |
22 int rgbstride, | 22 int rgbstride, |
23 int ystride, | 23 int ystride, |
24 int uvstride); | 24 int uvstride); |
25 | 25 |
26 // Converts an RGB image to a YV12 image. This function is almost same as | 26 // Converts an RGB image to a YV12 image. This function is almost same as |
27 // ConvertRGB32ToYUV_SSSE3 except its first argument is a pointer to RGB pixels. | 27 // ConvertRGB32ToYUV_SSSE3 except its first argument is a pointer to RGB pixels. |
28 void ConvertRGB24ToYUV_SSSE3(const uint8* rgbframe, | 28 MEDIA_EXPORT void ConvertRGB24ToYUV_SSSE3(const uint8* rgbframe, |
29 uint8* yplane, | 29 uint8* yplane, |
30 uint8* uplane, | 30 uint8* uplane, |
31 uint8* vplane, | 31 uint8* vplane, |
32 int width, | 32 int width, |
33 int height, | 33 int height, |
34 int rgbstride, | 34 int rgbstride, |
35 int ystride, | 35 int ystride, |
36 int uvstride); | 36 int uvstride); |
37 | 37 |
38 // SSE2 version of converting RGBA to YV12. | 38 // SSE2 version of converting RGBA to YV12. |
39 void ConvertRGB32ToYUV_SSE2(const uint8* rgbframe, | 39 MEDIA_EXPORT void ConvertRGB32ToYUV_SSE2(const uint8* rgbframe, |
40 uint8* yplane, | 40 uint8* yplane, |
41 uint8* uplane, | 41 uint8* uplane, |
42 uint8* vplane, | 42 uint8* vplane, |
43 int width, | 43 int width, |
44 int height, | 44 int height, |
45 int rgbstride, | 45 int rgbstride, |
46 int ystride, | 46 int ystride, |
47 int uvstride); | 47 int uvstride); |
48 | 48 |
49 // This is a C reference implementation of the above routine. | 49 // This is a C reference implementation of the above routine. |
50 // This method should only be used in unit test. | 50 // This method should only be used in unit test. |
51 // TODO(hclam): Should use this as the C version of RGB to YUV. | 51 // TODO(hclam): Should use this as the C version of RGB to YUV. |
Ami GONE FROM CHROMIUM
2013/05/18 02:22:04
umm, wat?
DaleCurtis
2013/05/23 23:43:23
wakka wakka!
| |
52 void ConvertRGB32ToYUV_SSE2_Reference(const uint8* rgbframe, | 52 MEDIA_EXPORT void ConvertRGB32ToYUV_SSE2_Reference(const uint8* rgbframe, |
53 uint8* yplane, | |
54 uint8* uplane, | |
55 uint8* vplane, | |
56 int width, | |
57 int height, | |
58 int rgbstride, | |
59 int ystride, | |
60 int uvstride); | |
61 | |
62 // C version of converting RGBA to YV12. | |
Ami GONE FROM CHROMIUM
2013/05/18 02:22:04
This and most of the rest the one-liner comments i
DaleCurtis
2013/05/23 23:43:23
Like Cage in Knowing, they've embraced the sun's n
| |
63 MEDIA_EXPORT void ConvertRGB32ToYUV_C(const uint8* rgbframe, | |
53 uint8* yplane, | 64 uint8* yplane, |
54 uint8* uplane, | 65 uint8* uplane, |
55 uint8* vplane, | 66 uint8* vplane, |
56 int width, | 67 int width, |
57 int height, | 68 int height, |
58 int rgbstride, | 69 int rgbstride, |
59 int ystride, | 70 int ystride, |
60 int uvstride); | 71 int uvstride); |
61 | 72 |
62 // C version of converting RGBA to YV12. | |
63 void ConvertRGB32ToYUV_C(const uint8* rgbframe, | |
64 uint8* yplane, | |
65 uint8* uplane, | |
66 uint8* vplane, | |
67 int width, | |
68 int height, | |
69 int rgbstride, | |
70 int ystride, | |
71 int uvstride); | |
72 | |
73 // C version of converting RGB24 to YV12. | 73 // C version of converting RGB24 to YV12. |
74 void ConvertRGB24ToYUV_C(const uint8* rgbframe, | 74 MEDIA_EXPORT void ConvertRGB24ToYUV_C(const uint8* rgbframe, |
75 uint8* yplane, | 75 uint8* yplane, |
76 uint8* uplane, | 76 uint8* uplane, |
77 uint8* vplane, | 77 uint8* vplane, |
78 int width, | 78 int width, |
79 int height, | 79 int height, |
80 int rgbstride, | 80 int rgbstride, |
81 int ystride, | 81 int ystride, |
82 int uvstride); | 82 int uvstride); |
83 | 83 |
84 } // namespace media | 84 } // namespace media |
85 | 85 |
86 #endif // MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ | 86 #endif // MEDIA_BASE_SIMD_CONVERT_RGB_TO_YUV_H_ |
OLD | NEW |