Fix OpenFEC compile error on Windows platform

This commit is contained in:
dijunkun
2023-11-14 16:11:57 +08:00
parent 270ad8df43
commit e410e4e0c4
54 changed files with 1346 additions and 1245 deletions

View File

@@ -38,8 +38,8 @@
typedef struct of_2d_symbol_stats_op
{
UINT32 nb_xor_for_IT;
UINT32 nb_xor_for_ML;
_UINT32 nb_xor_for_IT;
_UINT32 nb_xor_for_ML;
} of_2d_symbol_stats_op_t;
/**
@@ -56,12 +56,12 @@ typedef struct of_2d_parity_cb
************************************************************************** */
of_codec_id_t codec_id; /* must begin with fec_codec_id * */
of_codec_type_t codec_type; /* must be 2nd item * */
UINT32 nb_source_symbols; /** k parameter (AKA code dimension).* */
UINT32 nb_repair_symbols; /** r = n - k parameter. * */
UINT32 encoding_symbol_length; /** symbol length. * */
_UINT32 nb_source_symbols; /** k parameter (AKA code dimension).* */
_UINT32 nb_repair_symbols; /** r = n - k parameter. * */
_UINT32 encoding_symbol_length; /** symbol length. * */
/************************************************************************* */
UINT32 nb_total_symbols; /** n parameter (AKA code length). */
_UINT32 nb_total_symbols; /** n parameter (AKA code length). */
/* parity check matrix */
of_mod2sparse* pchk_matrix;
@@ -71,21 +71,21 @@ typedef struct of_2d_parity_cb
#ifdef OF_DEBUG
of_symbols_stats_t* stats_symbols;
#endif
UINT32 nb_source_symbol_ready; // Number of source symbols ready
UINT32 nb_repair_symbol_ready; // Number of parity symbols ready
_UINT32 nb_source_symbol_ready; // Number of source symbols ready
_UINT32 nb_repair_symbol_ready; // Number of parity symbols ready
#ifdef ML_DECODING /* { */
UINT32 *index_rows; // Indirection index to access initial m_chekValues array
UINT32 *index_cols; // Indirection index to access initial symbol array
UINT32 remain_cols; // Nb of non empty remaining cols in the future simplified matrix
UINT32 remain_rows; // Nb of non empty remaining rows in the future simplified matrix
_UINT32 *index_rows; // Indirection index to access initial m_chekValues array
_UINT32 *index_cols; // Indirection index to access initial symbol array
_UINT32 remain_cols; // Nb of non empty remaining cols in the future simplified matrix
_UINT32 remain_rows; // Nb of non empty remaining rows in the future simplified matrix
of_mod2sparse *pchk_matrix_simplified; // Simplified Parity Check Matrix in sparse mode format
of_mod2sparse *original_pchkMatrix;
of_mod2sparse* pchk_matrix_gauss; // Parity Check matrix in sparse mode format.
// This matrix is also used as a generator matrix
UINT32 dec_step; // Current step in the Gauss decoding algorithm
UINT32 threshold_simplification; // threshold (number of symbols) above which we
_UINT32 dec_step; // Current step in the Gauss decoding algorithm
_UINT32 threshold_simplification; // threshold (number of symbols) above which we
// run the Gaussian Elimination algorithm
#endif /* } ML_DECODING */
@@ -93,12 +93,12 @@ typedef struct of_2d_parity_cb
/** table of all check values, i.e. that contain the constant term of each equation. */
void** tab_const_term_of_equ;
/** table containing the number of encoding symbols of each equation. */
UINT16* tab_nb_enc_symbols_per_equ;
_UINT16* tab_nb_enc_symbols_per_equ;
/** table containing the number of unknow symbols (i.e. neither received nor decoded
* at that time) of each equation. */
UINT16* tab_nb_unknown_symbols;
_UINT16* tab_nb_unknown_symbols;
/** table containing the number of equations in which a repair symbol is included. */
UINT16* tab_nb_equ_for_repair;
_UINT16* tab_nb_equ_for_repair;
void** repair_symbols_values;
#endif /* } OF_USE_DECODER */
@@ -107,22 +107,22 @@ typedef struct of_2d_parity_cb
/** callbacks registered by the application. */
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;/* */
/*****************************************************************************/
/** 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 max_nb_encoding_symbols;
/** ESI of first non decoded source symbol.
* Used by is_decoding_complete function. */
UINT32 first_non_decoded;
_UINT32 first_non_decoded;
} of_2d_parity_cb_t;
@@ -171,8 +171,8 @@ of_status_t of_2d_parity_set_fec_parameters (of_2d_parity_cb_t* ofcb,
of_2d_parity_parameters_t* params);
/**
* @fn of_status_t of_2d_parity_set_callback_functions (of_2d_parity_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.
*
@@ -196,16 +196,16 @@ of_status_t of_2d_parity_set_fec_parameters (of_2d_parity_cb_t* ofcb,
*/
of_status_t of_2d_parity_set_callback_functions (of_2d_parity_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_2d_parity_build_repair_symbol (of_2d_parity_cb_t* ofcb, void* encoding_symbols_tab[], UINT32 esi_of_symbol_to_build)
* @fn of_status_t of_2d_parity_build_repair_symbol (of_2d_parity_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.
@@ -219,12 +219,12 @@ of_status_t of_2d_parity_set_callback_functions (of_2d_parity_cb_t* ofcb,
*/
of_status_t of_2d_parity_build_repair_symbol (of_2d_parity_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_2d_parity_decode_with_new_symbol (of_2d_parity_cb_t* ofcb, void* const new_symbol_buf, UINT32 new_symbol_esi)
* @fn of_status_t of_2d_parity_decode_with_new_symbol (of_2d_parity_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
@@ -235,7 +235,7 @@ of_status_t of_2d_parity_build_repair_symbol (of_2d_parity_cb_t* ofcb,
*/
of_status_t of_2d_parity_decode_with_new_symbol (of_2d_parity_cb_t* ofcb,
void* new_symbol,
UINT32 new_symbol_esi);
_UINT32 new_symbol_esi);
/**
* @fn of_status_t of_2d_parity_set_available_symbols (of_2d_parity_cb_t* ofcb, void* const encoding_symbols_tab[]);
@@ -281,7 +281,7 @@ of_status_t of_2d_parity_get_source_symbols_tab (of_2d_parity_cb_t* ofcb,
void* source_symbols_tab[]);
/**
* @fn of_status_t of_2d_parity_set_control_parameter (of_2d_parity_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
* @fn of_status_t of_2d_parity_set_control_parameter (of_2d_parity_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.
@@ -291,12 +291,12 @@ of_status_t of_2d_parity_get_source_symbols_tab (of_2d_parity_cb_t* ofcb,
* @return Error status.
*/
of_status_t of_2d_parity_set_control_parameter(of_2d_parity_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length);
_UINT32 length);
/**
* @fn of_status_t of_2d_parity_get_control_parameter (of_2d_parity_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
* @fn of_status_t of_2d_parity_get_control_parameter (of_2d_parity_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.
@@ -308,9 +308,9 @@ of_status_t of_2d_parity_set_control_parameter(of_2d_parity_cb_t* ofcb,
* @return Error status.
*/
of_status_t of_2d_parity_get_control_parameter(of_2d_parity_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length);
_UINT32 length);
#endif //OF_USE_DECODER

View File

@@ -60,7 +60,7 @@ of_status_t of_2d_parity_create_codec_instance (of_2d_parity_cb_t** of_cb)
of_status_t of_2d_parity_release_codec_instance (of_2d_parity_cb_t* ofcb)
{
UINT32 i;
_UINT32 i;
OF_ENTER_FUNCTION
if (ofcb->pchk_matrix != NULL)
@@ -161,8 +161,8 @@ of_status_t of_2d_parity_set_fec_parameters (of_2d_parity_cb_t* ofcb,
of_2d_parity_parameters_t* params)
{
of_mod2entry *e;
UINT32 row;
UINT32 seq;
_UINT32 row;
_UINT32 seq;
OF_ENTER_FUNCTION
@@ -210,14 +210,14 @@ of_status_t of_2d_parity_set_fec_parameters (of_2d_parity_cb_t* ofcb,
#ifdef OF_USE_DECODER
if (ofcb->codec_type & OF_DECODER)
{
ofcb->tab_nb_unknown_symbols = (UINT16*)
of_calloc (ofcb->nb_repair_symbols, sizeof (UINT16));
ofcb->tab_nb_unknown_symbols = (_UINT16*)
of_calloc (ofcb->nb_repair_symbols, sizeof (_UINT16));
ofcb->tab_const_term_of_equ = (void**)
of_calloc (ofcb->nb_repair_symbols, sizeof (void*));
ofcb->tab_nb_equ_for_repair = (UINT16*)
of_calloc (ofcb->nb_repair_symbols, sizeof (UINT16));
ofcb->tab_nb_enc_symbols_per_equ = (UINT16*)
of_calloc (ofcb->nb_repair_symbols, sizeof (UINT16));
ofcb->tab_nb_equ_for_repair = (_UINT16*)
of_calloc (ofcb->nb_repair_symbols, sizeof (_UINT16));
ofcb->tab_nb_enc_symbols_per_equ = (_UINT16*)
of_calloc (ofcb->nb_repair_symbols, sizeof (_UINT16));
if (ofcb->tab_nb_unknown_symbols == NULL || ofcb->tab_const_term_of_equ == NULL ||
ofcb->tab_nb_equ_for_repair == NULL || ofcb->tab_nb_enc_symbols_per_equ == NULL) {
goto no_mem;
@@ -275,12 +275,12 @@ of_status_t of_2d_parity_set_callback_functions (
of_2d_parity_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 {k..n-1} */
_UINT32 size, /* size of decoded repair symbol */
_UINT32 esi), /* encoding symbol ID in {k..n-1} */
void* context_4_callback)
{
OF_ENTER_FUNCTION
@@ -295,11 +295,11 @@ of_status_t of_2d_parity_set_callback_functions (
of_status_t of_2d_parity_build_repair_symbol (of_2d_parity_cb_t* ofcb,
void* encoding_symbols_tab[],
UINT32 esi_of_symbol_to_build)
_UINT32 esi_of_symbol_to_build)
{
of_mod2entry *e;
UINT32 col_to_build;
UINT32 esi;
_UINT32 col_to_build;
_UINT32 esi;
void *to_add_buf;
void *parity_symbol;
OF_ENTER_FUNCTION
@@ -348,7 +348,7 @@ error:
of_status_t of_2d_parity_decode_with_new_symbol (of_2d_parity_cb_t* ofcb,
void* new_symbol,
UINT32 new_symbol_esi)
_UINT32 new_symbol_esi)
{
OF_ENTER_FUNCTION
return of_linear_binary_code_decode_with_new_symbol((of_linear_binary_code_cb_t*)ofcb,new_symbol,new_symbol_esi);
@@ -359,7 +359,7 @@ of_status_t of_2d_parity_set_available_symbols (of_2d_parity_cb_t* ofcb,
void* const encoding_symbols_tab[])
{
OF_ENTER_FUNCTION
UINT32 i;
_UINT32 i;
for (i = 0; i < ofcb->nb_total_symbols; i++)
{
if (encoding_symbols_tab[i] != NULL)
@@ -413,9 +413,9 @@ of_status_t of_2d_parity_get_source_symbols_tab(of_2d_parity_cb_t* ofcb,
#endif //OF_USE_DECODER
of_status_t of_2d_parity_set_control_parameter (of_2d_parity_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length)
_UINT32 length)
{
OF_PRINT_ERROR(("of_2d_parity_set_control_parameter: ERROR, not implemented...\n"))
return OF_STATUS_ERROR;
@@ -423,30 +423,30 @@ of_status_t of_2d_parity_set_control_parameter (of_2d_parity_cb_t* ofcb,
of_status_t of_2d_parity_get_control_parameter (of_2d_parity_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:

View File

@@ -48,9 +48,9 @@
*/
typedef struct of_2d_parity_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...
*/

View File

@@ -92,7 +92,7 @@
* Default maximum number of source and encoding symbols for this codec.
* This value depends in particular on the kind of decoder used. 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...).
*
* Hints:
* If ML decoding is enabled and used, then limit yourself to a value