Fix float to i16 conversion in primitives.c

Updated memcpy_to_i16_from_float():
Made bit-accurate invertible with power of 2 scaling.
Also removed discontinuity around 0 (round versus truncate).

Added clamp16FromFloat() to clamp float audio range of
[-1.0, 1.0) to int16_t.

Change-Id: I45b23f32ae46a4d7f86c8e5482ee43538298ce89
Signed-off-by: Andy Hung <hunga@google.com>
2 files changed
tree: fac42fb5a562c6e7409cb076d0e3237018684eb1
  1. audio_effects/
  2. audio_route/
  3. audio_utils/
  4. camera/
  5. CleanSpec.mk