mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
fix(time_meas): Avoid many short sorted lists in LDPC encoder/decoder
This commit is contained in:
@@ -372,7 +372,7 @@ void free_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_lis
|
||||
* \brief returns true if the sorted list is enabled and false otherwise
|
||||
* \param time_stats_sorted_list sorted list to be tested
|
||||
*/
|
||||
int is_enabled_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
int is_enabled_time_stats_sorted_list(const time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
return (time_stats_sorted_list->size > 0);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void free_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_lis
|
||||
* \brief returns true if the sorted list is enabled and false otherwise
|
||||
* \param time_stats_sorted_list sorted list to be tested
|
||||
*/
|
||||
int is_enabled_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
int is_enabled_time_stats_sorted_list(const time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief empties sorted list
|
||||
* if dst is not initialized then does nothing
|
||||
@@ -317,7 +317,11 @@ static inline void merge_meas(time_stats_t *dst_ts, const time_stats_t *src_ts)
|
||||
dst_ts->diff_square += src_ts->diff_square;
|
||||
if (src_ts->max > dst_ts->max)
|
||||
dst_ts->max = src_ts->max;
|
||||
merge_time_stats_sorted_list(&dst_ts->time_stats_sorted_list, &src_ts->time_stats_sorted_list);
|
||||
if (is_enabled_time_stats_sorted_list(&src_ts->time_stats_sorted_list)) {
|
||||
merge_time_stats_sorted_list(&dst_ts->time_stats_sorted_list, &src_ts->time_stats_sorted_list);
|
||||
} else if (src_ts->trials == 1) {
|
||||
insert_in_time_stats_sorted_list(&dst_ts->time_stats_sorted_list, src_ts->max);
|
||||
}
|
||||
}
|
||||
|
||||
#define TIME_STATS_ADVANCED_MODE 2
|
||||
|
||||
Reference in New Issue
Block a user