disable faulty avx2 in argb conversions and box filter. and extend temporary buffer to 128 for an avx2 any function.

R=harryjin@google.com
BUG=libyuv:462
TESTED=libyuv_unittest run on haswell laptop

Review URL: https://webrtc-codereview.appspot.com/53759004.
This commit is contained in:
Frank Barchard 2015-07-07 15:40:24 -07:00
parent 0737ff5bd0
commit 97b35daf75
7 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1443 Version: 1444
License: BSD License: BSD
License File: LICENSE License File: LICENSE

View File

@ -186,8 +186,9 @@ extern "C" {
// The following are available require VS2012. Port to GCC. // The following are available require VS2012. Port to GCC.
#if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2) #if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2)
#define HAS_ARGB1555TOARGBROW_AVX2 // Some AVX2 versions disabled. See libyuv bug 462.
#define HAS_ARGB4444TOARGBROW_AVX2 // #define HAS_ARGB1555TOARGBROW_AVX2
// #define HAS_ARGB4444TOARGBROW_AVX2
#define HAS_ARGBTOARGB1555ROW_AVX2 #define HAS_ARGBTOARGB1555ROW_AVX2
#define HAS_ARGBTOARGB4444ROW_AVX2 #define HAS_ARGBTOARGB4444ROW_AVX2
#define HAS_ARGBTORGB565DITHERROW_AVX2 #define HAS_ARGBTORGB565DITHERROW_AVX2
@ -203,7 +204,7 @@ extern "C" {
#define HAS_NV12TORGB565ROW_AVX2 #define HAS_NV12TORGB565ROW_AVX2
#define HAS_NV21TOARGBROW_AVX2 #define HAS_NV21TOARGBROW_AVX2
#define HAS_NV21TORGB565ROW_AVX2 #define HAS_NV21TORGB565ROW_AVX2
#define HAS_RGB565TOARGBROW_AVX2 // #define HAS_RGB565TOARGBROW_AVX2
#endif #endif
// The following are available on all x86 platforms, but // The following are available on all x86 platforms, but

View File

@ -50,7 +50,8 @@ extern "C" {
// The following are available on VS2012: // The following are available on VS2012:
#if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2) #if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2)
#define HAS_SCALEADDROW_AVX2 // Some AVX2 versions disabled. See libyuv bug 462.
// #define HAS_SCALEADDROW_AVX2
#define HAS_SCALEROWDOWN2_AVX2 #define HAS_SCALEROWDOWN2_AVX2
#define HAS_SCALEROWDOWN4_AVX2 #define HAS_SCALEROWDOWN4_AVX2
#endif #endif

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1443 #define LIBYUV_VERSION 1444
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -1232,7 +1232,6 @@ int ARGB1555ToI420(const uint8* src_argb1555, int src_stride_argb1555,
#else #else
ARGB1555ToARGBRow(src_argb1555, row, width); ARGB1555ToARGBRow(src_argb1555, row, width);
ARGB1555ToARGBRow(src_argb1555 + src_stride_argb1555, row + kRowSize, ARGB1555ToARGBRow(src_argb1555 + src_stride_argb1555, row + kRowSize,
width); width);
ARGBToUVRow(row, kRowSize, dst_u, dst_v, width); ARGBToUVRow(row, kRowSize, dst_u, dst_v, width);
ARGBToYRow(row, dst_y, width); ARGBToYRow(row, dst_y, width);

View File

@ -10,7 +10,7 @@
#include "libyuv/row.h" #include "libyuv/row.h"
#include <string.h> // For memcpy and memset. #include <string.h> // For memset.
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"

View File

@ -626,10 +626,10 @@ __declspec(naked)
void ARGB4444ToARGBRow_AVX2(const uint8* src_argb4444, uint8* dst_argb, void ARGB4444ToARGBRow_AVX2(const uint8* src_argb4444, uint8* dst_argb,
int pix) { int pix) {
__asm { __asm {
mov eax, 0x0f0f0f0f // generate mask 0x0f0f0f0f mov eax, 0x0f0f0f0f // generate mask 0x0f0f0f0f
vmovd xmm4, eax vmovd xmm4, eax
vbroadcastss ymm4, xmm4 vbroadcastss ymm4, xmm4
vpslld ymm5, ymm4, 4 // 0xf0f0f0f0 for high nibbles vpslld ymm5, ymm4, 4 // 0xf0f0f0f0 for high nibbles
mov eax, [esp + 4] // src_argb4444 mov eax, [esp + 4] // src_argb4444
mov edx, [esp + 8] // dst_argb mov edx, [esp + 8] // dst_argb
mov ecx, [esp + 12] // pix mov ecx, [esp + 12] // pix