Skip to content

Commit

Permalink
addressed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
spran180 committed Jul 25, 2024
1 parent 08bf3de commit 191b2c7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/internal_modules/roc_core/mov_histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ template <typename T> class MovHistogram {
"than 0 and value_range_min must be less than value_range_max");
}

bin_width_ = (value_range_max - value_range_min) / num_bins;
bin_width_ = (value_range_max - value_range_min) / static_cast<T>(num_bins);

if (!ring_buffer_.is_valid() || !bins_.resize(num_bins)) {
return;
Expand Down Expand Up @@ -82,9 +82,7 @@ template <typename T> class MovHistogram {
T oldest_value = ring_buffer_.front();
ring_buffer_.pop_front();
size_t oldest_bin_index = get_bin_index_(oldest_value);
if (oldest_bin_index < num_bins_) {
bins_[oldest_bin_index]--;
}
bins_[oldest_bin_index]--;
}

ring_buffer_.push_back(clamped_value);
Expand Down

0 comments on commit 191b2c7

Please sign in to comment.