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

Side by Side Diff: source/convert_argb.cc

Issue 1387313002: Add J444ToARGB conversion function. (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | unit_test/convert_test.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 28 matching lines...) Expand all
39 src_stride_argb = -src_stride_argb; 39 src_stride_argb = -src_stride_argb;
40 } 40 }
41 41
42 CopyPlane(src_argb, src_stride_argb, dst_argb, dst_stride_argb, 42 CopyPlane(src_argb, src_stride_argb, dst_argb, dst_stride_argb,
43 width * 4, height); 43 width * 4, height);
44 return 0; 44 return 0;
45 } 45 }
46 46
47 // Convert I444 to ARGB. 47 // Convert I444 to ARGB.
48 LIBYUV_API 48 LIBYUV_API
49 int I444ToARGB(const uint8* src_y, int src_stride_y, 49 static int I444ToARGBMatrix(const uint8* src_y, int src_stride_y,
50 const uint8* src_u, int src_stride_u, 50 const uint8* src_u, int src_stride_u,
51 const uint8* src_v, int src_stride_v, 51 const uint8* src_v, int src_stride_v,
52 uint8* dst_argb, int dst_stride_argb, 52 uint8* dst_argb, int dst_stride_argb,
53 int width, int height) { 53 struct YuvConstants* yuvconstants,
54 int width, int height) {
54 int y; 55 int y;
55 void (*I444ToARGBRow)(const uint8* y_buf, 56 void (*I444ToARGBRow)(const uint8* y_buf,
56 const uint8* u_buf, 57 const uint8* u_buf,
57 const uint8* v_buf, 58 const uint8* v_buf,
58 uint8* rgb_buf, 59 uint8* rgb_buf,
59 struct YuvConstants* yuvconstants, 60 struct YuvConstants* yuvconstants,
60 int width) = I444ToARGBRow_C; 61 int width) = I444ToARGBRow_C;
61 if (!src_y || !src_u || !src_v || 62 if (!src_y || !src_u || !src_v ||
62 !dst_argb || 63 !dst_argb ||
63 width <= 0 || height == 0) { 64 width <= 0 || height == 0) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #if defined(HAS_I444TOARGBROW_NEON) 98 #if defined(HAS_I444TOARGBROW_NEON)
98 if (TestCpuFlag(kCpuHasNEON)) { 99 if (TestCpuFlag(kCpuHasNEON)) {
99 I444ToARGBRow = I444ToARGBRow_Any_NEON; 100 I444ToARGBRow = I444ToARGBRow_Any_NEON;
100 if (IS_ALIGNED(width, 8)) { 101 if (IS_ALIGNED(width, 8)) {
101 I444ToARGBRow = I444ToARGBRow_NEON; 102 I444ToARGBRow = I444ToARGBRow_NEON;
102 } 103 }
103 } 104 }
104 #endif 105 #endif
105 106
106 for (y = 0; y < height; ++y) { 107 for (y = 0; y < height; ++y) {
107 I444ToARGBRow(src_y, src_u, src_v, dst_argb, &kYuvConstants, width); 108 I444ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width);
108 dst_argb += dst_stride_argb; 109 dst_argb += dst_stride_argb;
109 src_y += src_stride_y; 110 src_y += src_stride_y;
110 src_u += src_stride_u; 111 src_u += src_stride_u;
111 src_v += src_stride_v; 112 src_v += src_stride_v;
112 } 113 }
113 return 0; 114 return 0;
114 } 115 }
115 116
117 // Convert I444 to ARGB.
118 LIBYUV_API
119 int I444ToARGB(const uint8* src_y, int src_stride_y,
120 const uint8* src_u, int src_stride_u,
121 const uint8* src_v, int src_stride_v,
122 uint8* dst_argb, int dst_stride_argb,
123 int width, int height) {
124 return I444ToARGBMatrix(src_y, src_stride_y,
125 src_u, src_stride_u,
126 src_v, src_stride_v,
127 dst_argb, dst_stride_argb,
128 &kYuvConstants,
129 width, height);
130 }
131
132
133 // Convert J444 to ARGB.
134 LIBYUV_API
135 int J444ToARGB(const uint8* src_y, int src_stride_y,
136 const uint8* src_u, int src_stride_u,
137 const uint8* src_v, int src_stride_v,
138 uint8* dst_argb, int dst_stride_argb,
139 int width, int height) {
140 return I444ToARGBMatrix(src_y, src_stride_y,
141 src_u, src_stride_u,
142 src_v, src_stride_v,
143 dst_argb, dst_stride_argb,
144 &kYuvJConstants,
145 width, height);
146 }
147
148
116 // Convert I444 to ABGR. 149 // Convert I444 to ABGR.
117 LIBYUV_API 150 LIBYUV_API
118 int I444ToABGR(const uint8* src_y, int src_stride_y, 151 int I444ToABGR(const uint8* src_y, int src_stride_y,
119 const uint8* src_u, int src_stride_u, 152 const uint8* src_u, int src_stride_u,
120 const uint8* src_v, int src_stride_v, 153 const uint8* src_v, int src_stride_v,
121 uint8* dst_abgr, int dst_stride_abgr, 154 uint8* dst_abgr, int dst_stride_abgr,
122 int width, int height) { 155 int width, int height) {
123 int y; 156 int y;
124 void (*I444ToABGRRow)(const uint8* y_buf, 157 void (*I444ToABGRRow)(const uint8* y_buf,
125 const uint8* u_buf, 158 const uint8* u_buf,
(...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 src_u += src_stride_u; 1914 src_u += src_stride_u;
1882 src_v += src_stride_v; 1915 src_v += src_stride_v;
1883 } 1916 }
1884 return 0; 1917 return 0;
1885 } 1918 }
1886 1919
1887 #ifdef __cplusplus 1920 #ifdef __cplusplus
1888 } // extern "C" 1921 } // extern "C"
1889 } // namespace libyuv 1922 } // namespace libyuv
1890 #endif 1923 #endif
OLDNEW
« no previous file with comments | « include/libyuv/version.h ('k') | unit_test/convert_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698