optimized histogram merging