diff --git a/src/dsp/dec_sse2.c b/src/dsp/dec_sse2.c index 472b68ec..2cb55d01 100644 --- a/src/dsp/dec_sse2.c +++ b/src/dsp/dec_sse2.c @@ -12,15 +12,15 @@ #include "./dsp.h" +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + #if defined(WEBP_USE_SSE2) #include #include "../dec/vp8i.h" -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - //------------------------------------------------------------------------------ // Transforms (Paragraph 14.4) @@ -876,9 +876,15 @@ static void HFilter8iSSE2(uint8_t* u, uint8_t* v, int stride, Store16x4(u, v, stride, &p1, &p0, &q0, &q1); } +#endif // WEBP_USE_SSE2 + +//------------------------------------------------------------------------------ +// Entry point + extern void VP8DspInitSSE2(void); void VP8DspInitSSE2(void) { +#if defined(WEBP_USE_SSE2) VP8Transform = TransformSSE2; VP8VFilter16 = VFilter16SSE2; @@ -894,10 +900,9 @@ void VP8DspInitSSE2(void) { VP8SimpleHFilter16 = SimpleHFilter16SSE2; VP8SimpleVFilter16i = SimpleVFilter16iSSE2; VP8SimpleHFilter16i = SimpleHFilter16iSSE2; +#endif // WEBP_USE_SSE2 } #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" #endif - -#endif // WEBP_USE_SSE2 diff --git a/src/dsp/enc_sse2.c b/src/dsp/enc_sse2.c index b046761d..0986e82e 100644 --- a/src/dsp/enc_sse2.c +++ b/src/dsp/enc_sse2.c @@ -11,16 +11,16 @@ #include "./dsp.h" +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + #if defined(WEBP_USE_SSE2) #include // for abs() #include #include "../enc/vp8enci.h" -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - //------------------------------------------------------------------------------ // Compute susceptibility based on DCT-coeff histograms: // the higher, the "easier" the macroblock is to compress. @@ -819,8 +819,15 @@ static int QuantizeBlockSSE2(int16_t in[16], int16_t out[16], } } +#endif // WEBP_USE_SSE2 + +//------------------------------------------------------------------------------ +// Entry point + extern void VP8EncDspInitSSE2(void); + void VP8EncDspInitSSE2(void) { +#if defined(WEBP_USE_SSE2) VP8CollectHistogram = CollectHistogramSSE2; VP8EncQuantizeBlock = QuantizeBlockSSE2; VP8ITransform = ITransformSSE2; @@ -828,10 +835,9 @@ void VP8EncDspInitSSE2(void) { VP8SSE4x4 = SSE4x4SSE2; VP8TDisto4x4 = Disto4x4SSE2; VP8TDisto16x16 = Disto16x16SSE2; +#endif // WEBP_USE_SSE2 } #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" #endif - -#endif // WEBP_USE_SSE2