calculating bit depth