OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2012 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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 } | 969 } |
970 #endif | 970 #endif |
971 #if defined(HAS_ARGBTORGB565DITHERROW_NEON) | 971 #if defined(HAS_ARGBTORGB565DITHERROW_NEON) |
972 if (TestCpuFlag(kCpuHasNEON)) { | 972 if (TestCpuFlag(kCpuHasNEON)) { |
973 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_NEON; | 973 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_NEON; |
974 if (IS_ALIGNED(width, 8)) { | 974 if (IS_ALIGNED(width, 8)) { |
975 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_NEON; | 975 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_NEON; |
976 } | 976 } |
977 } | 977 } |
978 #endif | 978 #endif |
| 979 #if defined(HAS_ARGBTORGB565DITHERROW_MSA) |
| 980 if (TestCpuFlag(kCpuHasMSA)) { |
| 981 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MSA; |
| 982 if (IS_ALIGNED(width, 8)) { |
| 983 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_MSA; |
| 984 } |
| 985 } |
| 986 #endif |
979 { | 987 { |
980 // Allocate a row of argb. | 988 // Allocate a row of argb. |
981 align_buffer_64(row_argb, width * 4); | 989 align_buffer_64(row_argb, width * 4); |
982 for (y = 0; y < height; ++y) { | 990 for (y = 0; y < height; ++y) { |
983 I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width); | 991 I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width); |
984 ARGBToRGB565DitherRow(row_argb, dst_rgb565, | 992 ARGBToRGB565DitherRow(row_argb, dst_rgb565, |
985 *(uint32*)(dither4x4 + ((y & 3) << 2)), | 993 *(uint32*)(dither4x4 + ((y & 3) << 2)), |
986 width); // NOLINT | 994 width); // NOLINT |
987 dst_rgb565 += dst_stride_rgb565; | 995 dst_rgb565 += dst_stride_rgb565; |
988 src_y += src_stride_y; | 996 src_y += src_stride_y; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 default: | 1155 default: |
1148 return -1; // unknown fourcc - return failure code. | 1156 return -1; // unknown fourcc - return failure code. |
1149 } | 1157 } |
1150 return r; | 1158 return r; |
1151 } | 1159 } |
1152 | 1160 |
1153 #ifdef __cplusplus | 1161 #ifdef __cplusplus |
1154 } // extern "C" | 1162 } // extern "C" |
1155 } // namespace libyuv | 1163 } // namespace libyuv |
1156 #endif | 1164 #endif |
OLD | NEW |