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

Side by Side Diff: source/row_common.cc

Issue 1355733002: scale test (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: move abgr support to its own 32 bit intel specific ifdefs Created 5 years, 3 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 | « source/row_any.cc ('k') | source/row_win.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 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 src_y += 2; 1142 src_y += 2;
1143 src_u += 2; 1143 src_u += 2;
1144 src_v += 2; 1144 src_v += 2;
1145 rgb_buf += 8; // Advance 2 pixels. 1145 rgb_buf += 8; // Advance 2 pixels.
1146 } 1146 }
1147 if (width & 1) { 1147 if (width & 1) {
1148 YuvPixel(src_y[0], src_u[0], src_v[0], 1148 YuvPixel(src_y[0], src_u[0], src_v[0],
1149 rgb_buf + 0, rgb_buf + 1, rgb_buf + 2); 1149 rgb_buf + 0, rgb_buf + 1, rgb_buf + 2);
1150 } 1150 }
1151 } 1151 }
1152
1153 void I444ToABGRRow_C(const uint8* src_y,
1154 const uint8* src_u,
1155 const uint8* src_v,
1156 uint8* rgb_buf,
1157 int width) {
1158 int x;
1159 for (x = 0; x < width - 1; x += 2) {
1160 uint8 u = (src_u[0] + src_u[1] + 1) >> 1;
1161 uint8 v = (src_v[0] + src_v[1] + 1) >> 1;
1162 YuvPixel(src_y[0], u, v, rgb_buf + 2, rgb_buf + 1, rgb_buf + 0);
1163 rgb_buf[3] = 255;
1164 YuvPixel(src_y[1], u, v, rgb_buf + 6, rgb_buf + 5, rgb_buf + 4);
1165 rgb_buf[7] = 255;
1166 src_y += 2;
1167 src_u += 2;
1168 src_v += 2;
1169 rgb_buf += 8; // Advance 2 pixels.
1170 }
1171 if (width & 1) {
1172 YuvPixel(src_y[0], src_u[0], src_v[0],
1173 rgb_buf + 2, rgb_buf + 1, rgb_buf + 0);
1174 }
1175 }
1152 #else 1176 #else
1153 void I444ToARGBRow_C(const uint8* src_y, 1177 void I444ToARGBRow_C(const uint8* src_y,
1154 const uint8* src_u, 1178 const uint8* src_u,
1155 const uint8* src_v, 1179 const uint8* src_v,
1156 uint8* rgb_buf, 1180 uint8* rgb_buf,
1157 int width) { 1181 int width) {
1158 int x; 1182 int x;
1159 for (x = 0; x < width; ++x) { 1183 for (x = 0; x < width; ++x) {
1160 YuvPixel(src_y[0], src_u[0], src_v[0], 1184 YuvPixel(src_y[0], src_u[0], src_v[0],
1161 rgb_buf + 0, rgb_buf + 1, rgb_buf + 2); 1185 rgb_buf + 0, rgb_buf + 1, rgb_buf + 2);
1162 rgb_buf[3] = 255; 1186 rgb_buf[3] = 255;
1163 src_y += 1; 1187 src_y += 1;
1164 src_u += 1; 1188 src_u += 1;
1165 src_v += 1; 1189 src_v += 1;
1166 rgb_buf += 4; // Advance 1 pixel. 1190 rgb_buf += 4; // Advance 1 pixel.
1167 } 1191 }
1168 } 1192 }
1193
1194 void I444ToABGRRow_C(const uint8* src_y,
1195 const uint8* src_u,
1196 const uint8* src_v,
1197 uint8* rgb_buf,
1198 int width) {
1199 int x;
1200 for (x = 0; x < width; ++x) {
1201 YuvPixel(src_y[0], src_u[0], src_v[0],
1202 rgb_buf + 2, rgb_buf + 1, rgb_buf + 0);
1203 rgb_buf[3] = 255;
1204 src_y += 1;
1205 src_u += 1;
1206 src_v += 1;
1207 rgb_buf += 4; // Advance 1 pixel.
1208 }
1209 }
1169 #endif 1210 #endif
1170 1211
1171 // Also used for 420 1212 // Also used for 420
1172 void I422ToARGBRow_C(const uint8* src_y, 1213 void I422ToARGBRow_C(const uint8* src_y,
1173 const uint8* src_u, 1214 const uint8* src_u,
1174 const uint8* src_v, 1215 const uint8* src_v,
1175 uint8* rgb_buf, 1216 uint8* rgb_buf,
1176 int width) { 1217 int width) {
1177 int x; 1218 int x;
1178 for (x = 0; x < width - 1; x += 2) { 1219 for (x = 0; x < width - 1; x += 2) {
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 #ifdef HAS_I422TOABGRMATRIXROW_SSSE3 2353 #ifdef HAS_I422TOABGRMATRIXROW_SSSE3
2313 ANYYUV(I422ToABGRRow_SSSE3, I422ToABGRMatrixRow_SSSE3, kYuvConstants) 2354 ANYYUV(I422ToABGRRow_SSSE3, I422ToABGRMatrixRow_SSSE3, kYuvConstants)
2314 ANYYUV(J422ToABGRRow_SSSE3, I422ToABGRMatrixRow_SSSE3, kYuvJConstants) 2355 ANYYUV(J422ToABGRRow_SSSE3, I422ToABGRMatrixRow_SSSE3, kYuvJConstants)
2315 ANYYUV(H422ToABGRRow_SSSE3, I422ToABGRMatrixRow_SSSE3, kYuvHConstants) 2356 ANYYUV(H422ToABGRRow_SSSE3, I422ToABGRMatrixRow_SSSE3, kYuvHConstants)
2316 #endif 2357 #endif
2317 #ifdef HAS_I422TOABGRMATRIXROW_AVX2 2358 #ifdef HAS_I422TOABGRMATRIXROW_AVX2
2318 ANYYUV(I422ToABGRRow_AVX2, I422ToABGRMatrixRow_AVX2, kYuvConstants) 2359 ANYYUV(I422ToABGRRow_AVX2, I422ToABGRMatrixRow_AVX2, kYuvConstants)
2319 ANYYUV(J422ToABGRRow_AVX2, I422ToABGRMatrixRow_AVX2, kYuvJConstants) 2360 ANYYUV(J422ToABGRRow_AVX2, I422ToABGRMatrixRow_AVX2, kYuvJConstants)
2320 ANYYUV(H422ToABGRRow_AVX2, I422ToABGRMatrixRow_AVX2, kYuvHConstants) 2361 ANYYUV(H422ToABGRRow_AVX2, I422ToABGRMatrixRow_AVX2, kYuvHConstants)
2321 #endif 2362 #endif
2363 // TODO(fbarchard): Neon, J444, H444 versions.
2364 #ifdef HAS_I444TOARGBMATRIXROW_SSSE3
2365 ANYYUV(I444ToARGBRow_SSSE3, I444ToARGBMatrixRow_SSSE3, kYuvConstants)
2366 #endif
2367 #ifdef HAS_I444TOARGBMATRIXROW_AVX2
2368 ANYYUV(I444ToARGBRow_AVX2, I444ToARGBMatrixRow_AVX2, kYuvConstants)
2369 #endif
2370 #ifdef HAS_I444TOABGRMATRIXROW_SSSE3
2371 ANYYUV(I444ToABGRRow_SSSE3, I444ToABGRMatrixRow_SSSE3, kYuvConstants)
2372 #endif
2373 #ifdef HAS_I444TOABGRMATRIXROW_AVX2
2374 ANYYUV(I444ToABGRRow_AVX2, I444ToABGRMatrixRow_AVX2, kYuvConstants)
2375 #endif
2322 2376
2323 // Maximum temporary width for wrappers to process at a time, in pixels. 2377 // Maximum temporary width for wrappers to process at a time, in pixels.
2324 #define MAXTWIDTH 2048 2378 #define MAXTWIDTH 2048
2325 2379
2326 #if !(defined(_MSC_VER) && defined(_M_IX86)) && \ 2380 #if !(defined(_MSC_VER) && defined(_M_IX86)) && \
2327 defined(HAS_I422TORGB565ROW_SSSE3) 2381 defined(HAS_I422TORGB565ROW_SSSE3)
2328 // row_win.cc has asm version, but GCC uses 2 step wrapper. 2382 // row_win.cc has asm version, but GCC uses 2 step wrapper.
2329 void I422ToRGB565Row_SSSE3(const uint8* src_y, 2383 void I422ToRGB565Row_SSSE3(const uint8* src_y,
2330 const uint8* src_u, 2384 const uint8* src_u,
2331 const uint8* src_v, 2385 const uint8* src_v,
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 } 2785 }
2732 if (width & 1) { 2786 if (width & 1) {
2733 dst[3] = src[0]; 2787 dst[3] = src[0];
2734 } 2788 }
2735 } 2789 }
2736 2790
2737 #ifdef __cplusplus 2791 #ifdef __cplusplus
2738 } // extern "C" 2792 } // extern "C"
2739 } // namespace libyuv 2793 } // namespace libyuv
2740 #endif 2794 #endif
OLDNEW
« no previous file with comments | « source/row_any.cc ('k') | source/row_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698