Skip to content

Commit

Permalink
memcpy_tointerleave allow AUDIO_BLOCK_SAMPLES == 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfont committed Dec 7, 2021
1 parent d990906 commit eba80d6
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions memcpy_audio.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
.thumb
.text

/* void memcpy_tointerleave(short *dst, short *srcL, short *srcR); */
/* void memcpy_tointerleaveLR(short *dst, short *srcL, short *srcR); */
.global memcpy_tointerleaveLR
.thumb_func
memcpy_tointerleaveLR:
Expand Down Expand Up @@ -86,6 +86,14 @@

stmia r0!, {r3,r4,r5,r6}
pop {r4-r8,r14}
#elif AUDIO_BLOCK_SAMPLES == 4
ldr r3, [r1]
ldr r2, [r2]

pkhbt r1,r3,r2,LSL #16
pkhtb r3,r2,r3,ASR #16

stmia r0!, {r1,r3}
#endif
BX lr

Expand Down Expand Up @@ -142,11 +150,18 @@
stmia r0!, {r3,r4,r5,r6}

pop {r4-r7}
#elif AUDIO_BLOCK_SAMPLES == 4
ldr r3, [r1]

pkhbt r1,r3,r2
pkhtb r3,r2,r3,ASR #16

stmia r0!, {r1,r3}
#endif
BX lr


/* void memcpy_tointerleaveL(short *dst, short *srcR); */
/* void memcpy_tointerleaveR(short *dst, short *srcR); */
.global memcpy_tointerleaveR
.thumb_func
memcpy_tointerleaveR:
Expand Down Expand Up @@ -197,7 +212,13 @@
stmia r0!, {r3,r4,r5,r6}

pop {r4-r7}
#elif AUDIO_BLOCK_SAMPLES == 4
ldr r3, [r1]

pkhbt r1,r2,r3,LSL #16
pkhtb r3,r3,r2

stmia r0!, {r1,r3}
#endif
BX lr

Expand Down

0 comments on commit eba80d6

Please sign in to comment.