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.
11 #include "media/base/simd/convert_yuv_to_rgb.h"
12 #include "media/base/simd/yuv_to_rgb_table.h"
13 #include "media/base/yuv_convert.h"
17 void ConvertYUVToRGB32_MMX(const uint8
* yplane
,
27 unsigned int y_shift
= GetVerticalShift(yuv_type
);
28 for (int y
= 0; y
< height
; ++y
) {
29 uint8
* rgb_row
= rgbframe
+ y
* rgbstride
;
30 const uint8
* y_ptr
= yplane
+ y
* ystride
;
31 const uint8
* u_ptr
= uplane
+ (y
>> y_shift
) * uvstride
;
32 const uint8
* v_ptr
= vplane
+ (y
>> y_shift
) * uvstride
;
34 ConvertYUVToRGB32Row_MMX(y_ptr
,
39 GetLookupTable(yuv_type
));
45 void ConvertYUVAToARGB_MMX(const uint8
* yplane
,
57 unsigned int y_shift
= GetVerticalShift(yuv_type
);
58 for (int y
= 0; y
< height
; ++y
) {
59 uint8
* rgb_row
= rgbframe
+ y
* rgbstride
;
60 const uint8
* y_ptr
= yplane
+ y
* ystride
;
61 const uint8
* u_ptr
= uplane
+ (y
>> y_shift
) * uvstride
;
62 const uint8
* v_ptr
= vplane
+ (y
>> y_shift
) * uvstride
;
63 const uint8
* a_ptr
= aplane
+ y
* astride
;
65 ConvertYUVAToARGBRow_MMX(y_ptr
,
71 GetLookupTable(yuv_type
));
77 void ConvertYUVToRGB32_SSE(const uint8
* yplane
,
87 unsigned int y_shift
= GetVerticalShift(yuv_type
);
88 for (int y
= 0; y
< height
; ++y
) {
89 uint8
* rgb_row
= rgbframe
+ y
* rgbstride
;
90 const uint8
* y_ptr
= yplane
+ y
* ystride
;
91 const uint8
* u_ptr
= uplane
+ (y
>> y_shift
) * uvstride
;
92 const uint8
* v_ptr
= vplane
+ (y
>> y_shift
) * uvstride
;
94 ConvertYUVToRGB32Row_SSE(y_ptr
,
99 GetLookupTable(yuv_type
));
102 EmptyRegisterState();