Optimization for speed regression in mipmap generation

Regression was caused by alpha premul cleanup commit and the reason
of slowdown was uchar <-> float conversion which is slow.

Replaced with uchar <-> int conversion which seeps to be accurate
enough and mostly eliminates slowdown.

Slowdown was easy to notice when movie clip is used for 3d vierport
background and undistortion is enabled. In this case every frame
will re-calculate mipmaps.

It's still a nit slower than mipmap generation before cleanup
commit, but couldn't think about extra boost here atm.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@53561 954f8c5b-7b00-dc11-b283-0030488c597c