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

Unified Diff: source/convert_argb.cc

Issue 1414133006: implement I444ToABGR by swapping uv and transpose matrix (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: remove I444ToABGRRow functions Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | source/row_any.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 7c3ed5024391b2a5ca474b5436829081f4fa2b8d..ca35092238e3252490c39b711823659a2b8cf698 100644
--- a/source/convert_argb.cc
+++ b/source/convert_argb.cc
@@ -129,7 +129,6 @@ int I444ToARGB(const uint8* src_y, int src_stride_y,
width, height);
}
-
// Convert J444 to ARGB.
LIBYUV_API
int J444ToARGB(const uint8* src_y, int src_stride_y,
@@ -145,7 +144,6 @@ int J444ToARGB(const uint8* src_y, int src_stride_y,
width, height);
}
-
// Convert I444 to ABGR.
LIBYUV_API
int I444ToABGR(const uint8* src_y, int src_stride_y,
@@ -153,66 +151,12 @@ int I444ToABGR(const uint8* src_y, int src_stride_y,
const uint8* src_v, int src_stride_v,
uint8* dst_abgr, int dst_stride_abgr,
int width, int height) {
- int y;
- void (*I444ToABGRRow)(const uint8* y_buf,
- const uint8* u_buf,
- const uint8* v_buf,
- uint8* rgb_buf,
- const struct YuvConstants* yuvconstants,
- int width) = I444ToABGRRow_C;
- if (!src_y || !src_u || !src_v ||
- !dst_abgr ||
- width <= 0 || height == 0) {
- return -1;
- }
- // Negative height means invert the image.
- if (height < 0) {
- height = -height;
- dst_abgr = dst_abgr + (height - 1) * dst_stride_abgr;
- dst_stride_abgr = -dst_stride_abgr;
- }
- // Coalesce rows.
- if (src_stride_y == width &&
- src_stride_u == width &&
- src_stride_v == width &&
- dst_stride_abgr == width * 4) {
- width *= height;
- height = 1;
- src_stride_y = src_stride_u = src_stride_v = dst_stride_abgr = 0;
- }
-#if defined(HAS_I444TOABGRROW_SSSE3)
- if (TestCpuFlag(kCpuHasSSSE3)) {
- I444ToABGRRow = I444ToABGRRow_Any_SSSE3;
- if (IS_ALIGNED(width, 8)) {
- I444ToABGRRow = I444ToABGRRow_SSSE3;
- }
- }
-#endif
-#if defined(HAS_I444TOABGRROW_AVX2)
- if (TestCpuFlag(kCpuHasAVX2)) {
- I444ToABGRRow = I444ToABGRRow_Any_AVX2;
- if (IS_ALIGNED(width, 16)) {
- I444ToABGRRow = I444ToABGRRow_AVX2;
- }
- }
-#endif
-#if defined(HAS_I444TOABGRROW_NEON)
- if (TestCpuFlag(kCpuHasNEON)) {
- I444ToABGRRow = I444ToABGRRow_Any_NEON;
- if (IS_ALIGNED(width, 8)) {
- I444ToABGRRow = I444ToABGRRow_NEON;
- }
- }
-#endif
-
- for (y = 0; y < height; ++y) {
- I444ToABGRRow(src_y, src_u, src_v, dst_abgr, &kYuvIConstants, width);
- dst_abgr += dst_stride_abgr;
- src_y += src_stride_y;
- src_u += src_stride_u;
- src_v += src_stride_v;
- }
- return 0;
+ return I444ToARGBMatrix(src_y, src_stride_y,
+ src_v, src_stride_v,
+ src_u, src_stride_u,
+ dst_abgr, dst_stride_abgr,
+ &kYvuIConstants,
+ width, height);
}
// Convert I422 to ARGB.
« no previous file with comments | « include/libyuv/version.h ('k') | source/row_any.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698