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

Side by Side Diff: source/row_gcc.cc

Issue 2371293002: Add low level support for 12 bit 420, 422 and 444 YUV video frame conversion. (Closed)
Patch Set: win use avx2 version of functions Created 4 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
OLDNEW
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 5348 matching lines...) Expand 10 before | Expand all | Expand 10 after
5359 : "+r"(src_argb), // %0 5359 : "+r"(src_argb), // %0
5360 "+r"(dst_argb), // %1 5360 "+r"(dst_argb), // %1
5361 "+r"(width) // %2 5361 "+r"(width) // %2
5362 : "r"(poly) // %3 5362 : "r"(poly) // %3
5363 : "memory", "cc", 5363 : "memory", "cc",
5364 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" 5364 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
5365 ); 5365 );
5366 } 5366 }
5367 #endif // HAS_ARGBPOLYNOMIALROW_AVX2 5367 #endif // HAS_ARGBPOLYNOMIALROW_AVX2
5368 5368
5369 #ifdef HAS_HALFFLOATROW_AVX2
5370 void HalfFloatRow_AVX2(const uint16* src, int16* dst, float scale, int width) {
5371 asm volatile (
5372 "vbroadcastss %3, %%ymm4 \n"
5373
5374 // 8 pixel loop.
5375 LABELALIGN
5376 "1: \n"
5377 "vpmovzxwd " MEMACCESS(0) ",%%ymm0 \n" // 8 shorts -> 8 ints
5378 "lea " MEMLEA(0x10,0) ",%0 \n"
5379 "vcvtdq2ps %%ymm0,%%ymm0 \n"
5380 "vmulps %%ymm0,%%ymm4,%%ymm0 \n"
5381 "vcvtps2ph $3, %%ymm0, %%xmm0 \n"
5382 "vmovdqu %%xmm0," MEMACCESS(1) " \n"
5383 "lea " MEMLEA(0x10,1) ",%1 \n"
5384 "sub $0x8,%2 \n"
5385 "jg 1b \n"
5386 "vzeroupper \n"
5387 : "+r"(src), // %0
5388 "+r"(dst), // %1
5389 "+r"(width) // %2
5390 : "x"(scale) // %3
5391 : "memory", "cc",
5392 "xmm0", "xmm4"
5393 );
5394 }
5395 #endif // HAS_HALFFLOATROW_AVX2
5396
5369 #ifdef HAS_ARGBCOLORTABLEROW_X86 5397 #ifdef HAS_ARGBCOLORTABLEROW_X86
5370 // Tranform ARGB pixels with color table. 5398 // Tranform ARGB pixels with color table.
5371 void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, 5399 void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb,
5372 int width) { 5400 int width) {
5373 uintptr_t pixel_temp; 5401 uintptr_t pixel_temp;
5374 asm volatile ( 5402 asm volatile (
5375 // 1 pixel loop. 5403 // 1 pixel loop.
5376 LABELALIGN 5404 LABELALIGN
5377 "1: \n" 5405 "1: \n"
5378 "movzb " MEMACCESS(0) ",%1 \n" 5406 "movzb " MEMACCESS(0) ",%1 \n"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
5525 ); 5553 );
5526 } 5554 }
5527 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 5555 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3
5528 5556
5529 #endif // defined(__x86_64__) || defined(__i386__) 5557 #endif // defined(__x86_64__) || defined(__i386__)
5530 5558
5531 #ifdef __cplusplus 5559 #ifdef __cplusplus
5532 } // extern "C" 5560 } // extern "C"
5533 } // namespace libyuv 5561 } // namespace libyuv
5534 #endif 5562 #endif
OLDNEW
« source/row_common.cc ('K') | « source/row_common.cc ('k') | source/row_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698