Implemented more efficient and memory savvy RSI
This commit is contained in:
@@ -1391,7 +1391,7 @@ extern "C" {
|
||||
|
||||
/* ******************************* */
|
||||
|
||||
void ndpi_init_rsi(struct ndpi_rsi_struct *s, u_int16_t num_learning_values);
|
||||
int ndpi_alloc_rsi(struct ndpi_rsi_struct *s, u_int16_t num_learning_values);
|
||||
void ndpi_free_rsi(struct ndpi_rsi_struct *s);
|
||||
float ndpi_rsi_add_value(struct ndpi_rsi_struct *s, const u_int32_t value);
|
||||
|
||||
|
||||
@@ -1545,8 +1545,10 @@ struct ndpi_analyze_struct {
|
||||
/* **************************************** */
|
||||
|
||||
struct ndpi_rsi_struct {
|
||||
struct ndpi_analyze_struct gains, losses;
|
||||
u_int32_t last_value;
|
||||
u_int8_t empty:1, rsi_ready:1, _notused:6;
|
||||
u_int16_t num_values, next_index;
|
||||
u_int32_t *gains, *losses;
|
||||
u_int32_t last_value, total_gains, total_losses;
|
||||
};
|
||||
|
||||
/* **************************************** */
|
||||
|
||||
Reference in New Issue
Block a user