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

@@ -41,7 +41,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

View File

@@ -83,7 +83,7 @@ of_status_t of_ldpc_ff_set_fec_parameters (of_ldpc_ff_cb_t* cb,
#ifdef OF_USE_ENCODER
/**
* @fn of_status_t of_ldpc_ff_build_repair_symbol (of_ldpc_ff_cb_t* ofcb, void* encoding_symbols_tab[], UINT32 esi_of_symbol_to_build)
* @fn of_status_t of_ldpc_ff_build_repair_symbol (of_ldpc_ff_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.
@@ -97,12 +97,12 @@ of_status_t of_ldpc_ff_set_fec_parameters (of_ldpc_ff_cb_t* cb,
*/
of_status_t of_ldpc_ff_build_repair_symbol (of_ldpc_ff_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_ldpc_ff_set_control_parameter (of_ldpc_ff_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
* @fn of_status_t of_ldpc_ff_set_control_parameter (of_ldpc_ff_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.
@@ -111,12 +111,12 @@ of_status_t of_ldpc_ff_build_repair_symbol (of_ldpc_ff_cb_t* ofcb,
* @return Error status.
*/
of_status_t of_ldpc_ff_set_control_parameter (of_ldpc_ff_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length);
_UINT32 length);
/**
* @fn of_status_t of_ldpc_ff_get_control_parameter (of_ldpc_ff_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
* @fn of_status_t of_ldpc_ff_get_control_parameter (of_ldpc_ff_cb_t* ofcb,_UINT32 type,void* value,_UINT32 length)
* @brief get a specific FEC parameter
* @param ses (IN) Pointer to the session.
* @param type (IN) Type of parameter. This type is FEC codec ID specific.
@@ -127,16 +127,16 @@ of_status_t of_ldpc_ff_set_control_parameter (of_ldpc_ff_cb_t* ofcb,
* @return Error status.
*/
of_status_t of_ldpc_ff_get_control_parameter (of_ldpc_ff_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length);
_UINT32 length);
#endif //OF_USE_DECODER
/**
* This function return the number of rows and cols of a matrix read into matrix_file.
*
* @fn of_status_t of_get_pck_matrix_dimensions_from_file(char * matrix_file,UINT32 * n_rows, UINT32 *n_cols)
* @fn of_status_t of_get_pck_matrix_dimensions_from_file(char * matrix_file,_UINT32 * n_rows, _UINT32 *n_cols)
* @brief return the number of rows and cols of a matrix
* @param matrix_file (IN) name of the file containing the matrix
* @param n_rows (OUT) number of rows in matrix
@@ -144,8 +144,8 @@ of_status_t of_ldpc_ff_get_control_parameter (of_ldpc_ff_cb_t* ofcb,
* @return Error status. If it's OK, nb_row and nb_col contain the number of rows and cols of matrix.
*/
of_status_t of_get_pck_matrix_dimensions_from_file (char* matrix_file,
UINT32 * n_rows,
UINT32 * n_cols);
_UINT32 * n_rows,
_UINT32 * n_cols);
#endif //OF_LDPC_FF_H

View File

@@ -63,12 +63,12 @@ of_status_t of_ldpc_ff_set_fec_parameters (of_ldpc_ff_cb_t* cb,
of_ldpc_ff_parameters_t* params)
{
of_mod2entry *e;
UINT32 row;
UINT32 seq;
UINT32 matrix_nb_par;
UINT32 matrix_nb_src;
UINT32 *p_matrix_nb_par;
UINT32 *p_matrix_nb_src;
_UINT32 row;
_UINT32 seq;
_UINT32 matrix_nb_par;
_UINT32 matrix_nb_src;
_UINT32 *p_matrix_nb_par;
_UINT32 *p_matrix_nb_src;
char * m_matrix_file;
FILE *pFile;
@@ -133,10 +133,10 @@ of_status_t of_ldpc_ff_set_fec_parameters (of_ldpc_ff_cb_t* cb,
#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;
@@ -191,7 +191,7 @@ error:
of_status_t of_ldpc_ff_build_repair_symbol (of_ldpc_ff_cb_t* ofcb,
void* encoding_symbols_tab[],
UINT32 esi_of_symbol_to_build)
_UINT32 esi_of_symbol_to_build)
{
if (ofcb->H2_is_identity_with_lower_triangle)
{
@@ -208,9 +208,9 @@ of_status_t of_ldpc_ff_build_repair_symbol (of_ldpc_ff_cb_t* ofcb,
of_status_t of_ldpc_ff_set_control_parameter (of_ldpc_ff_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length)
_UINT32 length)
{
OF_PRINT_ERROR(("of_ldpc_ff_set_control_parameter: ERROR, not implemented...\n"))
return OF_STATUS_ERROR;
@@ -218,9 +218,9 @@ of_status_t of_ldpc_ff_set_control_parameter (of_ldpc_ff_cb_t* ofcb,
of_status_t of_ldpc_ff_get_control_parameter (of_ldpc_ff_cb_t* ofcb,
UINT32 type,
_UINT32 type,
void* value,
UINT32 length)
_UINT32 length)
{
of_ldpc_staircase_cb_t *ofcb_staircase;
@@ -228,23 +228,23 @@ of_status_t of_ldpc_ff_get_control_parameter (of_ldpc_ff_cb_t* ofcb,
ofcb_staircase = (of_ldpc_staircase_cb_t*)ofcb;
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 %ld)\n",
__FUNCTION__, length, sizeof(UINT32)))
__FUNCTION__, length, sizeof(_UINT32)))
goto error;
}
*(UINT32*)value = ofcb_staircase->max_nb_source_symbols;
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_K (%d)\n", __FUNCTION__, *(UINT32*)value))
*(_UINT32*)value = ofcb_staircase->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 %ld)\n",
__FUNCTION__, length, sizeof(UINT32)))
__FUNCTION__, length, sizeof(_UINT32)))
goto error;
}
*(UINT32*)value = ofcb_staircase->max_nb_encoding_symbols;
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_N (%d)\n", __FUNCTION__, *(UINT32*)value))
*(_UINT32*)value = ofcb_staircase->max_nb_encoding_symbols;
OF_TRACE_LVL(1, ("%s: OF_CTRL_GET_MAX_N (%d)\n", __FUNCTION__, *(_UINT32*)value))
break;
default:
@@ -260,7 +260,7 @@ error:
}
of_status_t of_get_pck_matrix_dimensions_from_file(char * matrix_file,UINT32 * n_rows, UINT32 *n_cols){
of_status_t of_get_pck_matrix_dimensions_from_file(char * matrix_file,_UINT32 * n_rows, _UINT32 *n_cols){
FILE * f;
char * pch;

View File

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