From def55c141ec182e75de7d1279e753f104edd941f Mon Sep 17 00:00:00 2001 From: Licai Guo Date: Wed, 22 Jan 2014 19:01:51 -0800 Subject: [PATCH 1/2] fix decoder win64 asm float issues --- codec/decoder/plus/inc/welsDecoderExt.h | 4 +++- codec/decoder/plus/src/welsDecoderExt.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/codec/decoder/plus/inc/welsDecoderExt.h b/codec/decoder/plus/inc/welsDecoderExt.h index 4fea2e2d..fcf57af5 100644 --- a/codec/decoder/plus/inc/welsDecoderExt.h +++ b/codec/decoder/plus/inc/welsDecoderExt.h @@ -46,7 +46,7 @@ #include "codec_app_def.h" #include "decoder_context.h" #include "welsCodecTrace.h" - +#include "cpu.h" class ISVCDecoder; @@ -104,6 +104,8 @@ IWelsTrace* m_pTrace; void_t InitDecoder (void_t); void_t UninitDecoder (void_t); +XMMREG_PROTECT_DECLARE(CWelsH264Decoder); + #ifdef OUTPUT_BIT_STREAM WelsFileHandle* m_pFBS; WelsFileHandle* m_pFBSSize; diff --git a/codec/decoder/plus/src/welsDecoderExt.cpp b/codec/decoder/plus/src/welsDecoderExt.cpp index 9413e8be..902ac4a1 100644 --- a/codec/decoder/plus/src/welsDecoderExt.cpp +++ b/codec/decoder/plus/src/welsDecoderExt.cpp @@ -99,7 +99,7 @@ CWelsDecoder::CWelsDecoder (void_t) m_pTrace = CreateWelsTrace (Wels_Trace_Type); IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry"); - + XMMREG_PROTECT_INIT(CWelsH264Decoder); #ifdef OUTPUT_BIT_STREAM SWelsTime sCurTime; @@ -151,6 +151,7 @@ CWelsDecoder::~CWelsDecoder() { IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()"); UninitDecoder(); + XMMREG_PROTECT_UNINIT(CWelsH264Decoder); #ifdef OUTPUT_BIT_STREAM if (m_pFBS) { @@ -384,8 +385,10 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, m_pDecContext->iFeedbackTidInAu = -1; //initialize + XMMREG_PROTECT_STORE(CWelsH264Decoder); WelsDecodeBs (m_pDecContext, kpSrc, kiSrcLen, (unsigned char**)ppDst, pDstInfo); //iErrorCode has been modified in this function + XMMREG_PROTECT_LOAD(CWelsH264Decoder); pDstInfo->eWorkMode = (EDecodeMode)m_pDecContext->iDecoderMode; From fe2fa96bcb911434284fce11992d85c69bbd196a Mon Sep 17 00:00:00 2001 From: Licai Guo Date: Wed, 22 Jan 2014 22:14:31 -0800 Subject: [PATCH 2/2] update vs project files --- codec/build/win32/dec/WelsDecCore.vcproj | 4 ++-- codec/build/win32/dec/WelsDecPlus.vcproj | 10 +++++----- codec/build/win32/dec/decConsole.vcproj | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/codec/build/win32/dec/WelsDecCore.vcproj b/codec/build/win32/dec/WelsDecCore.vcproj index c347ea78..ce972c26 100644 --- a/codec/build/win32/dec/WelsDecCore.vcproj +++ b/codec/build/win32/dec/WelsDecCore.vcproj @@ -134,7 +134,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..\decoder\core\inc;..\..\..\common;..\..\..\api\svc;..\..\..\hwDecoder\core\inc;..\..\..\hwDecoder\dxva\inc" - PreprocessorDefinitions="WIN64;NDEBUG;_LIB;HAVE_CACHE_LINE_ALIGN" + PreprocessorDefinitions="WIN64;NDEBUG;_LIB;HAVE_CACHE_LINE_ALIGN;X86_ASM" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -291,7 +291,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\decoder\core\inc;..\..\..\common;..\..\..\api\svc;..\..\..\hwDecoder\core\inc;..\..\..\hwDecoder\dxva\inc" - PreprocessorDefinitions="WIN64;_DEBUG;_LIB;HAVE_CACHE_LINE_ALIGN" + PreprocessorDefinitions="WIN64;_DEBUG;_LIB;HAVE_CACHE_LINE_ALIGN;X86_ASM" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" diff --git a/codec/build/win32/dec/WelsDecPlus.vcproj b/codec/build/win32/dec/WelsDecPlus.vcproj index fc452bfd..5927a02a 100644 --- a/codec/build/win32/dec/WelsDecPlus.vcproj +++ b/codec/build/win32/dec/WelsDecPlus.vcproj @@ -54,7 +54,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..\decoder\plus\inc;..\..\..\decoder\core\inc;..\..\..\api\svc;..\..\..\common;..\..\..\hwDecoder\plus\inc;..\..\..\hwDecoder\core\inc" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WELSDECPLUS_EXPORTS;HAVE_CACHE_LINE_ALIGN" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WELSDECPLUS_EXPORTS;HAVE_CACHE_LINE_ALIGN;X86_ASM" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -154,7 +154,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..\decoder\plus\inc;..\..\..\decoder\core\inc;..\..\..\api\svc;..\..\..\common;..\..\..\hwDecoder\plus\inc;..\..\..\hwDecoder\core\inc" - PreprocessorDefinitions="WIN64;NDEBUG;_WINDOWS;_USRDLL;WELSDECPLUS_EXPORTS;HAVE_CACHE_LINE_ALIGN" + PreprocessorDefinitions="WIN64;NDEBUG;_WINDOWS;_USRDLL;WELSDECPLUS_EXPORTS;HAVE_CACHE_LINE_ALIGN;X86_ASM" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -253,7 +253,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\decoder\plus\inc;..\..\..\decoder\core\inc;..\..\..\api\svc;..\..\..\common;..\..\..\hwDecoder\plus\inc;..\..\..\hwDecoder\core\inc" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WELSDECPLUS_EXPORTS;HAVE_CACHE_LINE_ALIGN" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WELSDECPLUS_EXPORTS;HAVE_CACHE_LINE_ALIGN;X86_ASM" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -317,7 +317,7 @@