use more low-level code for downsampling. compute required input interval more accurately so that we can always use the extended + cropped version and most of the time the extension will be optimized away.
use more low-level code for downsampling. compute required input interval more accurately
so that we can always use the extended + cropped version and most of the time the
extension will be optimized away.

bigdataviewer/bigdataviewer-core,bogovicj/bigdataviewer-core,bigdataviewer/bigdataviewer-core,bogovicj/bigdataviewer-core