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 #include "media/base/simd/yuv_to_rgb_table.h" | 5 #include "media/base/simd/yuv_to_rgb_table.h" |
6 | 6 |
7 extern "C" { | 7 extern "C" { |
8 | 8 |
9 // Defines the R,G,B,A contributions from Y. | 9 // Defines the R,G,B,A contributions from Y. |
10 #define RGBY(i) { \ | 10 #define RGBY(i) { \ |
(...skipping 25 matching lines...) Expand all Loading... |
36 #define ALPHA(i) { \ | 36 #define ALPHA(i) { \ |
37 i, i, i, i \ | 37 i, i, i, i \ |
38 } | 38 } |
39 | 39 |
40 // The following table defines the RGBA contributions | 40 // The following table defines the RGBA contributions |
41 // for each component of YUVA. The Y table is first followed | 41 // for each component of YUVA. The Y table is first followed |
42 // by the U, and V tables. The alpha multiplier table follows. | 42 // by the U, and V tables. The alpha multiplier table follows. |
43 // These tables are aligned and kept adjacent to optimize for | 43 // These tables are aligned and kept adjacent to optimize for |
44 // SIMD and cacheing. | 44 // SIMD and cacheing. |
45 | 45 |
46 SIMD_ALIGNED(int16 kCoefficientsRgbY[256 * 4][4]) = { | 46 SIMD_ALIGNED(const int16 kCoefficientsRgbY[256 * 4][4]) = { |
47 RGBY(0x00), RGBY(0x01), RGBY(0x02), RGBY(0x03), | 47 RGBY(0x00), RGBY(0x01), RGBY(0x02), RGBY(0x03), |
48 RGBY(0x04), RGBY(0x05), RGBY(0x06), RGBY(0x07), | 48 RGBY(0x04), RGBY(0x05), RGBY(0x06), RGBY(0x07), |
49 RGBY(0x08), RGBY(0x09), RGBY(0x0A), RGBY(0x0B), | 49 RGBY(0x08), RGBY(0x09), RGBY(0x0A), RGBY(0x0B), |
50 RGBY(0x0C), RGBY(0x0D), RGBY(0x0E), RGBY(0x0F), | 50 RGBY(0x0C), RGBY(0x0D), RGBY(0x0E), RGBY(0x0F), |
51 RGBY(0x10), RGBY(0x11), RGBY(0x12), RGBY(0x13), | 51 RGBY(0x10), RGBY(0x11), RGBY(0x12), RGBY(0x13), |
52 RGBY(0x14), RGBY(0x15), RGBY(0x16), RGBY(0x17), | 52 RGBY(0x14), RGBY(0x15), RGBY(0x16), RGBY(0x17), |
53 RGBY(0x18), RGBY(0x19), RGBY(0x1A), RGBY(0x1B), | 53 RGBY(0x18), RGBY(0x19), RGBY(0x1A), RGBY(0x1B), |
54 RGBY(0x1C), RGBY(0x1D), RGBY(0x1E), RGBY(0x1F), | 54 RGBY(0x1C), RGBY(0x1D), RGBY(0x1E), RGBY(0x1F), |
55 RGBY(0x20), RGBY(0x21), RGBY(0x22), RGBY(0x23), | 55 RGBY(0x20), RGBY(0x21), RGBY(0x22), RGBY(0x23), |
56 RGBY(0x24), RGBY(0x25), RGBY(0x26), RGBY(0x27), | 56 RGBY(0x24), RGBY(0x25), RGBY(0x26), RGBY(0x27), |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 ALPHA(0xF8), ALPHA(0xF9), ALPHA(0xFA), ALPHA(0xFB), | 307 ALPHA(0xF8), ALPHA(0xF9), ALPHA(0xFA), ALPHA(0xFB), |
308 ALPHA(0xFC), ALPHA(0xFD), ALPHA(0xFE), ALPHA(0xFF), | 308 ALPHA(0xFC), ALPHA(0xFD), ALPHA(0xFE), ALPHA(0xFF), |
309 }; | 309 }; |
310 | 310 |
311 #undef RGBY | 311 #undef RGBY |
312 #undef RGBU | 312 #undef RGBU |
313 #undef RGBV | 313 #undef RGBV |
314 #undef ALPHA | 314 #undef ALPHA |
315 | 315 |
316 } // extern "C" | 316 } // extern "C" |
OLD | NEW |