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 // 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 22 matching lines...) Expand all Loading... |
33 #endif | 33 #endif |
34 #endif | 34 #endif |
35 | 35 |
36 // Assembly functions are declared without namespace. | 36 // Assembly functions are declared without namespace. |
37 extern "C" { | 37 extern "C" { |
38 void EmptyRegisterState_MMX(); | 38 void EmptyRegisterState_MMX(); |
39 } // extern "C" | 39 } // extern "C" |
40 | 40 |
41 namespace media { | 41 namespace media { |
42 | 42 |
| 43 typedef void (*FilterYUVRowsProc)(uint8*, const uint8*, const uint8*, int, int); |
| 44 |
| 45 typedef void (*ConvertYUVToRGB32Proc)(const uint8*, |
| 46 const uint8*, |
| 47 const uint8*, |
| 48 uint8*, |
| 49 int, |
| 50 int, |
| 51 int, |
| 52 int, |
| 53 int, |
| 54 YUVType); |
| 55 |
| 56 typedef void (*ConvertYUVAToARGBProc)(const uint8*, |
| 57 const uint8*, |
| 58 const uint8*, |
| 59 const uint8*, |
| 60 uint8*, |
| 61 int, |
| 62 int, |
| 63 int, |
| 64 int, |
| 65 int, |
| 66 int, |
| 67 YUVType); |
| 68 |
| 69 typedef void (*ConvertYUVToRGB32RowProc)(const uint8*, |
| 70 const uint8*, |
| 71 const uint8*, |
| 72 uint8*, |
| 73 ptrdiff_t); |
| 74 |
| 75 typedef void (*ConvertYUVAToARGBRowProc)(const uint8*, |
| 76 const uint8*, |
| 77 const uint8*, |
| 78 const uint8*, |
| 79 uint8*, |
| 80 ptrdiff_t); |
| 81 |
| 82 typedef void (*ScaleYUVToRGB32RowProc)(const uint8*, |
| 83 const uint8*, |
| 84 const uint8*, |
| 85 uint8*, |
| 86 ptrdiff_t, |
| 87 ptrdiff_t); |
| 88 |
43 static FilterYUVRowsProc ChooseFilterYUVRowsProc() { | 89 static FilterYUVRowsProc ChooseFilterYUVRowsProc() { |
44 #if defined(ARCH_CPU_X86_FAMILY) | 90 #if defined(ARCH_CPU_X86_FAMILY) |
45 base::CPU cpu; | 91 base::CPU cpu; |
46 if (cpu.has_sse2()) | 92 if (cpu.has_sse2()) |
47 return &FilterYUVRows_SSE2; | 93 return &FilterYUVRows_SSE2; |
48 | 94 |
49 #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) | 95 #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) |
50 if (cpu.has_mmx()) | 96 if (cpu.has_mmx()) |
51 return &FilterYUVRows_MMX; | 97 return &FilterYUVRows_MMX; |
52 #endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) | 98 #endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 convert_proc = &ConvertYUVAToARGB_MMX; | 673 convert_proc = &ConvertYUVAToARGB_MMX; |
628 else | 674 else |
629 convert_proc = &ConvertYUVAToARGB_C; | 675 convert_proc = &ConvertYUVAToARGB_C; |
630 } | 676 } |
631 convert_proc(yplane, uplane, vplane, aplane, rgbframe, | 677 convert_proc(yplane, uplane, vplane, aplane, rgbframe, |
632 width, height, ystride, uvstride, astride, rgbstride, yuv_type); | 678 width, height, ystride, uvstride, astride, rgbstride, yuv_type); |
633 #endif | 679 #endif |
634 } | 680 } |
635 | 681 |
636 } // namespace media | 682 } // namespace media |
OLD | NEW |