fix(time_meas): Avoid many short sorted lists in LDPC encoder/decoder

This commit is contained in:
Romain Beurdouche
2026-02-12 15:20:34 +01:00
parent cef157005c
commit 808cbf6f33
2 changed files with 7 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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