diff options
author | Andy Hung <hunga@google.com> | 2015-05-12 19:30:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-12 19:30:14 +0000 |
commit | 9e82a9dd5ea4c44fa9bd926444624e9c34a83212 (patch) | |
tree | 81a139bd93ff19da322470dc0e2ce9145d8eb742 | |
parent | b5635a6fd7b15cb27f06019314c89edf004c877d (diff) | |
parent | f90f8f8ada73f8bbfc7cb70a3795cdcfad0c3240 (diff) | |
download | hardware_libhardware-9e82a9dd5ea4c44fa9bd926444624e9c34a83212.zip hardware_libhardware-9e82a9dd5ea4c44fa9bd926444624e9c34a83212.tar.gz hardware_libhardware-9e82a9dd5ea4c44fa9bd926444624e9c34a83212.tar.bz2 |
Merge "Remove unused data conversion functions from usb hal" into mnc-dev
-rw-r--r-- | modules/usbaudio/audio_hal.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c index 84cc643..5431476 100644 --- a/modules/usbaudio/audio_hal.c +++ b/modules/usbaudio/audio_hal.c @@ -124,74 +124,6 @@ struct stream_in { }; /* - * Data Conversions - */ -/* - * Convert a buffer of packed (3-byte) PCM24LE samples to PCM16LE samples. - * in_buff points to the buffer of PCM24LE samples - * num_in_samples size of input buffer in SAMPLES - * out_buff points to the buffer to receive converted PCM16LE LE samples. - * returns - * the number of BYTES of output data. - * We are doing this since we *always* present to The Framework as A PCM16LE device, but need to - * support PCM24_3LE (24-bit, packed). - * NOTE: - * This conversion is safe to do in-place (in_buff == out_buff). - * TODO Move this to a utilities module. - */ -static size_t convert_24_3_to_16(const unsigned char * in_buff, size_t num_in_samples, - short * out_buff) -{ - /* - * Move from front to back so that the conversion can be done in-place - * i.e. in_buff == out_buff - */ - /* we need 2 bytes in the output for every 3 bytes in the input */ - unsigned char* dst_ptr = (unsigned char*)out_buff; - const unsigned char* src_ptr = in_buff; - size_t src_smpl_index; - for (src_smpl_index = 0; src_smpl_index < num_in_samples; src_smpl_index++) { - src_ptr++; /* lowest-(skip)-byte */ - *dst_ptr++ = *src_ptr++; /* low-byte */ - *dst_ptr++ = *src_ptr++; /* high-byte */ - } - - /* return number of *bytes* generated: */ - return num_in_samples * 2; -} - -/* - * Convert a buffer of packed (3-byte) PCM32 samples to PCM16LE samples. - * in_buff points to the buffer of PCM32 samples - * num_in_samples size of input buffer in SAMPLES - * out_buff points to the buffer to receive converted PCM16LE LE samples. - * returns - * the number of BYTES of output data. - * We are doing this since we *always* present to The Framework as A PCM16LE device, but need to - * support PCM_FORMAT_S32_LE (32-bit). - * NOTE: - * This conversion is safe to do in-place (in_buff == out_buff). - * TODO Move this to a utilities module. - */ -static size_t convert_32_to_16(const int32_t * in_buff, size_t num_in_samples, short * out_buff) -{ - /* - * Move from front to back so that the conversion can be done in-place - * i.e. in_buff == out_buff - */ - - short * dst_ptr = out_buff; - const int32_t* src_ptr = in_buff; - size_t src_smpl_index; - for (src_smpl_index = 0; src_smpl_index < num_in_samples; src_smpl_index++) { - *dst_ptr++ = *src_ptr++ >> 16; - } - - /* return number of *bytes* generated: */ - return num_in_samples * 2; -} - -/* * Extract the card and device numbers from the supplied key/value pairs. * kvpairs A null-terminated string containing the key/value pairs or card and device. * i.e. "card=1;device=42" |