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

Side by Side Diff: source/convert_argb.cc

Issue 2636483002: Add MSA optimized NV12/21 To RGB row functions (Closed)
Patch Set: Incorporated review comments Created 3 years, 11 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/planar_functions.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 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 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 } 1319 }
1320 #endif 1320 #endif
1321 #if defined(HAS_NV12TOARGBROW_DSPR2) 1321 #if defined(HAS_NV12TOARGBROW_DSPR2)
1322 if (TestCpuFlag(kCpuHasDSPR2)) { 1322 if (TestCpuFlag(kCpuHasDSPR2)) {
1323 NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2; 1323 NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2;
1324 if (IS_ALIGNED(width, 8)) { 1324 if (IS_ALIGNED(width, 8)) {
1325 NV12ToARGBRow = NV12ToARGBRow_DSPR2; 1325 NV12ToARGBRow = NV12ToARGBRow_DSPR2;
1326 } 1326 }
1327 } 1327 }
1328 #endif 1328 #endif
1329 #if defined(HAS_NV12TOARGBROW_MSA)
1330 if (TestCpuFlag(kCpuHasMSA)) {
1331 NV12ToARGBRow = NV12ToARGBRow_Any_MSA;
1332 if (IS_ALIGNED(width, 8)) {
1333 NV12ToARGBRow = NV12ToARGBRow_MSA;
1334 }
1335 }
1336 #endif
1329 1337
1330 for (y = 0; y < height; ++y) { 1338 for (y = 0; y < height; ++y) {
1331 NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width); 1339 NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width);
1332 dst_argb += dst_stride_argb; 1340 dst_argb += dst_stride_argb;
1333 src_y += src_stride_y; 1341 src_y += src_stride_y;
1334 if (y & 1) { 1342 if (y & 1) {
1335 src_uv += src_stride_uv; 1343 src_uv += src_stride_uv;
1336 } 1344 }
1337 } 1345 }
1338 return 0; 1346 return 0;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 } 1386 }
1379 #endif 1387 #endif
1380 #if defined(HAS_NV21TOARGBROW_NEON) 1388 #if defined(HAS_NV21TOARGBROW_NEON)
1381 if (TestCpuFlag(kCpuHasNEON)) { 1389 if (TestCpuFlag(kCpuHasNEON)) {
1382 NV21ToARGBRow = NV21ToARGBRow_Any_NEON; 1390 NV21ToARGBRow = NV21ToARGBRow_Any_NEON;
1383 if (IS_ALIGNED(width, 8)) { 1391 if (IS_ALIGNED(width, 8)) {
1384 NV21ToARGBRow = NV21ToARGBRow_NEON; 1392 NV21ToARGBRow = NV21ToARGBRow_NEON;
1385 } 1393 }
1386 } 1394 }
1387 #endif 1395 #endif
1396 #if defined(HAS_NV21TOARGBROW_MSA)
1397 if (TestCpuFlag(kCpuHasMSA)) {
1398 NV21ToARGBRow = NV21ToARGBRow_Any_MSA;
1399 if (IS_ALIGNED(width, 8)) {
1400 NV21ToARGBRow = NV21ToARGBRow_MSA;
1401 }
1402 }
1403 #endif
1388 1404
1389 for (y = 0; y < height; ++y) { 1405 for (y = 0; y < height; ++y) {
1390 NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width); 1406 NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width);
1391 dst_argb += dst_stride_argb; 1407 dst_argb += dst_stride_argb;
1392 src_y += src_stride_y; 1408 src_y += src_stride_y;
1393 if (y & 1) { 1409 if (y & 1) {
1394 src_uv += src_stride_uv; 1410 src_uv += src_stride_uv;
1395 } 1411 }
1396 } 1412 }
1397 return 0; 1413 return 0;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 } 1459 }
1444 #endif 1460 #endif
1445 #if defined(HAS_NV12TOARGBROW_DSPR2) 1461 #if defined(HAS_NV12TOARGBROW_DSPR2)
1446 if (TestCpuFlag(kCpuHasDSPR2)) { 1462 if (TestCpuFlag(kCpuHasDSPR2)) {
1447 NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2; 1463 NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2;
1448 if (IS_ALIGNED(width, 8)) { 1464 if (IS_ALIGNED(width, 8)) {
1449 NV12ToARGBRow = NV12ToARGBRow_DSPR2; 1465 NV12ToARGBRow = NV12ToARGBRow_DSPR2;
1450 } 1466 }
1451 } 1467 }
1452 #endif 1468 #endif
1469 #if defined(HAS_NV12TOARGBROW_MSA)
1470 if (TestCpuFlag(kCpuHasMSA)) {
1471 NV12ToARGBRow = NV12ToARGBRow_Any_MSA;
1472 if (IS_ALIGNED(width, 8)) {
1473 NV12ToARGBRow = NV12ToARGBRow_MSA;
1474 }
1475 }
1476 #endif
1453 1477
1454 for (y = 0; y < height - 1; y += 2) { 1478 for (y = 0; y < height - 1; y += 2) {
1455 NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, 1479 NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb,
1456 &kYuvI601Constants, width); 1480 &kYuvI601Constants, width);
1457 NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2, 1481 NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2,
1458 dst_argb + dst_stride_argb, &kYuvI601Constants, width); 1482 dst_argb + dst_stride_argb, &kYuvI601Constants, width);
1459 dst_argb += dst_stride_argb * 2; 1483 dst_argb += dst_stride_argb * 2;
1460 src_m420 += src_stride_m420 * 3; 1484 src_m420 += src_stride_m420 * 3;
1461 } 1485 }
1462 if (height & 1) { 1486 if (height & 1) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 src_uyvy += src_stride_uyvy; 1605 src_uyvy += src_stride_uyvy;
1582 dst_argb += dst_stride_argb; 1606 dst_argb += dst_stride_argb;
1583 } 1607 }
1584 return 0; 1608 return 0;
1585 } 1609 }
1586 1610
1587 #ifdef __cplusplus 1611 #ifdef __cplusplus
1588 } // extern "C" 1612 } // extern "C"
1589 } // namespace libyuv 1613 } // namespace libyuv
1590 #endif 1614 #endif
OLDNEW
« no previous file with comments | « include/libyuv/row.h ('k') | source/planar_functions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698