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

Unified 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: cast to uint16 Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/row_common.cc ('k') | source/row_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/row_gcc.cc
diff --git a/source/row_gcc.cc b/source/row_gcc.cc
index 1ac7ef1aa398b249491619563ac67cf57bc8472b..e4b4c5c1bf5bc77666b1c9e22a800aa847724c02 100644
--- a/source/row_gcc.cc
+++ b/source/row_gcc.cc
@@ -5366,6 +5366,39 @@ void ARGBPolynomialRow_AVX2(const uint8* src_argb,
}
#endif // HAS_ARGBPOLYNOMIALROW_AVX2
+#ifdef HAS_HALFFLOATROW_AVX2
+void HalfFloatRow_AVX2(const uint16* src, uint16* dst, float scale, int width) {
+ asm volatile (
+ "vbroadcastss %3, %%ymm4 \n"
+
+ // 16 pixel loop.
+ LABELALIGN
+ "1: \n"
+ "vpmovzxwd " MEMACCESS(0) ",%%ymm0 \n" // 8 shorts -> 8 ints
+ "vpmovzxwd " MEMACCESS2(0x10,0) ",%%ymm1 \n" // 8 more
+ "lea " MEMLEA(0x20,0) ",%0 \n"
+ "vcvtdq2ps %%ymm0,%%ymm0 \n"
+ "vcvtdq2ps %%ymm1,%%ymm1 \n"
+ "vmulps %%ymm0,%%ymm4,%%ymm0 \n"
+ "vmulps %%ymm1,%%ymm4,%%ymm1 \n"
+ "vcvtps2ph $3, %%ymm0, %%xmm0 \n"
+ "vcvtps2ph $3, %%ymm1, %%xmm1 \n"
+ "vmovdqu %%xmm0," MEMACCESS(1) " \n"
+ "vmovdqu %%xmm1," MEMACCESS2(0x10,1) " \n"
+ "lea " MEMLEA(0x20,1) ",%1 \n"
+ "sub $0x10,%2 \n"
+ "jg 1b \n"
+ "vzeroupper \n"
+ : "+r"(src), // %0
+ "+r"(dst), // %1
+ "+r"(width) // %2
+ : "x"(scale) // %3
+ : "memory", "cc",
+ "xmm0", "xmm4"
+ );
+}
+#endif // HAS_HALFFLOATROW_AVX2
+
#ifdef HAS_ARGBCOLORTABLEROW_X86
// Tranform ARGB pixels with color table.
void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb,
« no previous file with comments | « source/row_common.cc ('k') | source/row_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698