[FFmpeg-devel] [PATCH] swr: add prototypes for resample dsp functions

James Almer jamrial at gmail.com
Sat Jun 14 23:32:55 CEST 2014


Also remove obsolete prototypes in x86/resample_mmx.h
Should fix compilation failures with MSVC and any other compiler
without inline asm support.

Signed-off-by: James Almer <jamrial at gmail.com>
---
Ronald's ARCH_X86_32 patch can be applied after this.

 libswresample/resample_dsp.c         |  9 +++++++++
 libswresample/resample_template.c    | 12 ++++++------
 libswresample/x86/resample_mmx.h     |  6 ------
 libswresample/x86/resample_x86_dsp.c | 11 +++++++++++
 4 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/libswresample/resample_dsp.c b/libswresample/resample_dsp.c
index a48a5a9..79cecad 100644
--- a/libswresample/resample_dsp.c
+++ b/libswresample/resample_dsp.c
@@ -27,6 +27,15 @@
 
 #include "resample.h"
 
+int resample_common_int16 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx);
+int resample_common_int32 (ResampleContext *c, int32_t *dst, const int32_t *src, int n, int update_ctx);
+int resample_common_float (ResampleContext *c,   float *dst, const   float *src, int n, int update_ctx);
+int resample_common_double(ResampleContext *c,  double *dst, const  double *src, int n, int update_ctx);
+int resample_linear_int16 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx);
+int resample_linear_int32 (ResampleContext *c, int32_t *dst, const int32_t *src, int n, int update_ctx);
+int resample_linear_float (ResampleContext *c,   float *dst, const   float *src, int n, int update_ctx);
+int resample_linear_double(ResampleContext *c,  double *dst, const  double *src, int n, int update_ctx);
+
 #define DO_RESAMPLE_ONE 1
 
 #define TEMPLATE_RESAMPLE_S16
diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c
index 6773e3e..b1fbe76 100644
--- a/libswresample/resample_template.c
+++ b/libswresample/resample_template.c
@@ -119,9 +119,9 @@ static void RENAME(resample_one)(DELEM *dst, const DELEM *src,
 }
 #endif
 
-static int RENAME(resample_common)(ResampleContext *c,
-                                   DELEM *dst, const DELEM *src,
-                                   int n, int update_ctx)
+int RENAME(resample_common)(ResampleContext *c,
+                            DELEM *dst, const DELEM *src,
+                            int n, int update_ctx)
 {
             int dst_index;
             int index= c->index;
@@ -163,9 +163,9 @@ static int RENAME(resample_common)(ResampleContext *c,
     return sample_index;
 }
 
-static int RENAME(resample_linear)(ResampleContext *c,
-                                   DELEM *dst, const DELEM *src,
-                                   int n, int update_ctx)
+int RENAME(resample_linear)(ResampleContext *c,
+                            DELEM *dst, const DELEM *src,
+                            int n, int update_ctx)
 {
             int dst_index;
             int index= c->index;
diff --git a/libswresample/x86/resample_mmx.h b/libswresample/x86/resample_mmx.h
index 36c7a06..a4da1e9 100644
--- a/libswresample/x86/resample_mmx.h
+++ b/libswresample/x86/resample_mmx.h
@@ -22,12 +22,6 @@
 #include "libavutil/cpu.h"
 #include "libswresample/swresample_internal.h"
 
-int swri_resample_int16_mmx2 (struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx);
-int swri_resample_int16_sse2 (struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx);
-int swri_resample_float_sse  (struct ResampleContext *c,   float *dst, const   float *src, int *consumed, int src_size, int dst_size, int update_ctx);
-int swri_resample_float_avx  (struct ResampleContext *c,   float *dst, const   float *src, int *consumed, int src_size, int dst_size, int update_ctx);
-int swri_resample_double_sse2(struct ResampleContext *c,  double *dst, const  double *src, int *consumed, int src_size, int dst_size, int update_ctx);
-
 DECLARE_ALIGNED(16, const uint64_t, ff_resample_int16_rounder)[2]    = { 0x0000000000004000ULL, 0x0000000000000000ULL};
 
 #define COMMON_CORE_INT16_MMX2 \
diff --git a/libswresample/x86/resample_x86_dsp.c b/libswresample/x86/resample_x86_dsp.c
index 02a7db5..da0736a 100644
--- a/libswresample/x86/resample_x86_dsp.c
+++ b/libswresample/x86/resample_x86_dsp.c
@@ -27,6 +27,17 @@
 
 #include "libswresample/resample.h"
 
+int resample_common_int16_mmx2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx);
+int resample_linear_int16_mmx2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx);
+int resample_common_int16_sse2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx);
+int resample_linear_int16_sse2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx);
+int resample_common_float_sse  (ResampleContext *c,   float *dst, const   float *src, int n, int update_ctx);
+int resample_linear_float_sse  (ResampleContext *c,   float *dst, const   float *src, int n, int update_ctx);
+int resample_common_float_avx  (ResampleContext *c,   float *dst, const   float *src, int n, int update_ctx);
+int resample_linear_float_avx  (ResampleContext *c,   float *dst, const   float *src, int n, int update_ctx);
+int resample_common_double_sse2(ResampleContext *c,  double *dst, const  double *src, int n, int update_ctx);
+int resample_linear_double_sse2(ResampleContext *c,  double *dst, const  double *src, int n, int update_ctx);
+
 #if HAVE_MMXEXT_INLINE
 
 #define DO_RESAMPLE_ONE 0
-- 
1.8.5.5



More information about the ffmpeg-devel mailing list