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
3 // found in the LICENSE file.
5 #ifndef MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_
6 #define MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_
8 #include "base/basictypes.h"
9 #include "media/base/yuv_convert.h"
13 // These methods are exported for testing purposes only. Library users should
14 // only call the methods listed in yuv_convert.h.
16 MEDIA_EXPORT
void ConvertYUVToRGB32_C(const uint8
* yplane
,
27 MEDIA_EXPORT
void ConvertYUVToRGB32Row_C(const uint8
* yplane
,
32 const int16 convert_table
[1024][4]);
34 MEDIA_EXPORT
void ConvertYUVAToARGB_C(const uint8
* yplane
,
47 MEDIA_EXPORT
void ConvertYUVAToARGBRow_C(const uint8
* yplane
,
53 const int16 convert_table
[1024][4]);
55 MEDIA_EXPORT
void ConvertYUVToRGB32_SSE(const uint8
* yplane
,
66 MEDIA_EXPORT
void ConvertYUVToRGB32_MMX(const uint8
* yplane
,
77 MEDIA_EXPORT
void ConvertYUVAToARGB_MMX(const uint8
* yplane
,
90 MEDIA_EXPORT
void ScaleYUVToRGB32Row_C(const uint8
* y_buf
,
96 const int16 convert_table
[1024][4]);
98 MEDIA_EXPORT
void LinearScaleYUVToRGB32Row_C(
105 const int16 convert_table
[1024][4]);
107 MEDIA_EXPORT
void LinearScaleYUVToRGB32RowWithRange_C(
115 const int16 convert_table
[1024][4]);
119 // Assembly functions are declared without namespace.
122 // We use ptrdiff_t instead of int for yasm routine parameters to portably
123 // sign-extend int. On Win64, MSVC does not sign-extend the value in the stack
124 // home of int function parameters, and yasm routines are unaware of this lack
125 // of extension and fault. ptrdiff_t is portably sign-extended and fixes this
126 // issue on at least Win64. The C-equivalent RowProc versions' prototypes
127 // include the same change to ptrdiff_t to reuse the typedefs.
129 MEDIA_EXPORT
void ConvertYUVToRGB32Row_MMX(const uint8
* yplane
,
134 const int16 convert_table
[1024][4]);
136 MEDIA_EXPORT
void ConvertYUVAToARGBRow_MMX(const uint8
* yplane
,
142 const int16 convert_table
[1024][4]);
144 MEDIA_EXPORT
void ConvertYUVToRGB32Row_SSE(const uint8
* yplane
,
149 const int16 convert_table
[1024][4]);
151 MEDIA_EXPORT
void ScaleYUVToRGB32Row_MMX(const uint8
* y_buf
,
157 const int16 convert_table
[1024][4]);
159 MEDIA_EXPORT
void ScaleYUVToRGB32Row_SSE(const uint8
* y_buf
,
165 const int16 convert_table
[1024][4]);
167 MEDIA_EXPORT
void ScaleYUVToRGB32Row_SSE2_X64(
174 const int16 convert_table
[1024][4]);
176 MEDIA_EXPORT
void LinearScaleYUVToRGB32Row_MMX(
183 const int16 convert_table
[1024][4]);
185 MEDIA_EXPORT
void LinearScaleYUVToRGB32Row_SSE(
192 const int16 convert_table
[1024][4]);
194 MEDIA_EXPORT
void LinearScaleYUVToRGB32Row_MMX_X64(
201 const int16 convert_table
[1024][4]);
205 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_