Question

I am trying to compile libvpx-v1.3.0 on Win64 using Visual Studio 2005. But, I end up getting the following error,

..\libvpx-1.3.0\vp9\common\x86\vp9_loopfilter_intrin_sse2.c(36) : error C2440: 'function' : cannot convert from 'int' to '__m128'

Can you please help me resolve this?

EDIT: Before this error, I get two warnings,

2>..\libvpx-1.3.0\vp9\common\x86\vp9_loopfilter_intrin_sse2.c(35) : warning C4013: '_mm_castps_si128' undefined; assuming extern returning int
2>..\libvpx-1.3.0\vp9\common\x86\vp9_loopfilter_intrin_sse2.c(35) : warning C4013: '_mm_castsi128_ps' undefined; assuming extern returning int

Could it be because '_mm_castps_si128' and '_mm_castsi128_ps' are not defined for Visual Studio 2005?

Thanks

Was it helpful?

Solution

The answer is given in this link: https://groups.google.com/a/webmproject.org/forum/#!topic/webm-discuss/C5nzgPiPDF4

I extended the file in vpx_ports/emmintrin_compat.h by adding the definitions for those functions:

#if (_MSC_VER == 1400)
// For Visual Studio 2005
__inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; }
__inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; }
__inline __m128d _mm_castsi128_pd(__m128i PI) { union { __m128i pi; __m128d pd; } c; c.pi = PI; return c.pd; }
#endif

This change fixed the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top