mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 12:45:35 +08:00
Fix OpenFEC compile error on Windows platform
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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...
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -79,7 +79,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
|
||||
|
||||
@@ -45,12 +45,12 @@ typedef struct of_ldpc_staircase_cb
|
||||
/****** of_cb part { **************************************************/
|
||||
of_codec_id_t codec_id;
|
||||
of_codec_type_t codec_type;
|
||||
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. */
|
||||
/****** } of_cb part **************************************************/
|
||||
|
||||
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;
|
||||
@@ -60,20 +60,20 @@ typedef struct of_ldpc_staircase_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.
|
||||
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 */
|
||||
|
||||
@@ -81,43 +81,43 @@ typedef struct of_ldpc_staircase_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;
|
||||
void** tmp_tab_symbols;
|
||||
UINT16 nb_tmp_symbols;
|
||||
_UINT16 nb_tmp_symbols;
|
||||
#endif /* } OF_USE_DECODER */
|
||||
|
||||
void **encoding_symbols_tab;
|
||||
|
||||
/** 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;
|
||||
|
||||
/****** } of_linear_binary_code_cb part *******************************/
|
||||
|
||||
/** 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;
|
||||
/** Seed used to build this code. */
|
||||
UINT32 prng_seed;
|
||||
_UINT32 prng_seed;
|
||||
/** Target number or "1s" per column for H1 (see RFC5170). */
|
||||
UINT8 N1;
|
||||
_UINT8 N1;
|
||||
/** During H1 creation, have extra entries been added per row to make the row hamming weight at least two? */
|
||||
bool extra_entries_added_in_pchk;
|
||||
/** ESI of first non decoded source symbol. Used by is_decoding_complete function. */
|
||||
UINT32 first_non_decoded;
|
||||
_UINT32 first_non_decoded;
|
||||
} of_ldpc_staircase_cb_t;
|
||||
|
||||
|
||||
@@ -165,8 +165,8 @@ of_status_t of_ldpc_staircase_set_fec_parameters (of_ldpc_staircase_cb_t* ofcb,
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_ldpc_staircase_set_callback_functions (of_ldpc_staircase_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.
|
||||
*
|
||||
@@ -190,16 +190,16 @@ of_status_t of_ldpc_staircase_set_fec_parameters (of_ldpc_staircase_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_ldpc_staircase_set_callback_functions (of_ldpc_staircase_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_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_cb_t* ofcb, void* encoding_symbols_tab[], UINT32 esi_of_symbol_to_build)
|
||||
* @fn of_status_t of_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_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.
|
||||
@@ -213,12 +213,12 @@ of_status_t of_ldpc_staircase_set_callback_functions (of_ldpc_staircase_cb_t* o
|
||||
*/
|
||||
of_status_t of_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_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_staircase_decode_with_new_symbol (of_ldpc_staircase_cb_t* ofcb, void* const new_symbol_buf, UINT32 new_symbol_esi)
|
||||
* @fn of_status_t of_ldpc_staircase_decode_with_new_symbol (of_ldpc_staircase_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
|
||||
@@ -229,7 +229,7 @@ of_status_t of_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_cb_t* ofcb
|
||||
*/
|
||||
of_status_t of_ldpc_staircase_decode_with_new_symbol (of_ldpc_staircase_cb_t* ofcb,
|
||||
void* new_symbol,
|
||||
UINT32 new_symbol_esi);
|
||||
_UINT32 new_symbol_esi);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_ldpc_staircase_set_available_symbols (of_ldpc_staircase_cb_t* ofcb, void* const encoding_symbols_tab[]);
|
||||
@@ -275,7 +275,7 @@ of_status_t of_ldpc_staircase_get_source_symbols_tab (of_ldpc_staircase_cb_t* of
|
||||
void* source_symbols_tab[]);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_ldpc_staircase_set_control_parameter (of_ldpc_staircase_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
|
||||
* @fn of_status_t of_ldpc_staircase_set_control_parameter (of_ldpc_staircase_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.
|
||||
@@ -285,12 +285,12 @@ of_status_t of_ldpc_staircase_get_source_symbols_tab (of_ldpc_staircase_cb_t* of
|
||||
* @return Error status.
|
||||
*/
|
||||
of_status_t of_ldpc_staircase_set_control_parameter(of_ldpc_staircase_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length);
|
||||
_UINT32 length);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_ldpc_staircase_get_control_parameter (of_ldpc_staircase_cb_t* ofcb, UINT32 type, void* value, UINT32 length)
|
||||
* @fn of_status_t of_ldpc_staircase_get_control_parameter (of_ldpc_staircase_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.
|
||||
@@ -302,9 +302,9 @@ of_status_t of_ldpc_staircase_set_control_parameter(of_ldpc_staircase_cb_t* ofcb
|
||||
* @return Error status.
|
||||
*/
|
||||
of_status_t of_ldpc_staircase_get_control_parameter(of_ldpc_staircase_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length);
|
||||
_UINT32 length);
|
||||
|
||||
/**
|
||||
* @brief Create the LDPC-Staircase matrix as defined in RFC 5170.
|
||||
@@ -315,10 +315,10 @@ of_status_t of_ldpc_staircase_get_control_parameter(of_ldpc_staircase_cb_t* ofcb
|
||||
* @param ofcb (IN/OUT)
|
||||
* @return pointer to the parity check matrix that has just been allocated and initialized.
|
||||
*/
|
||||
of_mod2sparse* of_create_pchck_matrix_rfc5170_compliant (UINT32 nb_rows,
|
||||
UINT32 nb_cols,
|
||||
UINT32 left_degree,
|
||||
UINT32 seed,
|
||||
of_mod2sparse* of_create_pchck_matrix_rfc5170_compliant (_UINT32 nb_rows,
|
||||
_UINT32 nb_cols,
|
||||
_UINT32 left_degree,
|
||||
_UINT32 seed,
|
||||
of_ldpc_staircase_cb_t *ofcb);
|
||||
|
||||
#endif //OF_USE_DECODER
|
||||
|
||||
@@ -59,7 +59,7 @@ of_status_t of_ldpc_staircase_create_codec_instance (of_ldpc_staircase_cb_t** of
|
||||
of_status_t of_ldpc_staircase_release_codec_instance (of_ldpc_staircase_cb_t* ofcb)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
UINT32 i;
|
||||
_UINT32 i;
|
||||
if (ofcb->pchk_matrix != NULL)
|
||||
{
|
||||
of_mod2sparse_free(ofcb->pchk_matrix);
|
||||
@@ -167,8 +167,8 @@ of_status_t of_ldpc_staircase_set_fec_parameters (of_ldpc_staircase_cb_t* ofcb,
|
||||
of_ldpc_parameters_t* params)
|
||||
{
|
||||
of_mod2entry *e;
|
||||
UINT32 row;
|
||||
UINT32 seq;
|
||||
_UINT32 row;
|
||||
_UINT32 seq;
|
||||
|
||||
OF_ENTER_FUNCTION
|
||||
|
||||
@@ -191,7 +191,7 @@ of_status_t of_ldpc_staircase_set_fec_parameters (of_ldpc_staircase_cb_t* ofcb,
|
||||
if ((ofcb->nb_repair_symbols = params->nb_repair_symbols) > ofcb->max_nb_encoding_symbols)
|
||||
{
|
||||
/* this test is needed because if the number of repair symbols is
|
||||
* erroneously < 0, because we are using UINT32, this is transformed
|
||||
* erroneously < 0, because we are using _UINT32, this is transformed
|
||||
* into a very large integer, which, when added to k, wraps once again
|
||||
* and the test on nb_total_symbols returns true... */
|
||||
OF_PRINT_ERROR(("of_ldpc_staircase_set_fec_parameters: ERROR, invalid number of repair symbols (got %d, maximum number of encoding symbols is %d)\n",
|
||||
@@ -256,14 +256,14 @@ of_status_t of_ldpc_staircase_set_fec_parameters (of_ldpc_staircase_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;
|
||||
@@ -355,11 +355,11 @@ error:
|
||||
|
||||
of_status_t of_ldpc_staircase_set_callback_functions (of_ldpc_staircase_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
|
||||
@@ -375,11 +375,11 @@ of_status_t of_ldpc_staircase_set_callback_functions (of_ldpc_staircase_cb_t* o
|
||||
|
||||
of_status_t of_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_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
|
||||
@@ -429,7 +429,7 @@ error:
|
||||
|
||||
of_status_t of_ldpc_staircase_decode_with_new_symbol (of_ldpc_staircase_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);
|
||||
@@ -439,7 +439,7 @@ of_status_t of_ldpc_staircase_decode_with_new_symbol (of_ldpc_staircase_cb_t* of
|
||||
of_status_t of_ldpc_staircase_set_available_symbols (of_ldpc_staircase_cb_t* ofcb,
|
||||
void* const encoding_symbols_tab[])
|
||||
{
|
||||
UINT32 i;
|
||||
_UINT32 i;
|
||||
|
||||
OF_ENTER_FUNCTION
|
||||
for (i = 0; i < ofcb->nb_total_symbols; i++)
|
||||
@@ -501,9 +501,9 @@ of_status_t of_ldpc_staircase_get_source_symbols_tab (of_ldpc_staircase_cb_t* of
|
||||
#endif //OF_USE_DECODER
|
||||
|
||||
of_status_t of_ldpc_staircase_set_control_parameter (of_ldpc_staircase_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length)
|
||||
_UINT32 length)
|
||||
{
|
||||
OF_PRINT_ERROR(("of_ldpc_staircase_set_control_parameter: ERROR, not implemented...\n"))
|
||||
return OF_STATUS_ERROR;
|
||||
@@ -511,30 +511,30 @@ of_status_t of_ldpc_staircase_set_control_parameter (of_ldpc_staircase_cb_t* of
|
||||
|
||||
|
||||
of_status_t of_ldpc_staircase_get_control_parameter (of_ldpc_staircase_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;
|
||||
|
||||
case OF_CRTL_LDPC_STAIRCASE_IS_LAST_SYMBOL_NULL:
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
*/
|
||||
typedef struct of_ldpc_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...
|
||||
*/
|
||||
INT32 prng_seed;
|
||||
UINT8 N1;
|
||||
_INT32 prng_seed;
|
||||
_UINT8 N1;
|
||||
} of_ldpc_parameters_t;
|
||||
|
||||
|
||||
|
||||
@@ -50,21 +50,21 @@
|
||||
|
||||
|
||||
/* RFC5170 compliant fonction. DO NOT MODIFY */
|
||||
of_mod2sparse* of_create_pchck_matrix_rfc5170_compliant (UINT32 nb_rows,
|
||||
UINT32 nb_cols,
|
||||
UINT32 left_degree,
|
||||
UINT32 seed,
|
||||
of_mod2sparse* of_create_pchck_matrix_rfc5170_compliant (_UINT32 nb_rows,
|
||||
_UINT32 nb_cols,
|
||||
_UINT32 left_degree,
|
||||
_UINT32 seed,
|
||||
of_ldpc_staircase_cb_t *ofcb)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
of_mod2entry *e;
|
||||
UINT32 added, uneven;
|
||||
INT32 i, j, k;
|
||||
INT32 t; /* left limit within the list of possible choices u[] */
|
||||
UINT32 *u; /* table used to have a homogeneous 1 distrib. */
|
||||
_UINT32 added, uneven;
|
||||
_INT32 i, j, k;
|
||||
_INT32 t; /* left limit within the list of possible choices u[] */
|
||||
_UINT32 *u; /* table used to have a homogeneous 1 distrib. */
|
||||
of_mod2sparse *pchkMatrix = NULL;
|
||||
UINT32 skipCols = 0; // avoid warning
|
||||
UINT32 nbDataCols = 0; // avoid warning
|
||||
_UINT32 skipCols = 0; // avoid warning
|
||||
_UINT32 nbDataCols = 0; // avoid warning
|
||||
|
||||
skipCols = nb_rows;
|
||||
nbDataCols = nb_cols - skipCols;
|
||||
@@ -80,7 +80,7 @@ of_mod2sparse* of_create_pchck_matrix_rfc5170_compliant (UINT32 nb_rows,
|
||||
pchkMatrix = of_mod2sparse_allocate (nb_rows, nb_cols);
|
||||
/* create the initial version of the parity check matrix. */
|
||||
/* evenboth make method only */
|
||||
u = (UINT32*) of_calloc (left_degree * nbDataCols, sizeof * u);
|
||||
u = (_UINT32*) of_calloc (left_degree * nbDataCols, sizeof * u);
|
||||
/* initialize a list of possible choices to guarantee a homogeneous "1" distribution */
|
||||
for (k = left_degree * nbDataCols - 1; k >= 0; k--)
|
||||
{
|
||||
|
||||
@@ -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...
|
||||
*/
|
||||
|
||||
@@ -61,11 +61,11 @@ void of_galois_field_2_4_addmul1(gf *dst1, gf *src1, gf c, int sz)
|
||||
register gf *dst = dst1, *src = src1 ;
|
||||
gf *lim = &dst[sz - UNROLL + 1] ;
|
||||
#if ((defined (__LP64__) || (__WORDSIZE == 64)) && !defined (OF_RS_2M_USE_32BITS))
|
||||
UINT64 tmp;
|
||||
UINT64 *dst_64 = (UINT64*)dst1;
|
||||
_UINT64 tmp;
|
||||
_UINT64 *dst_64 = (_UINT64*)dst1;
|
||||
#else
|
||||
UINT32 tmp;
|
||||
UINT32 *dst_32 = (UINT32*)dst1;
|
||||
_UINT32 tmp;
|
||||
_UINT32 *dst_32 = (_UINT32*)dst1;
|
||||
#endif
|
||||
GF_MULC0 (c) ;
|
||||
|
||||
@@ -74,32 +74,32 @@ void of_galois_field_2_4_addmul1(gf *dst1, gf *src1, gf c, int sz)
|
||||
{
|
||||
#if ((defined (__LP64__) || (__WORDSIZE == 64)) && !defined (OF_RS_2M_USE_32BITS))
|
||||
/* perform 64-bit operations for improved performances on 64-bit systems */
|
||||
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++;
|
||||
#else
|
||||
/* otherwise perform 32-bit operations on 32-bit systems */
|
||||
tmp = ((UINT32)__gf_mulc_[src[0]]) | ((UINT32)__gf_mulc_[src[1]]<<8) | ((UINT32)__gf_mulc_[src[2]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[3]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[0]]) | ((_UINT32)__gf_mulc_[src[1]]<<8) | ((_UINT32)__gf_mulc_[src[2]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[3]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[4]]) | ((UINT32)__gf_mulc_[src[5]]<<8) | ((UINT32)__gf_mulc_[src[6]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[7]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[4]]) | ((_UINT32)__gf_mulc_[src[5]]<<8) | ((_UINT32)__gf_mulc_[src[6]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[7]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[8]]) | ((UINT32)__gf_mulc_[src[9]]<<8) | ((UINT32)__gf_mulc_[src[10]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[11]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[8]]) | ((_UINT32)__gf_mulc_[src[9]]<<8) | ((_UINT32)__gf_mulc_[src[10]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[11]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[12]]) | ((UINT32)__gf_mulc_[src[13]]<<8) | ((UINT32)__gf_mulc_[src[14]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[15]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[12]]) | ((_UINT32)__gf_mulc_[src[13]]<<8) | ((_UINT32)__gf_mulc_[src[14]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[15]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
#endif
|
||||
@@ -129,11 +129,11 @@ void of_galois_field_2_4_addmul1_compact (gf *dst1, gf *src1, gf c, int
|
||||
register gf *dst = dst1, *src = src1 ;
|
||||
gf *lim = &dst[sz - UNROLL + 1] ;
|
||||
#if ((defined (__LP64__) || (__WORDSIZE == 64)) && !defined (OF_RS_2M_USE_32BITS))
|
||||
UINT64 tmp;
|
||||
UINT64 *dst_64 = (UINT64*)dst1;
|
||||
_UINT64 tmp;
|
||||
_UINT64 *dst_64 = (_UINT64*)dst1;
|
||||
#else
|
||||
UINT32 tmp;
|
||||
UINT32 *dst_32 = (UINT32*)dst1;
|
||||
_UINT32 tmp;
|
||||
_UINT32 *dst_32 = (_UINT32*)dst1;
|
||||
#endif
|
||||
GF_OPT_MULC0(c);
|
||||
|
||||
@@ -142,32 +142,32 @@ void of_galois_field_2_4_addmul1_compact (gf *dst1, gf *src1, gf c, int
|
||||
{
|
||||
#if ((defined (__LP64__) || (__WORDSIZE == 64)) && !defined (OF_RS_2M_USE_32BITS))
|
||||
/* perform 64-bit operations for improved performances on 64-bit systems */
|
||||
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++;
|
||||
#else
|
||||
/* otherwise perform 32-bit operations on 32-bit systems */
|
||||
tmp = ((UINT32)__gf_mulc_[src[0]]) | ((UINT32)__gf_mulc_[src[1]]<<8) | ((UINT32)__gf_mulc_[src[2]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[3]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[0]]) | ((_UINT32)__gf_mulc_[src[1]]<<8) | ((_UINT32)__gf_mulc_[src[2]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[3]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[4]]) | ((UINT32)__gf_mulc_[src[5]]<<8) | ((UINT32)__gf_mulc_[src[6]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[7]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[4]]) | ((_UINT32)__gf_mulc_[src[5]]<<8) | ((_UINT32)__gf_mulc_[src[6]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[7]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[8]]) | ((UINT32)__gf_mulc_[src[9]]<<8) | ((UINT32)__gf_mulc_[src[10]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[11]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[8]]) | ((_UINT32)__gf_mulc_[src[9]]<<8) | ((_UINT32)__gf_mulc_[src[10]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[11]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[12]]) | ((UINT32)__gf_mulc_[src[13]]<<8) | ((UINT32)__gf_mulc_[src[14]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[15]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[12]]) | ((_UINT32)__gf_mulc_[src[13]]<<8) | ((_UINT32)__gf_mulc_[src[14]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[15]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
#endif
|
||||
|
||||
@@ -52,11 +52,11 @@ void of_galois_field_2_8_addmul1(gf *dst1, gf *src1, gf c, int sz) {
|
||||
register gf *dst = dst1, *src = src1 ;
|
||||
gf *lim = &dst[sz - UNROLL + 1] ;
|
||||
#if ((defined (__LP64__) || (__WORDSIZE == 64)) && !defined (OF_RS_2M_USE_32BITS))
|
||||
UINT64 tmp;
|
||||
UINT64 *dst_64 = (UINT64*)dst1;
|
||||
_UINT64 tmp;
|
||||
_UINT64 *dst_64 = (_UINT64*)dst1;
|
||||
#else
|
||||
UINT32 tmp;
|
||||
UINT32 *dst_32 = (UINT32*)dst1;
|
||||
_UINT32 tmp;
|
||||
_UINT32 *dst_32 = (_UINT32*)dst1;
|
||||
#endif
|
||||
GF_MULC0 (c) ;
|
||||
|
||||
@@ -66,31 +66,31 @@ void of_galois_field_2_8_addmul1(gf *dst1, gf *src1, gf c, int sz) {
|
||||
for (; dst < lim ;dst += UNROLL, src += UNROLL)
|
||||
{
|
||||
#if ((defined (__LP64__) || (__WORDSIZE == 64)) && !defined (OF_RS_2M_USE_32BITS))
|
||||
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++;
|
||||
#else
|
||||
tmp = ((UINT32)__gf_mulc_[src[0]]) | ((UINT32)__gf_mulc_[src[1]]<<8) | ((UINT32)__gf_mulc_[src[2]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[3]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[0]]) | ((_UINT32)__gf_mulc_[src[1]]<<8) | ((_UINT32)__gf_mulc_[src[2]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[3]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[4]]) | ((UINT32)__gf_mulc_[src[5]]<<8) | ((UINT32)__gf_mulc_[src[6]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[7]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[4]]) | ((_UINT32)__gf_mulc_[src[5]]<<8) | ((_UINT32)__gf_mulc_[src[6]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[7]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[8]]) | ((UINT32)__gf_mulc_[src[9]]<<8) | ((UINT32)__gf_mulc_[src[10]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[11]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[8]]) | ((_UINT32)__gf_mulc_[src[9]]<<8) | ((_UINT32)__gf_mulc_[src[10]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[11]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
tmp = ((UINT32)__gf_mulc_[src[12]]) | ((UINT32)__gf_mulc_[src[13]]<<8) | ((UINT32)__gf_mulc_[src[14]]<<16) |
|
||||
((UINT32)__gf_mulc_[src[15]]<<24);
|
||||
tmp = ((_UINT32)__gf_mulc_[src[12]]) | ((_UINT32)__gf_mulc_[src[13]]<<8) | ((_UINT32)__gf_mulc_[src[14]]<<16) |
|
||||
((_UINT32)__gf_mulc_[src[15]]<<24);
|
||||
*dst_32 ^= tmp;
|
||||
dst_32++;
|
||||
#endif
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
#ifdef OF_USE_REED_SOLOMON_2_M_CODEC
|
||||
|
||||
|
||||
gf of_modnn(of_galois_field_code_cb_t* ofcb,INT32 x)
|
||||
gf of_modnn(of_galois_field_code_cb_t* ofcb,_INT32 x)
|
||||
{
|
||||
UINT16 field_size = ofcb->field_size;
|
||||
_UINT16 field_size = ofcb->field_size;
|
||||
while (x >= field_size)
|
||||
{
|
||||
x -= field_size;
|
||||
@@ -114,7 +114,7 @@ of_status_t of_rs_2m_build_encoding_matrix(of_galois_field_code_cb_t* ofcb)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
gf *tmp_m, *p;
|
||||
UINT32 k,r,col,row;
|
||||
_UINT32 k,r,col,row;
|
||||
k=ofcb->nb_source_symbols;
|
||||
r = ofcb->nb_repair_symbols;
|
||||
if ((ofcb->enc_matrix = of_malloc((k+r)*(k))) == NULL)
|
||||
@@ -188,7 +188,7 @@ of_status_t of_rs_2m_build_encoding_matrix(of_galois_field_code_cb_t* ofcb)
|
||||
of_status_t of_rs_2m_build_decoding_matrix(of_galois_field_code_cb_t* ofcb, int *index)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
UINT32 k,r,i;
|
||||
_UINT32 k,r,i;
|
||||
gf *p;
|
||||
k = ofcb->nb_source_symbols;
|
||||
r = ofcb->nb_repair_symbols;
|
||||
|
||||
@@ -36,12 +36,9 @@
|
||||
|
||||
#include "../of_reed-solomon_gf_2_m_includes.h"
|
||||
|
||||
#define bcmp(s1 ,s2, n) memcmp((s1), (s2), (size_t)(n))
|
||||
|
||||
#ifdef OF_USE_REED_SOLOMON_2_M_CODEC
|
||||
|
||||
#define FEC_MAGIC 0xFECC0DEC
|
||||
|
||||
#define FEC_MAGIC 0xFECC0DEC
|
||||
|
||||
/*
|
||||
* Primitive polynomials - see Lin & Costello, Appendix A,
|
||||
@@ -73,32 +70,36 @@ static const char *of_rs_allPp[] = /* GF_BITS polynomial */
|
||||
/**
|
||||
* Galois-Field-Code stable codec specific control block structure.
|
||||
*/
|
||||
typedef of_rs_2_m_cb_t of_galois_field_code_cb_t; /* XXX: the two types are synonymous in fact! */
|
||||
typedef of_rs_2_m_cb_t
|
||||
of_galois_field_code_cb_t; /* XXX: the two types are synonymous in fact! */
|
||||
|
||||
/**
|
||||
* just a helper to init all we need to use GF
|
||||
*/
|
||||
of_status_t of_rs_2m_init(of_galois_field_code_cb_t* ofcb);
|
||||
of_status_t of_rs_2m_init(of_galois_field_code_cb_t* ofcb);
|
||||
|
||||
/**
|
||||
* and the helper to release memory
|
||||
*/
|
||||
void of_rs_2m_release(of_galois_field_code_cb_t* ofcb);
|
||||
void of_rs_2m_release(of_galois_field_code_cb_t* ofcb);
|
||||
|
||||
/**
|
||||
* even if only decoder is defined, we need an encoding matrix.
|
||||
*/
|
||||
of_status_t of_rs_2m_build_encoding_matrix(of_galois_field_code_cb_t* ofcb);
|
||||
of_status_t of_rs_2m_build_encoding_matrix(of_galois_field_code_cb_t* ofcb);
|
||||
|
||||
#ifdef OF_USE_DECODER
|
||||
of_status_t of_rs_2m_build_decoding_matrix(of_galois_field_code_cb_t* ofcb,int* index);
|
||||
of_status_t of_rs_2m_decode(of_galois_field_code_cb_t* ofcb,gf *pkt[], int index[], int sz);
|
||||
of_status_t of_rs_2m_build_decoding_matrix(of_galois_field_code_cb_t* ofcb,
|
||||
int* index);
|
||||
of_status_t of_rs_2m_decode(of_galois_field_code_cb_t* ofcb, gf* pkt[],
|
||||
int index[], int sz);
|
||||
#endif
|
||||
|
||||
#ifdef OF_USE_ENCODER
|
||||
of_status_t of_rs_2m_encode(of_galois_field_code_cb_t* ofcb,gf *_src[], gf *_fec, int index, int sz);
|
||||
of_status_t of_rs_2m_encode(of_galois_field_code_cb_t* ofcb, gf* _src[],
|
||||
gf* _fec, int index, int sz);
|
||||
#endif
|
||||
|
||||
#endif //OF_USE_GALOIS_FIELD_CODES_UTILS
|
||||
#endif // OF_USE_GALOIS_FIELD_CODES_UTILS
|
||||
|
||||
#endif //GALOIS_FIELD_CODE_H
|
||||
#endif // GALOIS_FIELD_CODE_H
|
||||
|
||||
@@ -51,13 +51,13 @@ typedef struct of_rs_2_m_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. */
|
||||
/***********************************************************************************/
|
||||
|
||||
UINT16 m; /* in theory between 2..16. Currently only values 4 and 8 are supported */
|
||||
UINT16 field_size; /* 2^m */
|
||||
_UINT16 m; /* in theory between 2..16. Currently only values 4 and 8 are supported */
|
||||
_UINT16 field_size; /* 2^m */
|
||||
gf* of_rs_gf_exp; /* index->poly form conversion table. */
|
||||
int* of_rs_gf_log; /* Poly->index form conversion table. */
|
||||
gf* of_rs_inverse; /* inverse of field elem. */
|
||||
@@ -79,15 +79,15 @@ typedef struct of_rs_2_m_cb
|
||||
#endif
|
||||
/***********************************************************************************/
|
||||
|
||||
UINT32 magic;
|
||||
_UINT32 magic;
|
||||
|
||||
/** 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;
|
||||
/* maximum m value in GF(2^m) supported by the codec */
|
||||
UINT16 max_m;
|
||||
UINT32 nb_encoding_symbols;
|
||||
_UINT16 max_m;
|
||||
_UINT32 nb_encoding_symbols;
|
||||
#ifdef OF_USE_DECODER
|
||||
/*
|
||||
* decoder specific variables.
|
||||
@@ -99,20 +99,20 @@ typedef struct of_rs_2_m_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_2_m_cb_t;
|
||||
@@ -162,8 +162,8 @@ of_status_t of_rs_2_m_set_fec_parameters (of_rs_2_m_cb_t* ofcb,
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_2_m_set_callback_functions (of_rs_2_m_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.
|
||||
*
|
||||
@@ -187,16 +187,16 @@ of_status_t of_rs_2_m_set_fec_parameters (of_rs_2_m_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_rs_2_m_set_callback_functions (of_rs_2_m_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_2_m_build_repair_symbol (of_rs_2_m_cb_t* ofcb, void* encoding_symbols_tab[], UINT32 esi_of_symbol_to_build)
|
||||
* @fn of_status_t of_rs_2_m_build_repair_symbol (of_rs_2_m_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.
|
||||
@@ -210,12 +210,12 @@ of_status_t of_rs_2_m_set_callback_functions (of_rs_2_m_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_rs_2_m_build_repair_symbol (of_rs_2_m_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_2_m_decode_with_new_symbol (of_rs_2_m_cb_t* ofcb, void* const new_symbol_buf, UINT32 new_symbol_esi)
|
||||
* @fn of_status_t of_rs_2_m_decode_with_new_symbol (of_rs_2_m_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
|
||||
@@ -226,7 +226,7 @@ of_status_t of_rs_2_m_build_repair_symbol (of_rs_2_m_cb_t* ofcb,
|
||||
*/
|
||||
of_status_t of_rs_2_m_decode_with_new_symbol (of_rs_2_m_cb_t* ofcb,
|
||||
void* new_symbol,
|
||||
UINT32 new_symbol_esi);
|
||||
_UINT32 new_symbol_esi);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_2_m_set_available_symbols (of_rs_2_m_cb_t* ofcb, void* const encoding_symbols_tab[]);
|
||||
@@ -274,7 +274,7 @@ of_status_t of_rs_2_m_get_source_symbols_tab (of_rs_2_m_cb_t* ofcb,
|
||||
#endif //OF_USE_DECODER
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_2_m_set_control_parameter (of_rs_2_m_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
|
||||
* @fn of_status_t of_rs_2_m_set_control_parameter (of_rs_2_m_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.
|
||||
@@ -284,12 +284,12 @@ of_status_t of_rs_2_m_get_source_symbols_tab (of_rs_2_m_cb_t* ofcb,
|
||||
* @return Error status.
|
||||
*/
|
||||
of_status_t of_rs_2_m_set_control_parameter (of_rs_2_m_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length);
|
||||
_UINT32 length);
|
||||
|
||||
/**
|
||||
* @fn of_status_t of_rs_2_m_get_control_parameter (of_rs_2_m_cb_t* ofcb,UINT32 type,void* value,UINT32 length)
|
||||
* @fn of_status_t of_rs_2_m_get_control_parameter (of_rs_2_m_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.
|
||||
@@ -301,9 +301,9 @@ of_status_t of_rs_2_m_set_control_parameter (of_rs_2_m_cb_t* ofcb,
|
||||
* @return Error status.
|
||||
*/
|
||||
of_status_t of_rs_2_m_get_control_parameter (of_rs_2_m_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length);
|
||||
_UINT32 length);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -119,11 +119,11 @@ error:
|
||||
|
||||
of_status_t of_rs_2_m_set_callback_functions (of_rs_2_m_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;
|
||||
@@ -141,7 +141,7 @@ of_status_t of_rs_2_m_set_callback_functions (of_rs_2_m_cb_t* ofcb,
|
||||
|
||||
of_status_t of_rs_2_m_build_repair_symbol (of_rs_2_m_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)
|
||||
@@ -185,7 +185,7 @@ error:
|
||||
#ifdef OF_USE_DECODER
|
||||
of_status_t of_rs_2_m_decode_with_new_symbol (of_rs_2_m_cb_t* ofcb,
|
||||
void* new_symbol,
|
||||
UINT32 new_symbol_esi)
|
||||
_UINT32 new_symbol_esi)
|
||||
{
|
||||
OF_ENTER_FUNCTION
|
||||
if (ofcb->decoding_finished)
|
||||
@@ -241,7 +241,7 @@ error:
|
||||
of_status_t of_rs_2_m_set_available_symbols (of_rs_2_m_cb_t* ofcb,
|
||||
void* const encoding_symbols_tab[])
|
||||
{
|
||||
UINT32 i;
|
||||
_UINT32 i;
|
||||
|
||||
OF_ENTER_FUNCTION
|
||||
ofcb->nb_available_symbols = 0;
|
||||
@@ -266,18 +266,18 @@ of_status_t of_rs_2_m_set_available_symbols (of_rs_2_m_cb_t* ofcb,
|
||||
#if 0 /* new */
|
||||
of_status_t of_rs_2_m_finish_decoding (of_rs_2_m_cb_t* ofcb)
|
||||
{
|
||||
UINT32 k;
|
||||
UINT32 n;
|
||||
_UINT32 k;
|
||||
_UINT32 n;
|
||||
char *tmp_buf[ofcb->nb_source_symbols];/* keep available source/repair symbol buffers here... */
|
||||
int tmp_esi[ofcb->nb_source_symbols]; /* ...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 */
|
||||
void **ass_buf; /* tmp pointer to the current available 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 available 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)
|
||||
@@ -372,20 +372,20 @@ error:
|
||||
|
||||
of_status_t of_rs_2_m_finish_decoding (of_rs_2_m_cb_t* ofcb)
|
||||
{
|
||||
UINT32 k;
|
||||
UINT32 n;
|
||||
_UINT32 k;
|
||||
_UINT32 n;
|
||||
// char *tmp_buf[ofcb->nb_source_symbols];/* keep available source/repair symbol buffers here... */
|
||||
// int tmp_esi[ofcb->nb_source_symbols]; /* ...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 available 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 available 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)
|
||||
@@ -570,7 +570,7 @@ of_status_t of_rs_2_m_get_source_symbols_tab (of_rs_2_m_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)
|
||||
@@ -589,20 +589,20 @@ of_status_t of_rs_2_m_get_source_symbols_tab (of_rs_2_m_cb_t* ofcb,
|
||||
#endif //OF_USE_DECODER
|
||||
|
||||
of_status_t of_rs_2_m_set_control_parameter (of_rs_2_m_cb_t* ofcb,
|
||||
UINT32 type,
|
||||
_UINT32 type,
|
||||
void* value,
|
||||
UINT32 length)
|
||||
_UINT32 length)
|
||||
{
|
||||
UINT16 m;
|
||||
_UINT16 m;
|
||||
|
||||
OF_ENTER_FUNCTION
|
||||
switch (type) {
|
||||
case OF_RS_CTRL_SET_FIELD_SIZE:
|
||||
if (value == NULL || length != sizeof(UINT16)) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_SET_FIELD_SIZE ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(UINT16)))
|
||||
if (value == NULL || length != sizeof(_UINT16)) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_SET_FIELD_SIZE ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(_UINT16)))
|
||||
goto error;
|
||||
}
|
||||
m = *(UINT16*)value;
|
||||
m = *(_UINT16*)value;
|
||||
if (m != 4 && m != 8) {
|
||||
OF_PRINT_ERROR(("ERROR: invalid m=%d parameter (must be 4 or 8)\n", m));
|
||||
goto error;
|
||||
@@ -626,36 +626,36 @@ error:
|
||||
|
||||
|
||||
of_status_t of_rs_2_m_get_control_parameter (of_rs_2_m_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)) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(UINT32)))
|
||||
if (value == NULL || length != sizeof(_UINT32)) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(_UINT32)))
|
||||
goto error;
|
||||
}
|
||||
if (ofcb->max_nb_source_symbols == 0) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_GET_MAX_K ERROR: this parameter is not initialized. Use the of_rs_2_m_set_fec_parameters function to initialize it or of_rs_2_m_set_control_parameter.\n"))
|
||||
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)) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(UINT32)))
|
||||
if (value == NULL || length != sizeof(_UINT32)) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(_UINT32)))
|
||||
goto error;
|
||||
}
|
||||
if (ofcb->max_nb_encoding_symbols == 0) {
|
||||
OF_PRINT_ERROR(("OF_CTRL_GET_MAX_N ERROR: this parameter is not initialized. Use the of_rs_2_m_set_fec_parameters function to initialize it or of_rs_2_m_set_control_parameter.\n"))
|
||||
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,13 +45,13 @@
|
||||
*/
|
||||
typedef struct of_rs_2_m_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...
|
||||
*/
|
||||
UINT16 m; /* WARNING: was bit_size */
|
||||
_UINT16 m; /* WARNING: was bit_size */
|
||||
|
||||
} of_rs_2_m_parameters_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user