aboutsummaryrefslogtreecommitdiff
path: root/celt/pitch.c
diff options
context:
space:
mode:
authorTimothy B. Terriberry <tterribe@xiph.org>2013-11-26 21:51:39 -0800
committerTimothy B. Terriberry <tterribe@xiph.org>2013-11-26 21:58:35 -0800
commit5c02c5ffb58a08c1b705e6fa2ab73f631f658823 (patch)
tree4c6cf12db4fd4eb597b38d8210d540dfb25b91e2 /celt/pitch.c
parentaa8ff201b5f8c489c52f00d83cd188bb168c310b (diff)
downloadlibopus-5c02c5ffb58a08c1b705e6fa2ab73f631f658823.tar.gz
Make celt_pitch_xcorr_edsp() work on ARMv5TE.
We were assuming that LDR, LDRD, and STRD could be used on unaligned addresses, but this turns out not to be true on really old hardware.
Diffstat (limited to 'celt/pitch.c')
-rw-r--r--celt/pitch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/celt/pitch.c b/celt/pitch.c
index 2d63a5ac..d2b30544 100644
--- a/celt/pitch.c
+++ b/celt/pitch.c
@@ -253,6 +253,11 @@ void
celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch)
{
int i,j;
+ /*The EDSP version requires that max_pitch is at least 1, and that _x is
+ 32-bit aligned.
+ Since it's hard to put asserts in assembly, put them here.*/
+ celt_assert(max_pitch>0);
+ celt_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0);
#ifdef FIXED_POINT
opus_val32 maxcorr=1;
#endif