| OLD | NEW |
| 1 // VERSION 2 | 1 // VERSION 2 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license | 5 * Use of this source code is governed by a BSD-style license |
| 6 * that can be found in the LICENSE file in the root of the source | 6 * that can be found in the LICENSE file in the root of the source |
| 7 * tree. An additional intellectual property rights grant can be found | 7 * tree. An additional intellectual property rights grant can be found |
| 8 * in the file PATENTS. All contributing project authors may | 8 * in the file PATENTS. All contributing project authors may |
| 9 * be found in the AUTHORS file in the root of the source tree. | 9 * be found in the AUTHORS file in the root of the source tree. |
| 10 */ | 10 */ |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 "+rm"(width) // %3 | 1137 "+rm"(width) // %3 |
| 1138 : "m"(kARGBToV), // %4 | 1138 : "m"(kARGBToV), // %4 |
| 1139 "m"(kARGBToU), // %5 | 1139 "m"(kARGBToU), // %5 |
| 1140 "m"(kAddUV128) // %6 | 1140 "m"(kAddUV128) // %6 |
| 1141 : "memory", "cc", NACL_R14 | 1141 : "memory", "cc", NACL_R14 |
| 1142 "xmm0", "xmm1", "xmm2", "xmm6" | 1142 "xmm0", "xmm1", "xmm2", "xmm6" |
| 1143 ); | 1143 ); |
| 1144 } | 1144 } |
| 1145 #endif // HAS_ARGBTOUV444ROW_SSSE3 | 1145 #endif // HAS_ARGBTOUV444ROW_SSSE3 |
| 1146 | 1146 |
| 1147 #ifdef HAS_ARGBTOUV422ROW_SSSE3 | |
| 1148 void ARGBToUV422Row_SSSE3(const uint8* src_argb0, | |
| 1149 uint8* dst_u, uint8* dst_v, int width) { | |
| 1150 asm volatile ( | |
| 1151 "movdqa %4,%%xmm3 \n" | |
| 1152 "movdqa %5,%%xmm4 \n" | |
| 1153 "movdqa %6,%%xmm5 \n" | |
| 1154 "sub %1,%2 \n" | |
| 1155 LABELALIGN | |
| 1156 "1: \n" | |
| 1157 "movdqu " MEMACCESS(0) ",%%xmm0 \n" | |
| 1158 "movdqu " MEMACCESS2(0x10,0) ",%%xmm1 \n" | |
| 1159 "movdqu " MEMACCESS2(0x20,0) ",%%xmm2 \n" | |
| 1160 "movdqu " MEMACCESS2(0x30,0) ",%%xmm6 \n" | |
| 1161 "lea " MEMLEA(0x40,0) ",%0 \n" | |
| 1162 "movdqa %%xmm0,%%xmm7 \n" | |
| 1163 "shufps $0x88,%%xmm1,%%xmm0 \n" | |
| 1164 "shufps $0xdd,%%xmm1,%%xmm7 \n" | |
| 1165 "pavgb %%xmm7,%%xmm0 \n" | |
| 1166 "movdqa %%xmm2,%%xmm7 \n" | |
| 1167 "shufps $0x88,%%xmm6,%%xmm2 \n" | |
| 1168 "shufps $0xdd,%%xmm6,%%xmm7 \n" | |
| 1169 "pavgb %%xmm7,%%xmm2 \n" | |
| 1170 "movdqa %%xmm0,%%xmm1 \n" | |
| 1171 "movdqa %%xmm2,%%xmm6 \n" | |
| 1172 "pmaddubsw %%xmm4,%%xmm0 \n" | |
| 1173 "pmaddubsw %%xmm4,%%xmm2 \n" | |
| 1174 "pmaddubsw %%xmm3,%%xmm1 \n" | |
| 1175 "pmaddubsw %%xmm3,%%xmm6 \n" | |
| 1176 "phaddw %%xmm2,%%xmm0 \n" | |
| 1177 "phaddw %%xmm6,%%xmm1 \n" | |
| 1178 "psraw $0x8,%%xmm0 \n" | |
| 1179 "psraw $0x8,%%xmm1 \n" | |
| 1180 "packsswb %%xmm1,%%xmm0 \n" | |
| 1181 "paddb %%xmm5,%%xmm0 \n" | |
| 1182 "movlps %%xmm0," MEMACCESS(1) " \n" | |
| 1183 MEMOPMEM(movhps,xmm0,0x00,1,2,1) // movhps %%xmm0,(%1,%2,1) | |
| 1184 "lea " MEMLEA(0x8,1) ",%1 \n" | |
| 1185 "sub $0x10,%3 \n" | |
| 1186 "jg 1b \n" | |
| 1187 : "+r"(src_argb0), // %0 | |
| 1188 "+r"(dst_u), // %1 | |
| 1189 "+r"(dst_v), // %2 | |
| 1190 "+rm"(width) // %3 | |
| 1191 : "m"(kARGBToV), // %4 | |
| 1192 "m"(kARGBToU), // %5 | |
| 1193 "m"(kAddUV128) // %6 | |
| 1194 : "memory", "cc", NACL_R14 | |
| 1195 "xmm0", "xmm1", "xmm2", "xmm6", "xmm7" | |
| 1196 ); | |
| 1197 } | |
| 1198 #endif // HAS_ARGBTOUV422ROW_SSSE3 | |
| 1199 | |
| 1200 void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int width) { | 1147 void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int width) { |
| 1201 asm volatile ( | 1148 asm volatile ( |
| 1202 "movdqa %4,%%xmm5 \n" | 1149 "movdqa %4,%%xmm5 \n" |
| 1203 "movdqa %3,%%xmm4 \n" | 1150 "movdqa %3,%%xmm4 \n" |
| 1204 LABELALIGN | 1151 LABELALIGN |
| 1205 "1: \n" | 1152 "1: \n" |
| 1206 "movdqu " MEMACCESS(0) ",%%xmm0 \n" | 1153 "movdqu " MEMACCESS(0) ",%%xmm0 \n" |
| 1207 "movdqu " MEMACCESS2(0x10,0) ",%%xmm1 \n" | 1154 "movdqu " MEMACCESS2(0x10,0) ",%%xmm1 \n" |
| 1208 "movdqu " MEMACCESS2(0x20,0) ",%%xmm2 \n" | 1155 "movdqu " MEMACCESS2(0x20,0) ",%%xmm2 \n" |
| 1209 "movdqu " MEMACCESS2(0x30,0) ",%%xmm3 \n" | 1156 "movdqu " MEMACCESS2(0x30,0) ",%%xmm3 \n" |
| (...skipping 4233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5443 ); | 5390 ); |
| 5444 } | 5391 } |
| 5445 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 | 5392 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 |
| 5446 | 5393 |
| 5447 #endif // defined(__x86_64__) || defined(__i386__) | 5394 #endif // defined(__x86_64__) || defined(__i386__) |
| 5448 | 5395 |
| 5449 #ifdef __cplusplus | 5396 #ifdef __cplusplus |
| 5450 } // extern "C" | 5397 } // extern "C" |
| 5451 } // namespace libyuv | 5398 } // namespace libyuv |
| 5452 #endif | 5399 #endif |
| OLD | NEW |