Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Side by Side Diff: source/convert_from.cc

Issue 2378753004: Add MSA optimized I422ToYUY2Row, I422ToUYVYRow functions (Closed)
Patch Set: Updated as per review comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/libyuv/row.h ('k') | source/convert_from_argb.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 #endif 231 #endif
232 #if defined(HAS_I422TOYUY2ROW_NEON) 232 #if defined(HAS_I422TOYUY2ROW_NEON)
233 if (TestCpuFlag(kCpuHasNEON)) { 233 if (TestCpuFlag(kCpuHasNEON)) {
234 I422ToYUY2Row = I422ToYUY2Row_Any_NEON; 234 I422ToYUY2Row = I422ToYUY2Row_Any_NEON;
235 if (IS_ALIGNED(width, 16)) { 235 if (IS_ALIGNED(width, 16)) {
236 I422ToYUY2Row = I422ToYUY2Row_NEON; 236 I422ToYUY2Row = I422ToYUY2Row_NEON;
237 } 237 }
238 } 238 }
239 #endif 239 #endif
240 #if defined(HAS_I422TOYUY2ROW_MSA)
241 if (TestCpuFlag(kCpuHasMSA)) {
242 I422ToYUY2Row = I422ToYUY2Row_Any_MSA;
243 if (IS_ALIGNED(width, 32)) {
244 I422ToYUY2Row = I422ToYUY2Row_MSA;
245 }
246 }
247 #endif
240 248
241 for (y = 0; y < height - 1; y += 2) { 249 for (y = 0; y < height - 1; y += 2) {
242 I422ToYUY2Row(src_y, src_u, src_v, dst_yuy2, width); 250 I422ToYUY2Row(src_y, src_u, src_v, dst_yuy2, width);
243 I422ToYUY2Row(src_y + src_stride_y, src_u, src_v, 251 I422ToYUY2Row(src_y + src_stride_y, src_u, src_v,
244 dst_yuy2 + dst_stride_yuy2, width); 252 dst_yuy2 + dst_stride_yuy2, width);
245 src_y += src_stride_y * 2; 253 src_y += src_stride_y * 2;
246 src_u += src_stride_u; 254 src_u += src_stride_u;
247 src_v += src_stride_v; 255 src_v += src_stride_v;
248 dst_yuy2 += dst_stride_yuy2 * 2; 256 dst_yuy2 += dst_stride_yuy2 * 2;
249 } 257 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 299 }
292 #endif 300 #endif
293 #if defined(HAS_I422TOUYVYROW_NEON) 301 #if defined(HAS_I422TOUYVYROW_NEON)
294 if (TestCpuFlag(kCpuHasNEON)) { 302 if (TestCpuFlag(kCpuHasNEON)) {
295 I422ToUYVYRow = I422ToUYVYRow_Any_NEON; 303 I422ToUYVYRow = I422ToUYVYRow_Any_NEON;
296 if (IS_ALIGNED(width, 16)) { 304 if (IS_ALIGNED(width, 16)) {
297 I422ToUYVYRow = I422ToUYVYRow_NEON; 305 I422ToUYVYRow = I422ToUYVYRow_NEON;
298 } 306 }
299 } 307 }
300 #endif 308 #endif
309 #if defined(HAS_I422TOUYVYROW_MSA)
310 if (TestCpuFlag(kCpuHasMSA)) {
311 I422ToUYVYRow = I422ToUYVYRow_Any_MSA;
312 if (IS_ALIGNED(width, 32)) {
313 I422ToUYVYRow = I422ToUYVYRow_MSA;
314 }
315 }
316 #endif
301 317
302 for (y = 0; y < height; ++y) { 318 for (y = 0; y < height; ++y) {
303 I422ToUYVYRow(src_y, src_u, src_v, dst_uyvy, width); 319 I422ToUYVYRow(src_y, src_u, src_v, dst_uyvy, width);
304 src_y += src_stride_y; 320 src_y += src_stride_y;
305 src_u += src_stride_u; 321 src_u += src_stride_u;
306 src_v += src_stride_v; 322 src_v += src_stride_v;
307 dst_uyvy += dst_stride_uyvy; 323 dst_uyvy += dst_stride_uyvy;
308 } 324 }
309 return 0; 325 return 0;
310 } 326 }
(...skipping 27 matching lines...) Expand all
338 } 354 }
339 #endif 355 #endif
340 #if defined(HAS_I422TOUYVYROW_NEON) 356 #if defined(HAS_I422TOUYVYROW_NEON)
341 if (TestCpuFlag(kCpuHasNEON)) { 357 if (TestCpuFlag(kCpuHasNEON)) {
342 I422ToUYVYRow = I422ToUYVYRow_Any_NEON; 358 I422ToUYVYRow = I422ToUYVYRow_Any_NEON;
343 if (IS_ALIGNED(width, 16)) { 359 if (IS_ALIGNED(width, 16)) {
344 I422ToUYVYRow = I422ToUYVYRow_NEON; 360 I422ToUYVYRow = I422ToUYVYRow_NEON;
345 } 361 }
346 } 362 }
347 #endif 363 #endif
364 #if defined(HAS_I422TOUYVYROW_MSA)
365 if (TestCpuFlag(kCpuHasMSA)) {
366 I422ToUYVYRow = I422ToUYVYRow_Any_MSA;
367 if (IS_ALIGNED(width, 32)) {
368 I422ToUYVYRow = I422ToUYVYRow_MSA;
369 }
370 }
371 #endif
348 372
349 for (y = 0; y < height - 1; y += 2) { 373 for (y = 0; y < height - 1; y += 2) {
350 I422ToUYVYRow(src_y, src_u, src_v, dst_uyvy, width); 374 I422ToUYVYRow(src_y, src_u, src_v, dst_uyvy, width);
351 I422ToUYVYRow(src_y + src_stride_y, src_u, src_v, 375 I422ToUYVYRow(src_y + src_stride_y, src_u, src_v,
352 dst_uyvy + dst_stride_uyvy, width); 376 dst_uyvy + dst_stride_uyvy, width);
353 src_y += src_stride_y * 2; 377 src_y += src_stride_y * 2;
354 src_u += src_stride_u; 378 src_u += src_stride_u;
355 src_v += src_stride_v; 379 src_v += src_stride_v;
356 dst_uyvy += dst_stride_uyvy * 2; 380 dst_uyvy += dst_stride_uyvy * 2;
357 } 381 }
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 default: 1131 default:
1108 return -1; // unknown fourcc - return failure code. 1132 return -1; // unknown fourcc - return failure code.
1109 } 1133 }
1110 return r; 1134 return r;
1111 } 1135 }
1112 1136
1113 #ifdef __cplusplus 1137 #ifdef __cplusplus
1114 } // extern "C" 1138 } // extern "C"
1115 } // namespace libyuv 1139 } // namespace libyuv
1116 #endif 1140 #endif
OLDNEW
« no previous file with comments | « include/libyuv/row.h ('k') | source/convert_from_argb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698