codec: got rid of nsc_context_set_cpu_opt

This commit is contained in:
Martin Fleisz 2013-03-05 10:52:18 +01:00
parent 7d58aac24f
commit 8c2d60f62c
4 changed files with 7 additions and 13 deletions

View File

@ -335,7 +335,6 @@ void test_nsc_decode(void)
NSC_CONTEXT* context; NSC_CONTEXT* context;
context = nsc_context_new(); 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)); nsc_process_message(context, 32, 15, 10, (BYTE*) nsc_data, sizeof(nsc_data));
/*winpr_HexDump(context->bmpdata, 15 * 10 * 4);*/ /*winpr_HexDump(context->bmpdata, 15 * 10 * 4);*/
for (i = 0; i < 30000; i++) 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); memcpy(rgb_data + i * 64 * 3, rgb_scanline_data, 64 * 3);
context = nsc_context_new(); context = nsc_context_new();
nsc_context_set_cpu_opt(context, CPU_SSE2);
nsc_context_set_pixel_format(context, RDP_PIXEL_FORMAT_R8G8B8); nsc_context_set_pixel_format(context, RDP_PIXEL_FORMAT_R8G8B8);
enc_stream = stream_new(65536); enc_stream = stream_new(65536);

View File

@ -65,7 +65,6 @@ struct _NSC_CONTEXT
}; };
FREERDP_API NSC_CONTEXT* nsc_context_new(void); 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_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format);
FREERDP_API void nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, FREERDP_API void nsc_process_message(NSC_CONTEXT* context, UINT16 bpp,
UINT16 width, UINT16 height, BYTE* data, UINT32 length); UINT16 width, UINT16 height, BYTE* data, UINT32 length);

View File

@ -37,9 +37,7 @@
#include "nsc_types.h" #include "nsc_types.h"
#include "nsc_encode.h" #include "nsc_encode.h"
#ifdef WITH_SSE2
#include "nsc_sse2.h" #include "nsc_sse2.h"
#endif
#ifndef NSC_INIT_SIMD #ifndef NSC_INIT_SIMD
#define NSC_INIT_SIMD(_nsc_context) do { } while (0) #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.ColorLossLevel = 3;
nsc_context->nsc_stream.ChromaSubSamplingLevel = 1; nsc_context->nsc_stream.ChromaSubSamplingLevel = 1;
return nsc_context; /* init optimized methods */
}
void nsc_context_set_cpu_opt(NSC_CONTEXT* context, UINT32 cpu_opt)
{
if (cpu_opt)
NSC_INIT_SIMD(context); NSC_INIT_SIMD(context);
return nsc_context;
} }
void nsc_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format) void nsc_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format)

View File

@ -24,8 +24,10 @@
void nsc_init_sse2(NSC_CONTEXT* context); void nsc_init_sse2(NSC_CONTEXT* context);
#ifdef WITH_SSE2
#ifndef NSC_INIT_SIMD #ifndef NSC_INIT_SIMD
#define NSC_INIT_SIMD(_context) nsc_init_sse2(_context) #define NSC_INIT_SIMD(_context) nsc_init_sse2(_context)
#endif #endif
#endif
#endif /* __NSC_SSE2_H */ #endif /* __NSC_SSE2_H */