summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-08-10 07:56:33 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-08-10 07:56:33 -0400
commitee6b737b651e45b1926e7d343d977480014fdc07 (patch)
tree601a7e7984e7391d406c536f7e6ac9d1f2b68ab8
parent4fb5aeb096ec911c54662caa8606c413b91deb00 (diff)
pcm_record.c iAudioM5 FixRed
Share a bit of code in order to free up iRam for the iAudio M5 Change-Id: Ief05d2614a203df17821ed32b04f5c75a53ca08b
-rw-r--r--apps/recorder/pcm_record.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c
index 0a6e1b5a51..9b0e779485 100644
--- a/apps/recorder/pcm_record.c
+++ b/apps/recorder/pcm_record.c
@@ -890,12 +890,12 @@ copy_buffer_mono_lr(void *dst, const void *src, size_t src_size)
/* Copy with mono conversion - output 1/2 size of input */
static void * ICODE_ATTR
-copy_buffer_mono_l(void *dst, const void *src, size_t src_size)
+copy_buffer_mono_r(void *dst, const void *src, size_t src_size)
{
int16_t *d = (int16_t*)dst;
- int16_t const *s = (int16_t const*)src - 2;
+ int16_t const *s = (int16_t const*)src - 1;
ssize_t copy_size = src_size;
- /* mono = L */
+ /* mono = R */
do
*d++ = *(s += 2);
while ((copy_size -= PCM_SAMP_SIZE) > 0);
@@ -903,20 +903,28 @@ copy_buffer_mono_l(void *dst, const void *src, size_t src_size)
return dst;
}
+#if 1
+static void * ICODE_ATTR
+copy_buffer_mono_l(void *dst, const void *src, size_t src_size)
+{
+ return copy_buffer_mono_r(dst, src -1, src_size);
+}
+#else
/* Copy with mono conversion - output 1/2 size of input */
static void * ICODE_ATTR
-copy_buffer_mono_r(void *dst, const void *src, size_t src_size)
+copy_buffer_mono_l(void *dst, const void *src, size_t src_size)
{
int16_t *d = (int16_t*)dst;
- int16_t const *s = (int16_t const*)src - 1;
+ int16_t const *s = (int16_t const*)src - 2;
ssize_t copy_size = src_size;
- /* mono = R */
+ /* mono = L */
do
*d++ = *(s += 2);
while ((copy_size -= PCM_SAMP_SIZE) > 0);
return dst;
}
+#endif
/** pcm_rec_* group **/