| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #if defined(_MSC_VER) | 5 #if defined(_MSC_VER) |
| 6 #include <intrin.h> | 6 #include <intrin.h> |
| 7 #else | 7 #else |
| 8 #include <mmintrin.h> | 8 #include <mmintrin.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ConvertYUVToRGB32Row_MMX(y_ptr, | 33 ConvertYUVToRGB32Row_MMX(y_ptr, |
| 34 u_ptr, | 34 u_ptr, |
| 35 v_ptr, | 35 v_ptr, |
| 36 rgb_row, | 36 rgb_row, |
| 37 width); | 37 width); |
| 38 } | 38 } |
| 39 | 39 |
| 40 _mm_empty(); | 40 _mm_empty(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void ConvertYUVAToARGB_MMX(const uint8* yplane, |
| 44 const uint8* uplane, |
| 45 const uint8* vplane, |
| 46 const uint8* aplane, |
| 47 uint8* rgbframe, |
| 48 int width, |
| 49 int height, |
| 50 int ystride, |
| 51 int uvstride, |
| 52 int astride, |
| 53 int rgbstride, |
| 54 YUVType yuv_type) { |
| 55 unsigned int y_shift = yuv_type; |
| 56 for (int y = 0; y < height; y++) { |
| 57 uint8* rgb_row = rgbframe + y * rgbstride; |
| 58 const uint8* y_ptr = yplane + y * ystride; |
| 59 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; |
| 60 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; |
| 61 const uint8* a_ptr = aplane + y * astride; |
| 62 |
| 63 ConvertYUVAToARGBRow_MMX(y_ptr, |
| 64 u_ptr, |
| 65 v_ptr, |
| 66 a_ptr, |
| 67 rgb_row, |
| 68 width); |
| 69 } |
| 70 |
| 71 _mm_empty(); |
| 72 } |
| 73 |
| 43 void ConvertYUVToRGB32_SSE(const uint8* yplane, | 74 void ConvertYUVToRGB32_SSE(const uint8* yplane, |
| 44 const uint8* uplane, | 75 const uint8* uplane, |
| 45 const uint8* vplane, | 76 const uint8* vplane, |
| 46 uint8* rgbframe, | 77 uint8* rgbframe, |
| 47 int width, | 78 int width, |
| 48 int height, | 79 int height, |
| 49 int ystride, | 80 int ystride, |
| 50 int uvstride, | 81 int uvstride, |
| 51 int rgbstride, | 82 int rgbstride, |
| 52 YUVType yuv_type) { | 83 YUVType yuv_type) { |
| 53 unsigned int y_shift = yuv_type; | 84 unsigned int y_shift = yuv_type; |
| 54 for (int y = 0; y < height; ++y) { | 85 for (int y = 0; y < height; ++y) { |
| 55 uint8* rgb_row = rgbframe + y * rgbstride; | 86 uint8* rgb_row = rgbframe + y * rgbstride; |
| 56 const uint8* y_ptr = yplane + y * ystride; | 87 const uint8* y_ptr = yplane + y * ystride; |
| 57 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; | 88 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; |
| 58 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; | 89 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; |
| 59 | 90 |
| 60 ConvertYUVToRGB32Row_SSE(y_ptr, | 91 ConvertYUVToRGB32Row_SSE(y_ptr, |
| 61 u_ptr, | 92 u_ptr, |
| 62 v_ptr, | 93 v_ptr, |
| 63 rgb_row, | 94 rgb_row, |
| 64 width); | 95 width); |
| 65 } | 96 } |
| 66 | 97 |
| 67 _mm_empty(); | 98 _mm_empty(); |
| 68 } | 99 } |
| 69 | 100 |
| 70 } // namespace media | 101 } // namespace media |
| OLD | NEW |