diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2017-10-26 20:49:22 +0300 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2017-10-26 20:49:22 +0300 |
commit | e1bcd8e9633063ac9e9f082db96eafdb0b5c4527 (patch) | |
tree | bc7601f6244991b557a8b6f46ee293c594ec4f9b | |
parent | 631f7ee053e9b38984d838e5aff02c4abc8c6d90 (diff) |
add access to internal functions
-rw-r--r-- | include/rfxcodec_encode.h | 34 | ||||
-rw-r--r-- | src/rfxencode.c | 29 |
2 files changed, 63 insertions, 0 deletions
diff --git a/include/rfxcodec_encode.h b/include/rfxcodec_encode.h index 1f9082d..2c5876f 100644 --- a/include/rfxcodec_encode.h +++ b/include/rfxcodec_encode.h @@ -73,4 +73,38 @@ rfxcodec_encode_ex(void *handle, char *cdata, int *cdata_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags); +/* use simple types here, no sint16_t, uint8_t, ... */ +typedef int (*rfxencode_rlgr1_proc)(const short *data, unsigned char *buffer, int buffer_size); +typedef int (*rfxencode_rlgr3_proc)(const short *data, unsigned char *buffer, int buffer_size); +typedef int (*rfxencode_differential_proc)(short *buffer, int buffer_size); +typedef int (*rfxencode_quantization_proc)(short *buffer, const char *quantization_values); +typedef int (*rfxencode_dwt_2d_proc)(const unsigned char *in_buffer, short *buffer, short *dwt_buffer); + +typedef int (*rfxencode_diff_rlgr1_proc)(short *coef, unsigned char *cdata, int cdata_size); +typedef int (*rfxencode_diff_rlgr3_proc)(short *coef, unsigned char *cdata, int cdata_size); + +typedef int (*rfxencode_dwt_shift_x86_sse2_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); +typedef int (*rfxencode_dwt_shift_x86_sse41_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); + +typedef int (*rfxencode_dwt_shift_amd64_sse2_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); +typedef int (*rfxencode_dwt_shift_amd64_sse41_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); + +struct rfxcodec_encode_internals +{ + rfxencode_rlgr1_proc rfxencode_rlgr1; + rfxencode_rlgr3_proc rfxencode_rlgr3; + rfxencode_differential_proc rfxencode_differential; + rfxencode_quantization_proc rfxencode_quantization; + rfxencode_dwt_2d_proc rfxencode_dwt_2d; + rfxencode_diff_rlgr1_proc rfxencode_diff_rlgr1; + rfxencode_diff_rlgr3_proc rfxencode_diff_rlgr3; + rfxencode_dwt_shift_x86_sse2_proc rfxencode_dwt_shift_x86_sse2; + rfxencode_dwt_shift_x86_sse41_proc rfxencode_dwt_shift_x86_sse41; + rfxencode_dwt_shift_amd64_sse2_proc rfxencode_dwt_shift_amd64_sse2; + rfxencode_dwt_shift_amd64_sse41_proc rfxencode_dwt_shift_amd64_sse41; +}; + +int +rfxcodec_encode_get_internals(struct rfxcodec_encode_internals *internals); + #endif diff --git a/src/rfxencode.c b/src/rfxencode.c index bd5d7b7..b163827 100644 --- a/src/rfxencode.c +++ b/src/rfxencode.c @@ -31,6 +31,13 @@ #include "rfxencode_compose.h" #include "rfxconstants.h" #include "rfxencode_tile.h" +#include "rfxencode_rlgr1.h" +#include "rfxencode_rlgr3.h" +#include "rfxencode_differential.h" +#include "rfxencode_quantization.h" +#include "rfxencode_dwt.h" +#include "rfxencode_diff_rlgr1.h" +#include "rfxencode_diff_rlgr3.h" #ifdef RFX_USE_ACCEL_X86 #include "x86/funcs_x86.h" @@ -344,3 +351,25 @@ rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes, num_tiles, quants, num_quants, 0); } +/******************************************************************************/ +int +rfxcodec_encode_get_internals(struct rfxcodec_encode_internals *internals) +{ + memset(internals, 0, sizeof(struct rfxcodec_encode_internals)); + internals->rfxencode_rlgr1 = rfx_rlgr1_encode; + internals->rfxencode_rlgr3 = rfx_rlgr3_encode; + internals->rfxencode_differential = rfx_differential_encode; + internals->rfxencode_quantization = rfx_quantization_encode; + internals->rfxencode_dwt_2d = rfx_dwt_2d_encode; + internals->rfxencode_diff_rlgr1 = rfx_encode_diff_rlgr1; + internals->rfxencode_diff_rlgr3 = rfx_encode_diff_rlgr3; +#if defined(RFX_USE_ACCEL_X86) + internals->rfxencode_dwt_shift_x86_sse2 = rfxcodec_encode_dwt_shift_x86_sse2; + internals->rfxencode_dwt_shift_x86_sse41 = rfxcodec_encode_dwt_shift_x86_sse41; +#endif +#if defined(RFX_USE_ACCEL_AMD64) + internals->rfxencode_dwt_shift_amd64_sse2 = rfxcodec_encode_dwt_shift_amd64_sse2; + internals->rfxencode_dwt_shift_amd64_sse41 = rfxcodec_encode_dwt_shift_amd64_sse41; +#endif + return 0; +} |