Reduce computation time for bilateral upsampling.

Compute the distance values (exponential functions) in advance to reduce computation time.
Merge pull request #689 from aikkala/bilateral_upsampling_fast

Reduce the computation time needed for bilateral upsampling