| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2463 src_y = src_y + (height - 1) * src_stride_y; | 2463 src_y = src_y + (height - 1) * src_stride_y; |
| 2464 src_stride_y = -src_stride_y; | 2464 src_stride_y = -src_stride_y; |
| 2465 } | 2465 } |
| 2466 // Coalesce rows. | 2466 // Coalesce rows. |
| 2467 if (src_stride_y == width && | 2467 if (src_stride_y == width && |
| 2468 dst_stride_y == width) { | 2468 dst_stride_y == width) { |
| 2469 width *= height; | 2469 width *= height; |
| 2470 height = 1; | 2470 height = 1; |
| 2471 src_stride_y = dst_stride_y = 0; | 2471 src_stride_y = dst_stride_y = 0; |
| 2472 } | 2472 } |
| 2473 #if defined(HAS_HALFFLOATROW_SSE2) |
| 2474 if (TestCpuFlag(kCpuHasSSE2)) { |
| 2475 HalfFloatRow = HalfFloatRow_Any_SSE2; |
| 2476 if (IS_ALIGNED(width, 8)) { |
| 2477 HalfFloatRow = HalfFloatRow_SSE2; |
| 2478 } |
| 2479 } |
| 2480 #endif |
| 2473 #if defined(HAS_HALFFLOATROW_AVX2) | 2481 #if defined(HAS_HALFFLOATROW_AVX2) |
| 2474 if (TestCpuFlag(kCpuHasAVX2)) { | 2482 if (TestCpuFlag(kCpuHasAVX2)) { |
| 2475 HalfFloatRow = HalfFloatRow_Any_AVX2; | 2483 HalfFloatRow = HalfFloatRow_Any_AVX2; |
| 2476 if (IS_ALIGNED(width, 16)) { | 2484 if (IS_ALIGNED(width, 16)) { |
| 2477 HalfFloatRow = HalfFloatRow_AVX2; | 2485 HalfFloatRow = HalfFloatRow_AVX2; |
| 2478 } | 2486 } |
| 2479 } | 2487 } |
| 2480 #endif | 2488 #endif |
| 2489 #if defined(HAS_HALFFLOATROW_AVX) |
| 2490 if (TestCpuFlag(kCpuHasAVX)) { |
| 2491 // HalfFloatRow = HalfFloatRow_Any_AVX2; |
| 2492 if (IS_ALIGNED(width, 16)) { |
| 2493 HalfFloatRow = HalfFloatRow_AVX; |
| 2494 } |
| 2495 } |
| 2496 #endif |
| 2481 | 2497 |
| 2482 for (y = 0; y < height; ++y) { | 2498 for (y = 0; y < height; ++y) { |
| 2483 HalfFloatRow(src_y, dst_y, scale, width); | 2499 HalfFloatRow(src_y, dst_y, scale, width); |
| 2484 src_y += src_stride_y; | 2500 src_y += src_stride_y; |
| 2485 dst_y += dst_stride_y; | 2501 dst_y += dst_stride_y; |
| 2486 } | 2502 } |
| 2487 return 0; | 2503 return 0; |
| 2488 } | 2504 } |
| 2489 | 2505 |
| 2490 // Apply a lumacolortable to each ARGB pixel. | 2506 // Apply a lumacolortable to each ARGB pixel. |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2864 } | 2880 } |
| 2865 free_aligned_buffer_64(rows); | 2881 free_aligned_buffer_64(rows); |
| 2866 } | 2882 } |
| 2867 return 0; | 2883 return 0; |
| 2868 } | 2884 } |
| 2869 | 2885 |
| 2870 #ifdef __cplusplus | 2886 #ifdef __cplusplus |
| 2871 } // extern "C" | 2887 } // extern "C" |
| 2872 } // namespace libyuv | 2888 } // namespace libyuv |
| 2873 #endif | 2889 #endif |
| OLD | NEW |