From 8c2d60f62c8d37ae91953e60f4d28d7c46b56811 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Tue, 5 Mar 2013 10:52:18 +0100 Subject: [PATCH] codec: got rid of nsc_context_set_cpu_opt --- cunit/test_nsc.c | 2 -- include/freerdp/codec/nsc.h | 1 - libfreerdp/codec/nsc.c | 11 +++-------- libfreerdp/codec/nsc_sse2.h | 6 ++++-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cunit/test_nsc.c b/cunit/test_nsc.c index 4e74cd5b0..f26edf1a9 100644 --- a/cunit/test_nsc.c +++ b/cunit/test_nsc.c @@ -335,7 +335,6 @@ void test_nsc_decode(void) NSC_CONTEXT* context; context = nsc_context_new(); - nsc_context_set_cpu_opt(context, CPU_SSE2); nsc_process_message(context, 32, 15, 10, (BYTE*) nsc_data, sizeof(nsc_data)); /*winpr_HexDump(context->bmpdata, 15 * 10 * 4);*/ for (i = 0; i < 30000; i++) @@ -357,7 +356,6 @@ void test_nsc_encode(void) memcpy(rgb_data + i * 64 * 3, rgb_scanline_data, 64 * 3); context = nsc_context_new(); - nsc_context_set_cpu_opt(context, CPU_SSE2); nsc_context_set_pixel_format(context, RDP_PIXEL_FORMAT_R8G8B8); enc_stream = stream_new(65536); diff --git a/include/freerdp/codec/nsc.h b/include/freerdp/codec/nsc.h index d16bf4814..4ae32fd2f 100644 --- a/include/freerdp/codec/nsc.h +++ b/include/freerdp/codec/nsc.h @@ -65,7 +65,6 @@ struct _NSC_CONTEXT }; FREERDP_API NSC_CONTEXT* nsc_context_new(void); -FREERDP_API void nsc_context_set_cpu_opt(NSC_CONTEXT* context, UINT32 cpu_opt); FREERDP_API void nsc_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format); FREERDP_API void nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, UINT16 width, UINT16 height, BYTE* data, UINT32 length); diff --git a/libfreerdp/codec/nsc.c b/libfreerdp/codec/nsc.c index c405997d0..b721f6283 100644 --- a/libfreerdp/codec/nsc.c +++ b/libfreerdp/codec/nsc.c @@ -37,9 +37,7 @@ #include "nsc_types.h" #include "nsc_encode.h" -#ifdef WITH_SSE2 #include "nsc_sse2.h" -#endif #ifndef NSC_INIT_SIMD #define NSC_INIT_SIMD(_nsc_context) do { } while (0) @@ -291,13 +289,10 @@ NSC_CONTEXT* nsc_context_new(void) nsc_context->nsc_stream.ColorLossLevel = 3; nsc_context->nsc_stream.ChromaSubSamplingLevel = 1; - return nsc_context; -} + /* init optimized methods */ + NSC_INIT_SIMD(context); -void nsc_context_set_cpu_opt(NSC_CONTEXT* context, UINT32 cpu_opt) -{ - if (cpu_opt) - NSC_INIT_SIMD(context); + return nsc_context; } void nsc_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format) diff --git a/libfreerdp/codec/nsc_sse2.h b/libfreerdp/codec/nsc_sse2.h index f665dd148..8c7902019 100644 --- a/libfreerdp/codec/nsc_sse2.h +++ b/libfreerdp/codec/nsc_sse2.h @@ -24,8 +24,10 @@ void nsc_init_sse2(NSC_CONTEXT* context); -#ifndef NSC_INIT_SIMD -#define NSC_INIT_SIMD(_context) nsc_init_sse2(_context) +#ifdef WITH_SSE2 + #ifndef NSC_INIT_SIMD + #define NSC_INIT_SIMD(_context) nsc_init_sse2(_context) + #endif #endif #endif /* __NSC_SSE2_H */