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

Unified Diff: source/convert_argb.cc

Issue 2626123003: Libyuv MIPS DSPR2 optimizations. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/convert.cc ('k') | source/convert_from.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/convert_argb.cc
diff --git a/source/convert_argb.cc b/source/convert_argb.cc
index db3b5d32bf699ec31c4f2f97c9f96da51772111b..fecd21ff3d984caeac8a4957cf18baabf1c473b2 100644
--- a/source/convert_argb.cc
+++ b/source/convert_argb.cc
@@ -485,6 +485,14 @@ static int I444ToARGBMatrix(const uint8* src_y,
}
}
#endif
+#if defined(HAS_I444TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ I444ToARGBRow = I444ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 8)) {
+ I444ToARGBRow = I444ToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height; ++y) {
I444ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width);
@@ -946,6 +954,14 @@ int RGB24ToARGB(const uint8* src_rgb24,
}
}
#endif
+#if defined(HAS_RGB24TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ RGB24ToARGBRow = RGB24ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 8)) {
+ RGB24ToARGBRow = RGB24ToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height; ++y) {
RGB24ToARGBRow(src_rgb24, dst_argb, width);
@@ -997,6 +1013,14 @@ int RAWToARGB(const uint8* src_raw,
}
}
#endif
+#if defined(HAS_RAWTOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ RAWToARGBRow = RAWToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 8)) {
+ RAWToARGBRow = RAWToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height; ++y) {
RAWToARGBRow(src_raw, dst_argb, width);
@@ -1056,6 +1080,14 @@ int RGB565ToARGB(const uint8* src_rgb565,
}
}
#endif
+#if defined(HAS_RGB565TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ RGB565ToARGBRow = RGB565ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 8)) {
+ RGB565ToARGBRow = RGB565ToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height; ++y) {
RGB565ToARGBRow(src_rgb565, dst_argb, width);
@@ -1115,6 +1147,14 @@ int ARGB1555ToARGB(const uint8* src_argb1555,
}
}
#endif
+#if defined(HAS_ARGB1555TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 4)) {
+ ARGB1555ToARGBRow = ARGB1555ToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height; ++y) {
ARGB1555ToARGBRow(src_argb1555, dst_argb, width);
@@ -1174,6 +1214,14 @@ int ARGB4444ToARGB(const uint8* src_argb4444,
}
}
#endif
+#if defined(HAS_ARGB4444TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 4)) {
+ ARGB4444ToARGBRow = ARGB4444ToARGBRow_DSPR2;
+ }
+ }
+#endif
#if defined(HAS_ARGB4444TOARGBROW_MSA)
if (TestCpuFlag(kCpuHasMSA)) {
ARGB4444ToARGBRow = ARGB4444ToARGBRow_Any_MSA;
@@ -1238,6 +1286,14 @@ int NV12ToARGB(const uint8* src_y,
}
}
#endif
+#if defined(HAS_NV12TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 8)) {
+ NV12ToARGBRow = NV12ToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height; ++y) {
NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width);
@@ -1354,6 +1410,14 @@ int M420ToARGB(const uint8* src_m420,
}
}
#endif
+#if defined(HAS_NV12TOARGBROW_DSPR2)
+ if (TestCpuFlag(kCpuHasDSPR2)) {
+ NV12ToARGBRow = NV12ToARGBRow_Any_DSPR2;
+ if (IS_ALIGNED(width, 8)) {
+ NV12ToARGBRow = NV12ToARGBRow_DSPR2;
+ }
+ }
+#endif
for (y = 0; y < height - 1; y += 2) {
NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb,
« no previous file with comments | « source/convert.cc ('k') | source/convert_from.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698