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

Unified Diff: source/row_win.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, 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
Index: source/row_win.cc
diff --git a/source/row_win.cc b/source/row_win.cc
index d54f05e29e6b3e4a33918293d2f442d1aacc65b3..9c54ce06f44b5b5d39489db64048486fed93572a 100644
--- a/source/row_win.cc
+++ b/source/row_win.cc
@@ -6095,13 +6095,9 @@ void ARGBPolynomialRow_AVX2(const uint8* src_argb,
}
#endif // HAS_ARGBPOLYNOMIALROW_AVX2
-// Samples assumed to be unsigned in low 9, 10 or 12 bits. Scale factor
-// adjust the sample range to 0 to 1 using a float multiply.
-// e.g. 9 bit scale is 1.0f / 512.0f
-// e.g. 10 bit scale is 1.0f / 1024.0f
-#ifdef HAS_SHORTTOHALFFLOAT_AVX2
+#ifdef HAS_HALFFLOATROW_AVX2
__declspec(naked)
-void ShortToF16Row_AVX2(const uint16* src, int16* dst, float scale, int width) {
+void HalfFloatRow_AVX2(const uint16* src, int16* dst, float scale, int width) {
__asm {
mov eax, [esp + 4] /* src */
mov edx, [esp + 8] /* dst */
@@ -6114,7 +6110,7 @@ void ShortToF16Row_AVX2(const uint16* src, int16* dst, float scale, int width) {
lea eax, [eax + 16]
vcvtdq2ps ymm0, ymm0 // convert 8 ints to floats
vmulps ymm0, ymm0, ymm4 // scale to normalized range 0 to 1
- vcvtps2ph xmm0, ymm0, 0 // float conver to 8 half floats round even
+ vcvtps2ph xmm0, ymm0, 3 // float convert to 8 half floats truncate
vmovdqu [edx], xmm0
lea edx, [edx + 16]
sub ecx, 8
@@ -6123,7 +6119,7 @@ void ShortToF16Row_AVX2(const uint16* src, int16* dst, float scale, int width) {
ret
}
}
-#endif // HAS_SHORTTOHALFFLOAT_AVX2
+#endif // HAS_HALFFLOATROW_AVX2
#ifdef HAS_ARGBCOLORTABLEROW_X86
// Tranform ARGB pixels with color table.
« source/row_common.cc ('K') | « source/row_gcc.cc ('k') | unit_test/planar_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698