Separated computation of histograms from the rest