summaryrefslogtreecommitdiff
path: root/libswresample/resample_template.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-06-30 13:06:00 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-07-01 17:57:36 +0200
commitdd2c9034b174a2b17f8e3ed972c49720bab1d4c1 (patch)
tree58e5f807fc8a7f0bd9f31e69fbba164a0cac0f40 /libswresample/resample_template.c
parentfb318def5d3a65efcc6c1f54dabbc06c4959dbcc (diff)
x86/swr: convert resample_{common, linear}_double_sse2 to yasm
Signed-off-by: James Almer <jamrial@gmail.com> 312531 -> 311528 dezicycles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/resample_template.c')
-rw-r--r--libswresample/resample_template.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c
index 2a64f50038..4f1638edb1 100644
--- a/libswresample/resample_template.c
+++ b/libswresample/resample_template.c
@@ -25,23 +25,15 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-#if defined(TEMPLATE_RESAMPLE_DBL) \
- || defined(TEMPLATE_RESAMPLE_DBL_SSE2)
+#if defined(TEMPLATE_RESAMPLE_DBL)
+# define RENAME(N) N ## _double
# define FILTER_SHIFT 0
# define DELEM double
# define FELEM double
# define FELEM2 double
# define OUT(d, v) d = v
-# if defined(TEMPLATE_RESAMPLE_DBL)
-# define RENAME(N) N ## _double
-# elif defined(TEMPLATE_RESAMPLE_DBL_SSE2)
-# define COMMON_CORE COMMON_CORE_DBL_SSE2
-# define LINEAR_CORE LINEAR_CORE_DBL_SSE2
-# define RENAME(N) N ## _double_sse2
-# endif
-
#elif defined(TEMPLATE_RESAMPLE_FLT)
# define RENAME(N) N ## _float
@@ -104,16 +96,12 @@ int RENAME(swri_resample_common)(ResampleContext *c,
for (dst_index = 0; dst_index < n; dst_index++) {
FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index;
-#ifdef COMMON_CORE
- COMMON_CORE
-#else
FELEM2 val=0;
int i;
for (i = 0; i < c->filter_length; i++) {
val += src[sample_index + i] * (FELEM2)filter[i];
}
OUT(dst[dst_index], val);
-#endif
frac += c->dst_incr_mod;
index += c->dst_incr_div;
@@ -150,15 +138,11 @@ int RENAME(swri_resample_linear)(ResampleContext *c,
FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index;
FELEM2 val=0, v2 = 0;
-#ifdef LINEAR_CORE
- LINEAR_CORE
-#else
int i;
for (i = 0; i < c->filter_length; i++) {
val += src[sample_index + i] * (FELEM2)filter[i];
v2 += src[sample_index + i] * (FELEM2)filter[i + c->filter_alloc];
}
-#endif
#ifdef FELEML
val += (v2 - val) * (FELEML) frac / c->src_incr;
#else
@@ -188,8 +172,6 @@ int RENAME(swri_resample_linear)(ResampleContext *c,
return sample_index;
}
-#undef COMMON_CORE
-#undef LINEAR_CORE
#undef RENAME
#undef FILTER_SHIFT
#undef DELEM