| 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "media/base/simd/convert_rgb_to_yuv.h" | 6 #include "media/base/simd/convert_rgb_to_yuv.h" |
| 7 #include "media/base/simd/yuv_to_rgb_table.h" | |
| 8 | 7 |
| 9 #if defined(COMPILER_MSVC) | 8 #if defined(COMPILER_MSVC) |
| 10 #include <intrin.h> | 9 #include <intrin.h> |
| 11 #else | 10 #else |
| 12 #include <mmintrin.h> | 11 #include <mmintrin.h> |
| 13 #include <emmintrin.h> | 12 #include <emmintrin.h> |
| 14 #endif | 13 #endif |
| 15 | 14 |
| 15 #if defined(COMPILER_MSVC) |
| 16 #define SIMD_ALIGNED(var) __declspec(align(16)) var |
| 17 #else |
| 18 #define SIMD_ALIGNED(var) var __attribute__((aligned(16))) |
| 19 #endif |
| 20 |
| 16 namespace media { | 21 namespace media { |
| 17 | 22 |
| 18 #define FIX_SHIFT 12 | 23 #define FIX_SHIFT 12 |
| 19 #define FIX(x) ((x) * (1 << FIX_SHIFT)) | 24 #define FIX(x) ((x) * (1 << FIX_SHIFT)) |
| 20 | 25 |
| 21 // Define a convenient macro to do static cast. | 26 // Define a convenient macro to do static cast. |
| 22 #define INT16_FIX(x) static_cast<int16>(FIX(x)) | 27 #define INT16_FIX(x) static_cast<int16>(FIX(x)) |
| 23 | 28 |
| 24 // Android's pixel layout is RGBA, while other platforms | 29 // Android's pixel layout is RGBA, while other platforms |
| 25 // are BGRA. | 30 // are BGRA. |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 ++vplane; | 408 ++vplane; |
| 404 width -= 2; | 409 width -= 2; |
| 405 } | 410 } |
| 406 | 411 |
| 407 // Handle the last pixel in the last row. | 412 // Handle the last pixel in the last row. |
| 408 if (width) | 413 if (width) |
| 409 ConvertRGBToYUV_V1H1(rgbframe, yplane, uplane, vplane); | 414 ConvertRGBToYUV_V1H1(rgbframe, yplane, uplane, vplane); |
| 410 } | 415 } |
| 411 | 416 |
| 412 } // namespace media | 417 } // namespace media |
| OLD | NEW |