summaryrefslogtreecommitdiffstats
path: root/media/libspeex_resampler/hugemem.patch
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /media/libspeex_resampler/hugemem.patch
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'media/libspeex_resampler/hugemem.patch')
-rw-r--r--media/libspeex_resampler/hugemem.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/media/libspeex_resampler/hugemem.patch b/media/libspeex_resampler/hugemem.patch
new file mode 100644
index 000000000..4e1f5baa6
--- /dev/null
+++ b/media/libspeex_resampler/hugemem.patch
@@ -0,0 +1,56 @@
+diff --git a/media/libspeex_resampler/src/resample.c b/media/libspeex_resampler/src/resample.c
+--- a/media/libspeex_resampler/src/resample.c
++++ b/media/libspeex_resampler/src/resample.c
+@@ -56,16 +56,18 @@
+ (e.g. 2/3), and get rid of the rounding operations in the inner loop.
+ The latter both reduces CPU time and makes the algorithm more SIMD-friendly.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
++#define RESAMPLE_HUGEMEM 1
++
+ #ifdef OUTSIDE_SPEEX
+ #include <stdlib.h>
+ static void *speex_alloc (int size) {return calloc(size,1);}
+ static void *speex_realloc (void *ptr, int size) {return realloc(ptr, size);}
+ static void speex_free (void *ptr) {free(ptr);}
+ #include "speex_resampler.h"
+ #include "arch.h"
+ #else /* OUTSIDE_SPEEX */
+@@ -632,25 +634,26 @@ static int update_filter(SpeexResamplerS
+ st->oversample >>= 1;
+ if (st->oversample < 1)
+ st->oversample = 1;
+ } else {
+ /* up-sampling */
+ st->cutoff = quality_map[st->quality].upsample_bandwidth;
+ }
+
+- /* Choose the resampling type that requires the least amount of memory */
+-#ifdef RESAMPLE_FULL_SINC_TABLE
+- use_direct = 1;
+- if (INT_MAX/sizeof(spx_word16_t)/st->den_rate < st->filt_len)
+- goto fail;
++ use_direct =
++#ifdef RESAMPLE_HUGEMEM
++ /* Choose the direct resampler, even with higher initialization costs,
++ when resampling any multiple of 100 to 44100. */
++ st->den_rate <= 441
+ #else
+- use_direct = st->filt_len*st->den_rate <= st->filt_len*st->oversample+8
++ /* Choose the resampling type that requires the least amount of memory */
++ st->filt_len*st->den_rate <= st->filt_len*st->oversample+8
++#endif
+ && INT_MAX/sizeof(spx_word16_t)/st->den_rate >= st->filt_len;
+-#endif
+ if (use_direct)
+ {
+ min_sinc_table_length = st->filt_len*st->den_rate;
+ } else {
+ if ((INT_MAX/sizeof(spx_word16_t)-8)/st->oversample < st->filt_len)
+ goto fail;
+
+ min_sinc_table_length = st->filt_len*st->oversample+8;