From 4cbe6152ecc4a4aa07e08314150722f92bc9d87e Mon Sep 17 00:00:00 2001 From: Eric Fontaine Date: Mon, 6 Dec 2021 21:08:00 -0500 Subject: [PATCH] memcpy_tointerleave allow AUDIO_BLOCK_SAMPLES == 4 Previous code won't work for AUDIO_BLOCK_SAMPLES < 8. So I would like to add a case for AUDIO_BLOCK_SAMPLES == 4, using the same pattern of interleaving code as for AUDIO_BLOCK_SAMPLES == 8, but just half as much. --- memcpy_audio.S | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/memcpy_audio.S b/memcpy_audio.S index d8c8abe45..1d0004c98 100644 --- a/memcpy_audio.S +++ b/memcpy_audio.S @@ -85,7 +85,18 @@ pkhtb r6,r8,r7,ASR #16 stmia r0!, {r3,r4,r5,r6} - pop {r4-r8,r14} + pop {r4-r8,r14} +#elif AUDIO_BLOCK_SAMPLES == 4 + push {r4-r6,r14} + + ldmia r1!, {r5} + ldmia r2!, {r6} + + pkhbt r3,r5,r6,LSL #16 + pkhtb r4,r6,r5,ASR #16 + + stmia r0!, {r3,r4} + pop {r4-r6,r14} #endif BX lr @@ -146,7 +157,7 @@ BX lr -/* void memcpy_tointerleaveL(short *dst, short *srcR); */ +/* void memcpy_tointerleaveR(short *dst, short *srcR); */ .global memcpy_tointerleaveR .thumb_func memcpy_tointerleaveR: