mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 20:55:38 +08:00
Fix OpenFEC compile error on Windows platform
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
* Default maximum number of source and encoding symbols for this codec.
|
||||
* This value depends in particular on the Finite Field size used (here GF(2^8)).
|
||||
* To this limit, codec implementation details might add other limits (e.g. if
|
||||
* the ESI values are stored in UINT16 instead of UINT32...).
|
||||
* the ESI values are stored in _UINT16 instead of _UINT32...).
|
||||
*/
|
||||
#define OF_REED_SOLOMON_MAX_NB_SOURCE_SYMBOLS_DEFAULT 255
|
||||
#define OF_REED_SOLOMON_MAX_NB_ENCODING_SYMBOLS_DEFAULT 255
|
||||
|
||||
@@ -36,104 +36,104 @@
|
||||
|
||||
#ifdef OF_USE_REED_SOLOMON_CODEC
|
||||
|
||||
/* VR: added for WIN CE support */
|
||||
#ifdef _WIN32_WCE
|
||||
#define bzero(to,sz) memset((to), 0, (sz))
|
||||
// /* VR: added for WIN CE support */
|
||||
// #ifdef _WIN32_WCE
|
||||
// #define bzero(to,sz) memset((to), 0, (sz))
|
||||
|
||||
#define bcmp(a,b,sz) memcmp((a), (b), (sz))
|
||||
#endif /* WIN32_WCE */
|
||||
// #define bcmp(a,b,sz) memcmp((a), (b), (sz))
|
||||
// #endif /* WIN32_WCE */
|
||||
|
||||
/*
|
||||
* compatibility stuff
|
||||
*/
|
||||
#if defined(WIN32) /* but also for others, e.g. sun... */
|
||||
#define NEED_BCOPY
|
||||
#define bcmp(a,b,n) memcmp(a,b,n)
|
||||
#endif
|
||||
// /*
|
||||
// * compatibility stuff
|
||||
// */
|
||||
// #if defined(_WIN32) /* but also for others, e.g. sun... */
|
||||
// #define NEED_BCOPY
|
||||
// #define bcmp(a,b,n) memcmp(a,b,n)
|
||||
// #endif
|
||||
|
||||
#ifdef NEED_BCOPY
|
||||
#define bcopy(s, d, siz) memcpy((d), (s), (siz))
|
||||
#define bzero(d, siz) memset((d), '\0', (siz))
|
||||
#endif
|
||||
// #ifdef NEED_BCOPY
|
||||
// #define bcopy(s, d, siz) memcpy((d), (s), (siz))
|
||||
// #define bzero(d, siz) memset((d), '\0', (siz))
|
||||
// #endif
|
||||
|
||||
#ifndef UINT32
|
||||
#define UINT32 unsigned long
|
||||
#endif
|
||||
// #ifndef _UINT32
|
||||
// #define _UINT32 unsigned long
|
||||
// #endif
|
||||
|
||||
/*
|
||||
* stuff used for testing purposes only
|
||||
*/
|
||||
// /*
|
||||
// * stuff used for testing purposes only
|
||||
// */
|
||||
|
||||
#ifdef TICK /* VR: avoid a warning under Solaris */
|
||||
#undef TICK
|
||||
#endif
|
||||
// #ifdef TICK /* VR: avoid a warning under Solaris */
|
||||
// #undef TICK
|
||||
// #endif
|
||||
|
||||
//#define TEST
|
||||
#ifdef TEST /* { */
|
||||
// //#define TEST
|
||||
// #ifdef TEST /* { */
|
||||
|
||||
#define DEB(x) x
|
||||
#define DDB(x) x
|
||||
#define OF_RS_DEBUG 4 /* minimal debugging */
|
||||
#if defined(WIN32)
|
||||
#include <time.h>
|
||||
struct timeval
|
||||
{
|
||||
unsigned long ticks;
|
||||
};
|
||||
#define gettimeofday(x, dummy) { (x)->ticks = clock() ; }
|
||||
#define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC )
|
||||
typedef unsigned long UINT32 ;
|
||||
typedef unsigned short u_short ;
|
||||
#else /* typically, unix systems */
|
||||
#include <sys/time.h>
|
||||
#define DIFF_T(a,b) \
|
||||
(1+ 1000000*(a.tv_sec - b.tv_sec) + (a.tv_usec - b.tv_usec) )
|
||||
#endif
|
||||
// #define DEB(x) x
|
||||
// #define DDB(x) x
|
||||
// #define OF_RS_DEBUG 4 /* minimal debugging */
|
||||
// #if defined(_WIN32)
|
||||
// #include <time.h>
|
||||
// struct timeval
|
||||
// {
|
||||
// unsigned long ticks;
|
||||
// };
|
||||
// #define gettimeofday(x, dummy) { (x)->ticks = clock() ; }
|
||||
// #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC )
|
||||
// typedef unsigned long _UINT32 ;
|
||||
// typedef unsigned short u_short ;
|
||||
// #else /* typically, unix systems */
|
||||
// #include <sys/time.h>
|
||||
// #define DIFF_T(a,b) \
|
||||
// (1+ 1000000*(a.tv_sec - b.tv_sec) + (a.tv_usec - b.tv_usec) )
|
||||
// #endif
|
||||
|
||||
#define TICK(t) \
|
||||
{struct timeval x ; \
|
||||
gettimeofday(&x, NULL) ; \
|
||||
t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \
|
||||
}
|
||||
#define TOCK(t) \
|
||||
{ UINT32 t1 ; TICK(t1) ; \
|
||||
if (t1 < t) t = 256000000 + t1 - t ; \
|
||||
else t = t1 - t ; \
|
||||
if (t == 0) t = 1 ;}
|
||||
// #define TICK(t) \
|
||||
// {struct timeval x ; \
|
||||
// gettimeofday(&x, NULL) ; \
|
||||
// t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \
|
||||
// }
|
||||
// #define TOCK(t) \
|
||||
// { _UINT32 t1 ; TICK(t1) ; \
|
||||
// if (t1 < t) t = 256000000 + t1 - t ; \
|
||||
// else t = t1 - t ; \
|
||||
// if (t == 0) t = 1 ;}
|
||||
|
||||
UINT32 ticks[10]; /* vars for timekeeping */
|
||||
// _UINT32 ticks[10]; /* vars for timekeeping */
|
||||
|
||||
#else /* } { */
|
||||
// #else /* } { */
|
||||
|
||||
#define DEB(x)
|
||||
#define DDB(x)
|
||||
#define TICK(x)
|
||||
#define TOCK(x)
|
||||
// #define DEB(x)
|
||||
// #define DDB(x)
|
||||
// #define TICK(x)
|
||||
// #define TOCK(x)
|
||||
|
||||
#endif /* } TEST */
|
||||
// #endif /* } TEST */
|
||||
|
||||
|
||||
/*
|
||||
* You should not need to change anything beyond this point.
|
||||
* The first part of the file implements linear algebra in GF.
|
||||
*
|
||||
* gf is the type used to store an element of the Galois Field.
|
||||
* Must constain at least GF_BITS bits.
|
||||
*
|
||||
* Note: unsigned char will work up to GF(256) but int seems to run
|
||||
* faster on the Pentium. We use int whenever have to deal with an
|
||||
* index, since they are generally faster.
|
||||
*/
|
||||
#if (GF_BITS < 2 && GF_BITS >16)
|
||||
#error "GF_BITS must be 2 .. 16"
|
||||
#endif
|
||||
/*#if (GF_BITS <= 8)
|
||||
typedef unsigned char gf;
|
||||
#else
|
||||
typedef unsigned short gf;
|
||||
#endif*/
|
||||
// /*
|
||||
// * You should not need to change anything beyond this point.
|
||||
// * The first part of the file implements linear algebra in GF.
|
||||
// *
|
||||
// * gf is the type used to store an element of the Galois Field.
|
||||
// * Must constain at least GF_BITS bits.
|
||||
// *
|
||||
// * Note: unsigned char will work up to GF(256) but int seems to run
|
||||
// * faster on the Pentium. We use int whenever have to deal with an
|
||||
// * index, since they are generally faster.
|
||||
// */
|
||||
// #if (GF_BITS < 2 && GF_BITS >16)
|
||||
// #error "GF_BITS must be 2 .. 16"
|
||||
// #endif
|
||||
// /*#if (GF_BITS <= 8)
|
||||
// typedef unsigned char gf;
|
||||
// #else
|
||||
// typedef unsigned short gf;
|
||||
// #endif*/
|
||||
|
||||
#define GF_SIZE ((1 << GF_BITS) - 1) /* powers of \alpha */
|
||||
// #define GF_SIZE ((1 << GF_BITS) - 1) /* powers of \alpha */
|
||||
|
||||
/*
|
||||
* Primitive polynomials - see Lin & Costello, Appendix A,
|
||||
@@ -180,7 +180,7 @@ static gf of_rs_inverse[GF_SIZE+1]; /* inverse of field elem. */
|
||||
* without a slow divide.
|
||||
*/
|
||||
static gf
|
||||
of_modnn (INT32 x)
|
||||
of_modnn (_INT32 x)
|
||||
{
|
||||
while (x >= GF_SIZE)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ of_gf_mul (x, y)
|
||||
* one place.
|
||||
*/
|
||||
static void *
|
||||
of_my_malloc (INT32 sz, const char *err_string)
|
||||
of_my_malloc (_INT32 sz, const char *err_string)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
void *p = malloc (sz);
|
||||
@@ -285,7 +285,7 @@ static void
|
||||
of_generate_gf (void)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
INT32 i;
|
||||
_INT32 i;
|
||||
gf mask;
|
||||
const char *Pp = of_rs_allPp[GF_BITS] ;
|
||||
|
||||
@@ -373,22 +373,22 @@ of_addmul1 (gf *dst1, gf *src1, gf c, int sz)
|
||||
register gf *dst = dst1, *src = src1 ;
|
||||
|
||||
gf *lim = &dst[sz - UNROLL + 1] ;
|
||||
UINT64 tmp;
|
||||
UINT64 *dst_64 = (UINT64*)dst1;
|
||||
_UINT64 tmp;
|
||||
_UINT64 *dst_64 = (_UINT64*)dst1;
|
||||
GF_MULC0 (c) ;
|
||||
/* with 64-bit CPUs, unroll the loop and work on two 64-bit words at a time. */
|
||||
for (; dst < lim ; dst += UNROLL, src += UNROLL)
|
||||
{
|
||||
|
||||
tmp = ((UINT64)__gf_mulc_[src[0]]) | ((UINT64)__gf_mulc_[src[1]]<<8) | ((UINT64)__gf_mulc_[src[2]]<<16) |
|
||||
((UINT64)__gf_mulc_[src[3]]<<24) | ((UINT64)__gf_mulc_[src[4]]<<32) | ((UINT64)__gf_mulc_[src[5]]<<40) |
|
||||
((UINT64)__gf_mulc_[src[6]]<<48) | ((UINT64)__gf_mulc_[src[7]]<<56) ;
|
||||
tmp = ((_UINT64)__gf_mulc_[src[0]]) | ((_UINT64)__gf_mulc_[src[1]]<<8) | ((_UINT64)__gf_mulc_[src[2]]<<16) |
|
||||
((_UINT64)__gf_mulc_[src[3]]<<24) | ((_UINT64)__gf_mulc_[src[4]]<<32) | ((_UINT64)__gf_mulc_[src[5]]<<40) |
|
||||
((_UINT64)__gf_mulc_[src[6]]<<48) | ((_UINT64)__gf_mulc_[src[7]]<<56) ;
|
||||
*dst_64 ^= tmp;
|
||||
dst_64++;
|
||||
|
||||
tmp = ((UINT64)__gf_mulc_[src[8]]) | ((UINT64)__gf_mulc_[src[9]]<<8) | ((UINT64)__gf_mulc_[src[10]]<<16) |
|
||||
((UINT64)__gf_mulc_[src[11]]<<24) | ((UINT64)__gf_mulc_[src[12]]<<32) | ((UINT64)__gf_mulc_[src[13]]<<40) |
|
||||
((UINT64)__gf_mulc_[src[14]]<<48) | ((UINT64)__gf_mulc_[src[15]]<<56) ;
|
||||
tmp = ((_UINT64)__gf_mulc_[src[8]]) | ((_UINT64)__gf_mulc_[src[9]]<<8) | ((_UINT64)__gf_mulc_[src[10]]<<16) |
|
||||
((_UINT64)__gf_mulc_[src[11]]<<24) | ((_UINT64)__gf_mulc_[src[12]]<<32) | ((_UINT64)__gf_mulc_[src[13]]<<40) |
|
||||
((_UINT64)__gf_mulc_[src[14]]<<48) | ((_UINT64)__gf_mulc_[src[15]]<<56) ;
|
||||
*dst_64 ^= tmp;
|
||||
dst_64++;
|
||||
}
|
||||
@@ -747,8 +747,8 @@ of_rs_init()
|
||||
|
||||
struct fec_parms
|
||||
{
|
||||
UINT32 magic ;
|
||||
INT32 k, n ; /* parameters of the code */
|
||||
_UINT32 magic ;
|
||||
_INT32 k, n ; /* parameters of the code */
|
||||
gf *enc_matrix ;
|
||||
} ;
|
||||
|
||||
@@ -766,7 +766,7 @@ void of_rs_free (struct fec_parms *p)
|
||||
#endif /* CPLUSPLUS_COMPATIBLE */
|
||||
if (p == NULL) //||
|
||||
//p->magic != ( ( (FEC_MAGIC ^ p->k) ^ p->n) ^ (int)(p->enc_matrix)) ) {
|
||||
//p->magic != (( (FEC_MAGIC ^ p->k) ^ p->n) ^ (UINT32) (p->enc_matrix)))
|
||||
//p->magic != (( (FEC_MAGIC ^ p->k) ^ p->n) ^ (_UINT32) (p->enc_matrix)))
|
||||
{
|
||||
OF_PRINT_ERROR (("bad parameters to fec_free\n"))
|
||||
return ;
|
||||
@@ -785,10 +785,10 @@ struct fec_parms *
|
||||
#else
|
||||
void *
|
||||
#endif
|
||||
of_rs_new (UINT32 k, UINT32 n)
|
||||
of_rs_new (_UINT32 k, _UINT32 n)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
INT32 row, col ;
|
||||
_INT32 row, col ;
|
||||
gf *p, *tmp_m ;
|
||||
|
||||
struct fec_parms *retval ;
|
||||
|
||||
@@ -59,14 +59,14 @@ typedef struct of_rs_cb
|
||||
/*
|
||||
* FEC codec id specific attributes follow...
|
||||
*/
|
||||
UINT32 nb_source_symbols; /** k parameter (AKA code dimension). */
|
||||
UINT32 nb_repair_symbols; /** r = n - k parameter. */
|
||||
UINT32 nb_encoding_symbols; /** n parameter (AKA code length). */
|
||||
_UINT32 nb_source_symbols; /** k parameter (AKA code dimension). */
|
||||
_UINT32 nb_repair_symbols; /** r = n - k parameter. */
|
||||
_UINT32 nb_encoding_symbols; /** n parameter (AKA code length). */
|
||||
/** Maximum number of source symbols supported by this codec for practical reasons. */
|
||||
UINT32 max_nb_source_symbols;
|
||||
_UINT32 max_nb_source_symbols;
|
||||
/** Maximum number of encoding symbols supported by this codec for practical reasons. */
|
||||
UINT32 max_nb_encoding_symbols;
|
||||
UINT32 encoding_symbol_length; /** symbol length. */
|
||||
_UINT32 max_nb_encoding_symbols;
|
||||
_UINT32 encoding_symbol_length; /** symbol length. */
|
||||
|
||||
void *rs_cb; /** Reed-Solomon internal codec control block */
|
||||
|
||||
@@ -81,20 +81,20 @@ typedef struct of_rs_cb
|
||||
void ** available_symbols_tab;
|
||||
/** Number of available source and repair symbols. This is the number of entries in
|
||||
* the available_symbols_tab tables. */
|
||||
UINT32 nb_available_symbols;
|
||||
_UINT32 nb_available_symbols;
|
||||
/** Number of available source symbols. */
|
||||
UINT32 nb_available_source_symbols;
|
||||
_UINT32 nb_available_source_symbols;
|
||||
bool decoding_finished; /** true as soon as decoding completed. */
|
||||
#endif /* OF_USE_DECODER */
|
||||
|
||||
|
||||
/** callbacks for this codec. */
|
||||
void* (*decoded_source_symbol_callback) (void *context,
|
||||
UINT32 size, /* size of decoded source symbol */
|
||||
UINT32 esi); /* encoding symbol ID in {0..k-1} */
|
||||
_UINT32 size, /* size of decoded source symbol */
|
||||
_UINT32 esi); /* encoding symbol ID in {0..k-1} */
|
||||
void* (*decoded_repair_symbol_callback) (void *context,
|
||||
UINT32 size, /* size of decoded repair symbol */
|
||||
UINT32 esi); /* encoding symbol ID in {0..k-1} */
|
||||
_UINT32 size, /* size of decoded repair symbol */
|
||||
_UINT32 esi); /* encoding symbol ID in {0..k-1} */
|
||||
void* context_4_callback;
|
||||
|
||||
} of_rs_cb_t;
|
||||
@@ -144,8 +144,8 @@ of_status_t of_rs_set_fec_parameters (of_rs_cb_t* ofcb,
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_set_callback_functions (of_rs_cb_t *ofcb,void* (*decoded_source_symbol_callback)
|
||||
* (void *context,UINT32 size,UINT32 esi), void* (*decoded_repair_symbol_callback)
|
||||
* (void *context,UINT32 size,UINT32 esi),void* context_4_callback)
|
||||
* (void *context,_UINT32 size,_UINT32 esi), void* (*decoded_repair_symbol_callback)
|
||||
* (void *context,_UINT32 size,_UINT32 esi),void* context_4_callback)
|
||||
* @brief set various callbock functions (see header of_open_fec_api.h)
|
||||
* @param ofcb (IN) Pointer to the session.
|
||||
*
|
||||
@@ -169,16 +169,16 @@ of_status_t of_rs_set_fec_parameters (of_rs_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_rs_set_callback_functions (of_rs_cb_t* ofcb,
|
||||
void* (*decoded_source_symbol_callback) (void *context,
|
||||
UINT32 size, /* size of decoded source symbol */
|
||||
UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
_UINT32 size, /* size of decoded source symbol */
|
||||
_UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
void* (*decoded_repair_symbol_callback) (void *context,
|
||||
UINT32 size, /* size of decoded repair symbol */
|
||||
UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
_UINT32 size, /* size of decoded repair symbol */
|
||||
_UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
void* context_4_callback);
|
||||
|
||||
#ifdef OF_USE_ENCODER
|
||||
/**
|
||||
* @fn of_status_t of_rs_build_repair_symbol (of_rs_cb_t* ofcb, void* encoding_symbols_tab[], UINT32 esi_of_symbol_to_build)
|
||||
* @fn of_status_t of_rs_build_repair_symbol (of_rs_cb_t* ofcb, void* encoding_symbols_tab[], _UINT32 esi_of_symbol_to_build)
|
||||
* @brief build a repair symbol (encoder only)
|
||||
* @param ofcb (IN) Pointer to the session.
|
||||
* @param encoding_symbols_tab (IN/OUT) table of source and repair symbols.
|
||||
@@ -192,12 +192,12 @@ of_status_t of_rs_set_callback_functions (of_rs_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_rs_build_repair_symbol (of_rs_cb_t* ofcb,
|
||||
void* encoding_symbols_tab[],
|
||||
UINT32 esi_of_symbol_to_build);
|
||||
_UINT32 esi_of_symbol_to_build);
|
||||
#endif //OF_USE_ENCODER
|
||||
|
||||
#ifdef OF_USE_DECODER
|
||||
/**
|
||||
* @fn of_status_t of_rs_decode_with_new_symbol (of_rs_cb_t* ofcb, void* const new_symbol_buf, UINT32 new_symbol_esi)
|
||||
* @fn of_status_t of_rs_decode_with_new_symbol (of_rs_cb_t* ofcb, void* const new_symbol_buf, _UINT32 new_symbol_esi)
|
||||
* @brief (try to) decode with a newly received symbol
|
||||
* @param ofcb (IN) Pointer to the session.
|
||||
* @param new_symbol (IN) Pointer to the encoding symbol now available (i.e. a new
|
||||
@@ -208,7 +208,7 @@ of_status_t of_rs_build_repair_symbol (of_rs_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_rs_decode_with_new_symbol (of_rs_cb_t* ofcb,
|
||||
void* new_symbol,
|
||||
UINT32 new_symbol_esi);
|
||||
_UINT32 new_symbol_esi);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_set_available_symbols (of_rs_cb_t* ofcb, void* const encoding_symbols_tab[]);
|
||||
@@ -256,7 +256,7 @@ of_status_t of_rs_get_source_symbols_tab (of_rs_cb_t* ofcb,
|
||||
#endif //OF_USE_DECODER
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_set_control_parameter (of_rs_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
|
||||
* @fn of_status_t of_rs_set_control_parameter (of_rs_cb_t* ofcb,_UINT32 type,void* value,_UINT32 length)
|
||||
* @brief set a specific FEC parameter
|
||||
* @param ofcb (IN) Pointer to the session.
|
||||
* @param type (IN) Type of parameter. This type is FEC codec ID specific.
|
||||
@@ -266,12 +266,12 @@ of_status_t of_rs_get_source_symbols_tab (of_rs_cb_t* ofcb,
|
||||
* @return Error status.
|
||||
*/
|
||||
of_status_t of_rs_set_control_parameter (of_rs_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length);
|
||||
_UINT32 length);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
|
||||
* @fn of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb,_UINT32 type,void* value,_UINT32 length)
|
||||
* @brief get a specific FEC parameter
|
||||
* @param ofcb (IN) Pointer to the session.
|
||||
* @param type (IN) Type of parameter. This type is FEC codec ID specific.
|
||||
@@ -283,9 +283,9 @@ of_status_t of_rs_set_control_parameter (of_rs_cb_t* ofcb,
|
||||
* @return Error status.
|
||||
*/
|
||||
of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length);
|
||||
_UINT32 length);
|
||||
|
||||
|
||||
/*
|
||||
@@ -294,7 +294,7 @@ of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb,
|
||||
|
||||
void of_rs_free (void *p) ;
|
||||
|
||||
void * of_rs_new (UINT32 k, UINT32 n) ;
|
||||
void * of_rs_new (_UINT32 k, _UINT32 n) ;
|
||||
|
||||
void of_rs_init (void) ;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
|
||||
bool of_rs_is_source_symbol (of_rs_cb_t* ofcb,
|
||||
UINT32 new_symbol_esi)
|
||||
_UINT32 new_symbol_esi)
|
||||
{
|
||||
if (new_symbol_esi < ofcb->nb_source_symbols)
|
||||
return true;
|
||||
@@ -47,7 +47,7 @@ bool of_rs_is_source_symbol (of_rs_cb_t* ofcb,
|
||||
|
||||
|
||||
bool of_rs_is_repair_symbol (of_rs_cb_t* ofcb,
|
||||
UINT32 new_symbol_esi)
|
||||
_UINT32 new_symbol_esi)
|
||||
{
|
||||
if (new_symbol_esi < ofcb->nb_source_symbols)
|
||||
return false;
|
||||
@@ -80,7 +80,7 @@ of_status_t of_rs_create_codec_instance (of_rs_cb_t** of_cb)
|
||||
of_status_t of_rs_release_codec_instance (of_rs_cb_t* ofcb)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
UINT32 i;
|
||||
_UINT32 i;
|
||||
if (ofcb->rs_cb != NULL)
|
||||
{
|
||||
of_rs_free (ofcb->rs_cb);
|
||||
@@ -127,11 +127,11 @@ error:
|
||||
|
||||
of_status_t of_rs_set_callback_functions (of_rs_cb_t* ofcb,
|
||||
void* (*decoded_source_symbol_callback) (void *context,
|
||||
UINT32 size, /* size of decoded source symbol */
|
||||
UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
_UINT32 size, /* size of decoded source symbol */
|
||||
_UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
void* (*decoded_repair_symbol_callback) (void *context,
|
||||
UINT32 size, /* size of decoded repair symbol */
|
||||
UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
_UINT32 size, /* size of decoded repair symbol */
|
||||
_UINT32 esi), /* encoding symbol ID in {0..k-1} */
|
||||
void* context_4_callback)
|
||||
{
|
||||
ofcb->decoded_source_symbol_callback = decoded_source_symbol_callback;
|
||||
@@ -148,7 +148,7 @@ of_status_t of_rs_set_callback_functions (of_rs_cb_t* ofcb,
|
||||
#ifdef OF_USE_ENCODER
|
||||
of_status_t of_rs_build_repair_symbol (of_rs_cb_t* ofcb,
|
||||
void* encoding_symbols_tab[],
|
||||
UINT32 esi_of_symbol_to_build)
|
||||
_UINT32 esi_of_symbol_to_build)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
if (esi_of_symbol_to_build < ofcb->nb_source_symbols || esi_of_symbol_to_build >= ofcb->nb_encoding_symbols)
|
||||
@@ -198,7 +198,7 @@ error:
|
||||
#ifdef OF_USE_DECODER
|
||||
of_status_t of_rs_decode_with_new_symbol (of_rs_cb_t* ofcb,
|
||||
void* new_symbol,
|
||||
UINT32 new_symbol_esi)
|
||||
_UINT32 new_symbol_esi)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
if (ofcb->decoding_finished)
|
||||
@@ -255,7 +255,7 @@ error:
|
||||
of_status_t of_rs_set_available_symbols (of_rs_cb_t* ofcb,
|
||||
void* const encoding_symbols_tab[])
|
||||
{
|
||||
UINT32 i;
|
||||
_UINT32 i;
|
||||
|
||||
OF_ENTER_FUNCTION
|
||||
ofcb->nb_available_symbols = 0;
|
||||
@@ -279,22 +279,22 @@ of_status_t of_rs_set_available_symbols (of_rs_cb_t* ofcb,
|
||||
|
||||
of_status_t of_rs_finish_decoding (of_rs_cb_t* ofcb)
|
||||
{
|
||||
UINT32 k;
|
||||
UINT32 n;
|
||||
_UINT32 k;
|
||||
_UINT32 n;
|
||||
char *tmp_buf[GF_SIZE]; /* copy available source/repair symbol buffers here... */
|
||||
int tmp_esi[GF_SIZE]; /* ...and their esi here. In fact we only need k entries
|
||||
* in these tables, but in order to avoid using malloc (time
|
||||
* consumming), we use an automatic table of maximum size for
|
||||
* both tmp_buf[] and tmp_esi[]. */
|
||||
INT32 tmp_idx; /* index in tmp_buf[] and tmp_esi[] tabs */
|
||||
_INT32 tmp_idx; /* index in tmp_buf[] and tmp_esi[] tabs */
|
||||
char *large_buf = NULL; /* single large buffer where to copy all source/repair symbols */
|
||||
UINT32 off; /* offset, in unit of characters, in large_buf */
|
||||
_UINT32 off; /* offset, in unit of characters, in large_buf */
|
||||
void **ass_buf; /* tmp pointer to the current source symbol entry in
|
||||
* available_symbols_tab[] */
|
||||
UINT32 ass_esi; /* corresponding available source symbol ESI */
|
||||
_UINT32 ass_esi; /* corresponding available source symbol ESI */
|
||||
void **ars_buf; /* tmp pointer to the current repair symbol entry in
|
||||
* available_symbols_tab[] */
|
||||
UINT32 ars_esi; /* corresponding available repair symbol ESI */
|
||||
_UINT32 ars_esi; /* corresponding available repair symbol ESI */
|
||||
|
||||
OF_ENTER_FUNCTION
|
||||
if (ofcb->decoding_finished)
|
||||
@@ -460,7 +460,7 @@ of_status_t of_rs_get_source_symbols_tab (of_rs_cb_t* ofcb,
|
||||
return OF_STATUS_ERROR;
|
||||
}
|
||||
#if 0
|
||||
UINT32 i;
|
||||
_UINT32 i;
|
||||
for (i = 0; i < ofcb->nb_source_symbols; i++)
|
||||
{
|
||||
if (source_symbols_tab[i] == NULL)
|
||||
@@ -479,9 +479,9 @@ of_status_t of_rs_get_source_symbols_tab (of_rs_cb_t* ofcb,
|
||||
#endif //OF_USE_DECODER
|
||||
|
||||
of_status_t of_rs_set_control_parameter (of_rs_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length)
|
||||
_UINT32 length)
|
||||
{
|
||||
OF_PRINT_ERROR(("of_rs_set_control_parameter: ERROR, not implemented...\n"))
|
||||
return OF_STATUS_ERROR;
|
||||
@@ -489,30 +489,30 @@ of_status_t of_rs_set_control_parameter (of_rs_cb_t* ofcb,
|
||||
|
||||
|
||||
of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length)
|
||||
_UINT32 length)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
switch (type) {
|
||||
case OF_CTRL_GET_MAX_K:
|
||||
if (value == NULL || length != sizeof(UINT32)) {
|
||||
if (value == NULL || length != sizeof(_UINT32)) {
|
||||
OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %zu)\n",
|
||||
__FUNCTION__, length, sizeof(UINT32)))
|
||||
__FUNCTION__, length, sizeof(_UINT32)))
|
||||
goto error;
|
||||
}
|
||||
*(UINT32*)value = ofcb->max_nb_source_symbols;
|
||||
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_K (%d)\n", __FUNCTION__, *(UINT32*)value))
|
||||
*(_UINT32*)value = ofcb->max_nb_source_symbols;
|
||||
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_K (%d)\n", __FUNCTION__, *(_UINT32*)value))
|
||||
break;
|
||||
|
||||
case OF_CTRL_GET_MAX_N:
|
||||
if (value == NULL || length != sizeof(UINT32)) {
|
||||
if (value == NULL || length != sizeof(_UINT32)) {
|
||||
OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n",
|
||||
__FUNCTION__, length, sizeof(UINT32)))
|
||||
__FUNCTION__, length, sizeof(_UINT32)))
|
||||
goto error;
|
||||
}
|
||||
*(UINT32*)value = ofcb->max_nb_encoding_symbols;
|
||||
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_N (%d)\n", __FUNCTION__, *(UINT32*)value))
|
||||
*(_UINT32*)value = ofcb->max_nb_encoding_symbols;
|
||||
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_N (%d)\n", __FUNCTION__, *(_UINT32*)value))
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
*/
|
||||
typedef struct of_rs_parameters
|
||||
{
|
||||
UINT32 nb_source_symbols; /* must be 1st item */
|
||||
UINT32 nb_repair_symbols; /* must be 2nd item */
|
||||
UINT32 encoding_symbol_length; /* must be 3rd item */
|
||||
_UINT32 nb_source_symbols; /* must be 1st item */
|
||||
_UINT32 nb_repair_symbols; /* must be 2nd item */
|
||||
_UINT32 encoding_symbol_length; /* must be 3rd item */
|
||||
/*
|
||||
* FEC codec id specific attributes follow...
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user