| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // excerpt from wiki: | 9 // excerpt from wiki: |
| 10 // These formulae are based on the NTSC standard; | 10 // These formulae are based on the NTSC standard; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #ifdef _DEBUG | 70 #ifdef _DEBUG |
| 71 #include "base/logging.h" | 71 #include "base/logging.h" |
| 72 #else | 72 #else |
| 73 #define DCHECK(a) | 73 #define DCHECK(a) |
| 74 #endif | 74 #endif |
| 75 | 75 |
| 76 // MMX for Windows, Linux and Mac. | 76 // MMX for Windows, Linux and Mac. |
| 77 // C++ code provided as a fall back. | 77 // C++ code provided as a fall back. |
| 78 // Compile with /DUSE_MMX=0 | 78 // Compile with /DUSE_MMX=0 |
| 79 #ifndef USE_MMX | 79 #ifndef USE_MMX |
| 80 |
| 81 #ifdef ARCH_CPU_ARM_FAMILY |
| 82 #define USE_MMX 0 |
| 83 #else |
| 80 #define USE_MMX 1 | 84 #define USE_MMX 1 |
| 81 #endif | 85 #endif |
| 86 #endif |
| 82 | 87 |
| 83 namespace media { | 88 namespace media { |
| 84 | 89 |
| 85 #if USE_MMX | 90 #if USE_MMX |
| 86 | 91 |
| 87 #define RGBY(i) { \ | 92 #define RGBY(i) { \ |
| 88 static_cast<int16>(1.164 * 64 * (i - 16) + 0.5), \ | 93 static_cast<int16>(1.164 * 64 * (i - 16) + 0.5), \ |
| 89 static_cast<int16>(1.164 * 64 * (i - 16) + 0.5), \ | 94 static_cast<int16>(1.164 * 64 * (i - 16) + 0.5), \ |
| 90 static_cast<int16>(1.164 * 64 * (i - 16) + 0.5), \ | 95 static_cast<int16>(1.164 * 64 * (i - 16) + 0.5), \ |
| 91 0 \ | 96 0 \ |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 (clip(C298b + cr) << 16) | | 668 (clip(C298b + cr) << 16) | |
| 664 0xff000000; | 669 0xff000000; |
| 665 | 670 |
| 666 rgb_buf += 8; // Advance 2 pixels. | 671 rgb_buf += 8; // Advance 2 pixels. |
| 667 } | 672 } |
| 668 } | 673 } |
| 669 #endif | 674 #endif |
| 670 | 675 |
| 671 | 676 |
| 672 } // namespace media | 677 } // namespace media |
| 673 | |
| OLD | NEW |