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 ConvertYUVAToARGB_MMX(const uint8* yplane,
79 MEDIA_EXPORT void ScaleYUVToRGB32Row_C(const uint8* y_buf,
85 const int16 convert_table[1024][4]);
87 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_C(
94 const int16 convert_table[1024][4]);
96 MEDIA_EXPORT void LinearScaleYUVToRGB32RowWithRange_C(
104 const int16 convert_table[1024][4]);
108 // Assembly functions are declared without namespace.
111 // We use ptrdiff_t instead of int for yasm routine parameters to portably
112 // sign-extend int. On Win64, MSVC does not sign-extend the value in the stack
113 // home of int function parameters, and yasm routines are unaware of this lack
114 // of extension and fault. ptrdiff_t is portably sign-extended and fixes this
115 // issue on at least Win64. The C-equivalent RowProc versions' prototypes
116 // include the same change to ptrdiff_t to reuse the typedefs.
118 MEDIA_EXPORT void ConvertYUVAToARGBRow_MMX(const uint8* yplane,
124 const int16 convert_table[1024][4]);
126 MEDIA_EXPORT void ConvertYUVToRGB32Row_SSE(const uint8* yplane,
131 const int16 convert_table[1024][4]);
133 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE(const uint8* y_buf,
139 const int16 convert_table[1024][4]);
141 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE2_X64(
148 const int16 convert_table[1024][4]);
150 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_SSE(
157 const int16 convert_table[1024][4]);
159 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX_X64(
166 const int16 convert_table[1024][4]);
170 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_