Improve support for half floats and expose as public API

Half floats (often called fp16) are commonly used to store floating
point data efficiently without having to use lossy compression schemes.

Half floats are commonly used in the following cases:
- Wide gamut colors
- Meshes (OpenGL and Vulkan)
- HDR images/textures
- Lookup tables as textures (OpenGL and Vulkan), particularly
  in physically-based renderers
- Maching learning/compute

OpenGL and Renderscript both provide Java language APIs that accept
half floats but the platform offers no support to create fp16 values
from fp32 data. The Half class is an IEEE 754 compliant implementation
of half floats that can be used to feed OpenGL and Renderscript properly
encoded values. A comprehensive series of test is also added to CTS.

Test: cts-tradefed run singleCommand cts-dev --module CtsUtilTestCases --test android.util.cts.HalfTest
Bug: 29940137

Change-Id: I908bde7b3c6f65f7a24e0ab5652be4d16cc0358d
4 files changed