codec: Fixed NEON detection and incorrect RFX decoding

This commit is contained in:
Martin Fleisz 2013-02-21 07:08:46 -08:00
parent e819223939
commit 1cfb4a4e77
4 changed files with 19 additions and 24 deletions

View File

@ -45,13 +45,8 @@
#include "rfx_quantization.h"
#include "rfx_dwt.h"
#ifdef WITH_SSE2
#include "rfx_sse2.h"
#endif
#ifdef WITH_NEON
#include "rfx_neon.h"
#endif
#ifndef RFX_INIT_SIMD
#define RFX_INIT_SIMD(_rfx_context) do { } while (0)
@ -232,6 +227,8 @@ RFX_CONTEXT* rfx_context_new(void)
context->dwt_2d_decode = rfx_dwt_2d_decode;
context->dwt_2d_encode = rfx_dwt_2d_encode;
RFX_INIT_SIMD(context);
return context;
}

View File

@ -40,9 +40,7 @@
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
rfx_quantization_decode_block_NEON(INT16 * buffer, const int buffer_size, const UINT32 factor)
{
if (factor <= 6)
return;
int16x8_t quantFactors = vdupq_n_s16(factor - 6);
int16x8_t quantFactors = vdupq_n_s16(factor);
int16x8_t* buf = (int16x8_t*)buffer;
int16x8_t* buf_end = (int16x8_t*)(buffer + buffer_size);
@ -59,16 +57,18 @@ rfx_quantization_decode_block_NEON(INT16 * buffer, const int buffer_size, const
void
rfx_quantization_decode_NEON(INT16 * buffer, const UINT32 * quantization_values)
{
rfx_quantization_decode_block_NEON(buffer, 1024, quantization_values[8]); /* HL1 */
rfx_quantization_decode_block_NEON(buffer + 1024, 1024, quantization_values[7]); /* LH1 */
rfx_quantization_decode_block_NEON(buffer + 2048, 1024, quantization_values[9]); /* HH1 */
rfx_quantization_decode_block_NEON(buffer + 3072, 256, quantization_values[5]); /* HL2 */
rfx_quantization_decode_block_NEON(buffer + 3328, 256, quantization_values[4]); /* LH2 */
rfx_quantization_decode_block_NEON(buffer + 3584, 256, quantization_values[6]); /* HH2 */
rfx_quantization_decode_block_NEON(buffer + 3840, 64, quantization_values[2]); /* HL3 */
rfx_quantization_decode_block_NEON(buffer + 3904, 64, quantization_values[1]); /* LH3 */
rfx_quantization_decode_block_NEON(buffer + 3968, 64, quantization_values[3]); /* HH3 */
rfx_quantization_decode_block_NEON(buffer + 4032, 64, quantization_values[0]); /* LL3 */
rfx_quantization_decode_block_NEON(buffer, 4096, 5);
rfx_quantization_decode_block_NEON(buffer, 1024, quantization_values[8] - 6); /* HL1 */
rfx_quantization_decode_block_NEON(buffer + 1024, 1024, quantization_values[7] - 6); /* LH1 */
rfx_quantization_decode_block_NEON(buffer + 2048, 1024, quantization_values[9] - 6); /* HH1 */
rfx_quantization_decode_block_NEON(buffer + 3072, 256, quantization_values[5] - 6); /* HL2 */
rfx_quantization_decode_block_NEON(buffer + 3328, 256, quantization_values[4] - 6); /* LH2 */
rfx_quantization_decode_block_NEON(buffer + 3584, 256, quantization_values[6] - 6); /* HH2 */
rfx_quantization_decode_block_NEON(buffer + 3840, 64, quantization_values[2] - 6); /* HL3 */
rfx_quantization_decode_block_NEON(buffer + 3904, 64, quantization_values[1] - 6); /* LH3 */
rfx_quantization_decode_block_NEON(buffer + 3968, 64, quantization_values[3] - 6); /* HH3 */
rfx_quantization_decode_block_NEON(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */
}

View File

@ -22,8 +22,6 @@
#include <freerdp/codec/rfx.h>
#if defined(__ARM_NEON__)
void rfx_init_neon(RFX_CONTEXT * context);
#ifndef RFX_INIT_SIMD
@ -32,7 +30,5 @@ void rfx_init_neon(RFX_CONTEXT * context);
#endif
#endif
#endif // __ARM_NEON__
#endif /* __RFX_NEON_H */

View File

@ -24,8 +24,10 @@
void rfx_init_sse2(RFX_CONTEXT* context);
#ifndef RFX_INIT_SIMD
#define RFX_INIT_SIMD(_rfx_context) rfx_init_sse2(_rfx_context)
#ifdef WITH_SSE2
#ifndef RFX_INIT_SIMD
#define RFX_INIT_SIMD(_rfx_context) rfx_init_sse2(_rfx_context)
#endif
#endif
#endif /* __RFX_SSE2_H */