OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This webpage shows layout of YV12 and other YUV formats | 5 // This webpage shows layout of YV12 and other YUV formats |
6 // http://www.fourcc.org/yuv.php | 6 // http://www.fourcc.org/yuv.php |
7 // The actual conversion is best described here | 7 // The actual conversion is best described here |
8 // http://en.wikipedia.org/wiki/YUV | 8 // http://en.wikipedia.org/wiki/YUV |
9 // An article on optimizing YUV conversion using tables instead of multiplies | 9 // An article on optimizing YUV conversion using tables instead of multiplies |
10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf | 10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "media/base/yuv_row.h" | 21 #include "media/base/yuv_row.h" |
22 | 22 |
23 #if USE_MMX | 23 #if USE_MMX |
24 #if defined(_MSC_VER) | 24 #if defined(_MSC_VER) |
25 #include <intrin.h> | 25 #include <intrin.h> |
26 #else | 26 #else |
27 #include <mmintrin.h> | 27 #include <mmintrin.h> |
28 #endif | 28 #endif |
29 #endif | 29 #endif |
30 | 30 |
31 #if USE_SSE || USE_MMX | 31 #if USE_SSE |
32 #include <emmintrin.h> | 32 #include <emmintrin.h> |
33 #endif | 33 #endif |
34 | 34 |
35 namespace media { | 35 namespace media { |
36 | 36 |
37 // 16.16 fixed point arithmetic. | 37 // 16.16 fixed point arithmetic. |
38 const int kFractionBits = 16; | 38 const int kFractionBits = 16; |
39 const int kFractionMax = 1 << kFractionBits; | 39 const int kFractionMax = 1 << kFractionBits; |
40 | 40 |
41 // Convert a frame of YUV to 32 bit ARGB. | 41 // Convert a frame of YUV to 32 bit ARGB. |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 ScaleYUVToRGB32Row(y_ptr, u_ptr, v_ptr, | 293 ScaleYUVToRGB32Row(y_ptr, u_ptr, v_ptr, |
294 dest_pixel, scaled_width, scaled_dx); | 294 dest_pixel, scaled_width, scaled_dx); |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 // MMX used for FastConvertYUVToRGB32Row requires emms instruction. | 298 // MMX used for FastConvertYUVToRGB32Row requires emms instruction. |
299 EMMS(); | 299 EMMS(); |
300 } | 300 } |
301 | 301 |
302 } // namespace media | 302 } // namespace media |
OLD | NEW |