in histogram accumulation (computeCells), avoiding border checks where possible.