summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2013-01-11 13:42:57 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-01-11 13:45:20 +0100
commit3025a42cd06ca439ab4e316d2fdf08f7215c5034 (patch)
treefcb237c9206ea9ceefad61c97340543ad3239650 /patches
parentedbef680cc23adeb35465e2ba2747d9e71d2cf24 (diff)
downloadptxdist-3025a42cd06ca439ab4e316d2fdf08f7215c5034.tar.gz
ptxdist-3025a42cd06ca439ab4e316d2fdf08f7215c5034.tar.xz
speex: add debian + buildroot patches
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/speex-1.2rc1/0001-speex_header.patch45
-rw-r--r--patches/speex-1.2rc1/0002-resample.patch84
-rw-r--r--patches/speex-1.2rc1/0003-Make-speex-Thumb2-compatible.patch228
-rw-r--r--patches/speex-1.2rc1/series6
4 files changed, 363 insertions, 0 deletions
diff --git a/patches/speex-1.2rc1/0001-speex_header.patch b/patches/speex-1.2rc1/0001-speex_header.patch
new file mode 100644
index 000000000..9bb09737a
--- /dev/null
+++ b/patches/speex-1.2rc1/0001-speex_header.patch
@@ -0,0 +1,45 @@
+From: Ron Lee <ron@debian.org>
+Date: Fri, 11 Jan 2013 12:13:50 +0100
+Subject: [PATCH] speex_header
+
+from: http://patch-tracker.debian.org/package/speex/1.2~rc1-7
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ libspeex/speex_header.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/libspeex/speex_header.c b/libspeex/speex_header.c
+index b743059..92cc0d4 100644
+--- a/libspeex/speex_header.c
++++ b/libspeex/speex_header.c
+@@ -147,20 +147,21 @@ EXPORT SpeexHeader *speex_packet_to_header(char *packet, int size)
+ int i;
+ SpeexHeader *le_header;
+ const char *h = "Speex ";
+- for (i=0;i<8;i++)
+- if (packet[i]!=h[i])
+- {
+- speex_notify("This doesn't look like a Speex file");
+- return NULL;
+- }
+-
++
+ /*FIXME: Do we allow larger headers?*/
+ if (size < (int)sizeof(SpeexHeader))
+ {
+ speex_notify("Speex header too small");
+ return NULL;
+ }
+-
++
++ for (i=0;i<8;i++)
++ if (packet[i]!=h[i])
++ {
++ speex_notify("This doesn't look like a Speex file");
++ return NULL;
++ }
++
+ le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader));
+
+ SPEEX_COPY(le_header, (SpeexHeader*)packet, 1);
diff --git a/patches/speex-1.2rc1/0002-resample.patch b/patches/speex-1.2rc1/0002-resample.patch
new file mode 100644
index 000000000..db79c6fb0
--- /dev/null
+++ b/patches/speex-1.2rc1/0002-resample.patch
@@ -0,0 +1,84 @@
+From: Ron Lee <ron@debian.org>
+Date: Fri, 11 Jan 2013 12:13:50 +0100
+Subject: [PATCH] resample
+
+from: http://patch-tracker.debian.org/package/speex/1.2~rc1-7
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ libspeex/resample.c | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/libspeex/resample.c b/libspeex/resample.c
+index bebd1a8..0a0296b 100644
+--- a/libspeex/resample.c
++++ b/libspeex/resample.c
+@@ -561,8 +561,8 @@ static void update_filter(SpeexResamplerState *st)
+ st->cutoff = quality_map[st->quality].downsample_bandwidth * st->den_rate / st->num_rate;
+ /* FIXME: divide the numerator and denominator by a certain amount if they're too large */
+ st->filt_len = st->filt_len*st->num_rate / st->den_rate;
+- /* Round down to make sure we have a multiple of 4 */
+- st->filt_len &= (~0x3);
++ /* Round up to make sure we have a multiple of 8 for SSE */
++ st->filt_len = ((st->filt_len-1)&(~0x7))+8;
+ if (2*st->den_rate < st->num_rate)
+ st->oversample >>= 1;
+ if (4*st->den_rate < st->num_rate)
+@@ -579,7 +579,7 @@ static void update_filter(SpeexResamplerState *st)
+ }
+
+ /* Choose the resampling type that requires the least amount of memory */
+- if (st->den_rate <= st->oversample)
++ if (st->filt_len*st->den_rate <= st->filt_len*st->oversample+8)
+ {
+ spx_uint32_t i;
+ if (!st->sinc_table)
+@@ -756,9 +756,9 @@ EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ #endif
+
+ /* Per channel data */
+- st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(int));
+- st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int));
+- st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int));
++ st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(spx_int32_t));
++ st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
++ st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
+ for (i=0;i<nb_channels;i++)
+ {
+ st->last_sample[i] = 0;
+@@ -954,13 +954,15 @@ EXPORT int speex_resampler_process_interleaved_float(SpeexResamplerState *st, co
+ {
+ spx_uint32_t i;
+ int istride_save, ostride_save;
+- spx_uint32_t bak_len = *out_len;
++ spx_uint32_t bak_out_len = *out_len;
++ spx_uint32_t bak_in_len = *in_len;
+ istride_save = st->in_stride;
+ ostride_save = st->out_stride;
+ st->in_stride = st->out_stride = st->nb_channels;
+ for (i=0;i<st->nb_channels;i++)
+ {
+- *out_len = bak_len;
++ *out_len = bak_out_len;
++ *in_len = bak_in_len;
+ if (in != NULL)
+ speex_resampler_process_float(st, i, in+i, in_len, out+i, out_len);
+ else
+@@ -975,13 +977,15 @@ EXPORT int speex_resampler_process_interleaved_int(SpeexResamplerState *st, cons
+ {
+ spx_uint32_t i;
+ int istride_save, ostride_save;
+- spx_uint32_t bak_len = *out_len;
++ spx_uint32_t bak_out_len = *out_len;
++ spx_uint32_t bak_in_len = *in_len;
+ istride_save = st->in_stride;
+ ostride_save = st->out_stride;
+ st->in_stride = st->out_stride = st->nb_channels;
+ for (i=0;i<st->nb_channels;i++)
+ {
+- *out_len = bak_len;
++ *out_len = bak_out_len;
++ *in_len = bak_in_len;
+ if (in != NULL)
+ speex_resampler_process_int(st, i, in+i, in_len, out+i, out_len);
+ else
diff --git a/patches/speex-1.2rc1/0003-Make-speex-Thumb2-compatible.patch b/patches/speex-1.2rc1/0003-Make-speex-Thumb2-compatible.patch
new file mode 100644
index 000000000..f47df1dc9
--- /dev/null
+++ b/patches/speex-1.2rc1/0003-Make-speex-Thumb2-compatible.patch
@@ -0,0 +1,228 @@
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Fri, 11 Jan 2013 12:13:50 +0100
+Subject: [PATCH] Make speex Thumb2 compatible
+
+Patch written by Michael Hope from Linaro, available at
+http://lists.xiph.org/pipermail/speex-dev/2010-November/008041.html.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ libspeex/filters_arm4.h | 3 +++
+ libspeex/fixed_arm4.h | 18 ++++++++++++++++++
+ libspeex/fixed_arm5e.h | 18 ++++++++++++++++++
+ 3 files changed, 39 insertions(+)
+
+diff --git a/libspeex/filters_arm4.h b/libspeex/filters_arm4.h
+index 7a74042..6ec1f75 100644
+--- a/libspeex/filters_arm4.h
++++ b/libspeex/filters_arm4.h
+@@ -47,8 +47,10 @@ int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int le
+
+ "\tldr %4, [%0], #4 \n"
+ "\tcmps %4, %1 \n"
++ "\tit gt \n"
+ "\tmovgt %1, %4 \n"
+ "\tcmps %4, %3 \n"
++ "\tit lt \n"
+ "\tmovlt %3, %4 \n"
+
+ "\tsubs %2, %2, #1 \n"
+@@ -56,6 +58,7 @@ int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int le
+
+ "\trsb %3, %3, #0 \n"
+ "\tcmp %1, %3 \n"
++ "\tit lt \n"
+ "\tmovlt %1, %3 \n"
+ : "=r" (dead1), "=r" (max_val), "=r" (dead3), "=r" (dead4),
+ "=r" (dead5), "=r" (dead6)
+diff --git a/libspeex/fixed_arm4.h b/libspeex/fixed_arm4.h
+index b6981ca..b6218ca 100644
+--- a/libspeex/fixed_arm4.h
++++ b/libspeex/fixed_arm4.h
+@@ -69,72 +69,90 @@ static inline short DIV32_16(int a, int b)
+ __asm__ __volatile__ (
+ "\teor %5, %0, %1\n"
+ "\tmovs %4, %0\n"
++ "\tit mi \n"
+ "\trsbmi %0, %0, #0 \n"
+ "\tmovs %4, %1\n"
++ "\tit mi \n"
+ "\trsbmi %1, %1, #0 \n"
+ "\tmov %4, #1\n"
+
+ "\tsubs %3, %0, %1, asl #14 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #14 \n"
+
+ "\tsubs %3, %0, %1, asl #13 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #13 \n"
+
+ "\tsubs %3, %0, %1, asl #12 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #12 \n"
+
+ "\tsubs %3, %0, %1, asl #11 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #11 \n"
+
+ "\tsubs %3, %0, %1, asl #10 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #10 \n"
+
+ "\tsubs %3, %0, %1, asl #9 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #9 \n"
+
+ "\tsubs %3, %0, %1, asl #8 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #8 \n"
+
+ "\tsubs %3, %0, %1, asl #7 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #7 \n"
+
+ "\tsubs %3, %0, %1, asl #6 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #6 \n"
+
+ "\tsubs %3, %0, %1, asl #5 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #5 \n"
+
+ "\tsubs %3, %0, %1, asl #4 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #4 \n"
+
+ "\tsubs %3, %0, %1, asl #3 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #3 \n"
+
+ "\tsubs %3, %0, %1, asl #2 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #2 \n"
+
+ "\tsubs %3, %0, %1, asl #1 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #1 \n"
+
+ "\tsubs %3, %0, %1 \n"
++ "\titt pl \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4 \n"
+
+ "\tmovs %5, %5, lsr #31 \n"
++ "\tit ne \n"
+ "\trsbne %2, %2, #0 \n"
+ : "=r" (dead1), "=r" (dead2), "=r" (res),
+ "=r" (dead3), "=r" (dead4), "=r" (dead5)
+diff --git a/libspeex/fixed_arm5e.h b/libspeex/fixed_arm5e.h
+index 9b4861c..bdadd02 100644
+--- a/libspeex/fixed_arm5e.h
++++ b/libspeex/fixed_arm5e.h
+@@ -97,72 +97,90 @@ static inline short DIV32_16(int a, int b)
+ __asm__ __volatile__ (
+ "\teor %5, %0, %1\n"
+ "\tmovs %4, %0\n"
++ "\tit mi \n"
+ "\trsbmi %0, %0, #0 \n"
+ "\tmovs %4, %1\n"
++ "\tit mi \n"
+ "\trsbmi %1, %1, #0 \n"
+ "\tmov %4, #1\n"
+
+ "\tsubs %3, %0, %1, asl #14 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #14 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #13 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #13 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #12 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #12 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #11 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #11 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #10 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #10 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #9 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #9 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #8 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #8 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #7 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #7 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #6 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #6 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #5 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #5 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #4 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #4 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #3 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #3 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #2 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #2 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1, asl #1 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4, asl #1 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tsubs %3, %0, %1 \n"
++ "\titt pl \n"
+ "\torrpl %2, %2, %4 \n"
+ "\tmovpl %0, %3 \n"
+
+ "\tmovs %5, %5, lsr #31 \n"
++ "\tit ne \n"
+ "\trsbne %2, %2, #0 \n"
+ : "=r" (dead1), "=r" (dead2), "=r" (res),
+ "=r" (dead3), "=r" (dead4), "=r" (dead5)
diff --git a/patches/speex-1.2rc1/series b/patches/speex-1.2rc1/series
new file mode 100644
index 000000000..a708dd0f7
--- /dev/null
+++ b/patches/speex-1.2rc1/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-speex_header.patch
+0002-resample.patch
+0003-Make-speex-Thumb2-compatible.patch
+# 15de47bd7bc882627946c5258a755571 - git-ptx-patches magic