[FFmpeg-devel] [PATCH] mips: Add dependencies on HAVE_INLINE_ASM
Nedeljko Babic
nbabic at mips.com
Tue Nov 6 16:24:35 CET 2012
Add dependencies on HAVE_INLINE_ASM for files and parts of code
where it is necessary.
Signed-off-by: Nedeljko Babic <nbabic at mips.com>
---
libavcodec/mips/Makefile | 4 ++--
libavcodec/mips/acelp_filters_mips.c | 5 +++++
libavcodec/mips/acelp_vectors_mips.c | 5 +++++
libavcodec/mips/amrwbdec_mips.c | 2 ++
libavcodec/mips/celp_filters_mips.c | 5 +++++
libavcodec/mips/celp_math_mips.c | 5 +++++
libavcodec/mips/dsputil_mips.c | 4 ++++
libavcodec/mips/fft_mips.c | 4 ++--
libavcodec/mips/fmtconvert_mips.c | 4 ++++
libavcodec/mpegaudiodec.c | 8 ++++----
10 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile
index 2f053c9..f4c6ac8 100644
--- a/libavcodec/mips/Makefile
+++ b/libavcodec/mips/Makefile
@@ -11,5 +11,5 @@ MIPSFPU-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_float.o
MIPSDSPR1-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_fixed.o
OBJS-$(CONFIG_FFT) += mips/fft_init_table.o
MIPSFPU-OBJS-$(CONFIG_FFT) += mips/fft_mips.o
-MIPSFPU-OBJS-$(HAVE_INLINE_ASM) += mips/fmtconvert_mips.o
-MIPSFPU-OBJS-$(HAVE_INLINE_ASM) += mips/dsputil_mips.o
+MIPSFPU-OBJS += mips/dsputil_mips.o \
+ mips/fmtconvert_mips.o
diff --git a/libavcodec/mips/acelp_filters_mips.c b/libavcodec/mips/acelp_filters_mips.c
index 498660b..1e0845c 100644
--- a/libavcodec/mips/acelp_filters_mips.c
+++ b/libavcodec/mips/acelp_filters_mips.c
@@ -51,9 +51,11 @@
* @file
* Reference: libavcodec/acelp_filters.c
*/
+#include "config.h"
#include "libavutil/attributes.h"
#include "libavcodec/acelp_filters.h"
+#if HAVE_INLINE_ASM
static void ff_acelp_interpolatef_mips(float *out, const float *in,
const float *filter_coeffs, int precision,
int frac_pos, int filter_length, int length)
@@ -202,9 +204,12 @@ static void ff_acelp_apply_order_2_transfer_function_mips(float *out, const floa
"$f12", "$f13", "$f14", "$f15", "$f16"
);
}
+#endif /* HAVE_INLINE_ASM */
void ff_acelp_filter_init_mips(ACELPFContext *c)
{
+#if HAVE_INLINE_ASM
c->acelp_interpolatef = ff_acelp_interpolatef_mips;
c->acelp_apply_order_2_transfer_function = ff_acelp_apply_order_2_transfer_function_mips;
+#endif
}
diff --git a/libavcodec/mips/acelp_vectors_mips.c b/libavcodec/mips/acelp_vectors_mips.c
index 6f9390f..e00b34e 100644
--- a/libavcodec/mips/acelp_vectors_mips.c
+++ b/libavcodec/mips/acelp_vectors_mips.c
@@ -52,8 +52,10 @@
* @file
* Reference: libavcodec/acelp_vectors.c
*/
+#include "config.h"
#include "libavcodec/acelp_vectors.h"
+#if HAVE_INLINE_ASM
static void ff_weighted_vector_sumf_mips(
float *out, const float *in_a, const float *in_b,
float weight_coeff_a, float weight_coeff_b, int length)
@@ -89,8 +91,11 @@ static void ff_weighted_vector_sumf_mips(
: "$f0", "$f1", "$f2", "$f3", "$f4", "$f5"
);
}
+#endif /* HAVE_INLINE_ASM */
void ff_acelp_vectors_init_mips(ACELPVContext *c)
{
+#if HAVE_INLINE_ASM
c->weighted_vector_sumf = ff_weighted_vector_sumf_mips;
+#endif
}
diff --git a/libavcodec/mips/amrwbdec_mips.c b/libavcodec/mips/amrwbdec_mips.c
index 4bfbb8c..77fae6c 100644
--- a/libavcodec/mips/amrwbdec_mips.c
+++ b/libavcodec/mips/amrwbdec_mips.c
@@ -53,6 +53,7 @@
#include "libavcodec/amrwbdata.h"
#include "amrwbdec_mips.h"
+#if HAVE_INLINE_ASM
void hb_fir_filter_mips(float *out, const float fir_coef[HB_FIR_SIZE + 1],
float mem[HB_FIR_SIZE], const float *in)
{
@@ -183,3 +184,4 @@ void hb_fir_filter_mips(float *out, const float fir_coef[HB_FIR_SIZE + 1],
}
memcpy(mem, data + AMRWB_SFR_SIZE_16k, HB_FIR_SIZE * sizeof(float));
}
+#endif /* HAVE_INLINE_ASM */
diff --git a/libavcodec/mips/celp_filters_mips.c b/libavcodec/mips/celp_filters_mips.c
index 06e0127..5ecde00 100644
--- a/libavcodec/mips/celp_filters_mips.c
+++ b/libavcodec/mips/celp_filters_mips.c
@@ -51,10 +51,12 @@
* @file
* Reference: libavcodec/celp_filters.c
*/
+#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavcodec/celp_filters.h"
+#if HAVE_INLINE_ASM
static void ff_celp_lp_synthesis_filterf_mips(float *out,
const float *filter_coeffs,
const float* in, int buffer_length,
@@ -273,9 +275,12 @@ static void ff_celp_lp_zero_synthesis_filterf_mips(float *out,
out[n] = sum_out1;
}
}
+#endif /* HAVE_INLINE_ASM */
void ff_celp_filter_init_mips(CELPFContext *c)
{
+#if HAVE_INLINE_ASM
c->celp_lp_synthesis_filterf = ff_celp_lp_synthesis_filterf_mips;
c->celp_lp_zero_synthesis_filterf = ff_celp_lp_zero_synthesis_filterf_mips;
+#endif
}
diff --git a/libavcodec/mips/celp_math_mips.c b/libavcodec/mips/celp_math_mips.c
index 6ab1823..f0335c9 100644
--- a/libavcodec/mips/celp_math_mips.c
+++ b/libavcodec/mips/celp_math_mips.c
@@ -51,8 +51,10 @@
* @file
* Reference: libavcodec/celp_math.c
*/
+#include "config.h"
#include "libavcodec/celp_math.h"
+#if HAVE_INLINE_ASM
static float ff_dot_productf_mips(const float* a, const float* b,
int length)
{
@@ -77,8 +79,11 @@ static float ff_dot_productf_mips(const float* a, const float* b,
);
return sum;
}
+#endif /* HAVE_INLINE_ASM */
void ff_celp_math_init_mips(CELPMContext *c)
{
+#if HAVE_INLINE_ASM
c->dot_productf = ff_dot_productf_mips;
+#endif
}
diff --git a/libavcodec/mips/dsputil_mips.c b/libavcodec/mips/dsputil_mips.c
index e46a0a9..76dc664 100644
--- a/libavcodec/mips/dsputil_mips.c
+++ b/libavcodec/mips/dsputil_mips.c
@@ -47,6 +47,7 @@
#include "config.h"
#include "libavcodec/dsputil.h"
+#if HAVE_INLINE_ASM
static void vector_fmul_window_mips(float *dst, const float *src0,
const float *src1, const float *win, int len)
{
@@ -157,8 +158,11 @@ static void vector_fmul_window_mips(float *dst, const float *src0,
);
}
}
+#endif /* HAVE_INLINE_ASM */
av_cold void ff_dsputil_init_mips( DSPContext* c, AVCodecContext *avctx )
{
+#if HAVE_INLINE_ASM
c->vector_fmul_window = vector_fmul_window_mips;
+#endif
}
diff --git a/libavcodec/mips/fft_mips.c b/libavcodec/mips/fft_mips.c
index 2b1c508..8a2d86e 100644
--- a/libavcodec/mips/fft_mips.c
+++ b/libavcodec/mips/fft_mips.c
@@ -485,7 +485,6 @@ static void ff_imdct_half_mips(FFTContext *s, FFTSample *output, const FFTSample
z2[1].im = temp12;
}
}
-#endif /* HAVE_INLINE_ASM */
/**
* Compute inverse MDCT of size N = 2^nbits
@@ -513,6 +512,7 @@ static void ff_imdct_calc_mips(FFTContext *s, FFTSample *output, const FFTSample
output[n-k-4] = output[n2+k+3];
}
}
+#endif /* HAVE_INLINE_ASM */
av_cold void ff_fft_init_mips(FFTContext *s)
{
@@ -522,9 +522,9 @@ av_cold void ff_fft_init_mips(FFTContext *s)
#if HAVE_INLINE_ASM
s->fft_calc = ff_fft_calc_mips;
-#endif
#if CONFIG_MDCT
s->imdct_calc = ff_imdct_calc_mips;
s->imdct_half = ff_imdct_half_mips;
#endif
+#endif
}
diff --git a/libavcodec/mips/fmtconvert_mips.c b/libavcodec/mips/fmtconvert_mips.c
index f89d3b6..8a0265f 100644
--- a/libavcodec/mips/fmtconvert_mips.c
+++ b/libavcodec/mips/fmtconvert_mips.c
@@ -51,6 +51,7 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/fmtconvert.h"
+#if HAVE_INLINE_ASM
#if HAVE_MIPSDSPR1
static void float_to_int16_mips(int16_t *dst, const float *src, long len)
{
@@ -327,12 +328,15 @@ static void int32_to_float_fmul_scalar_mips(float *dst, const int *src,
: "memory"
);
}
+#endif /* HAVE_INLINE_ASM */
av_cold void ff_fmt_convert_init_mips(FmtConvertContext *c)
{
+#if HAVE_INLINE_ASM
#if HAVE_MIPSDSPR1
c->float_to_int16_interleave = float_to_int16_interleave_mips;
c->float_to_int16 = float_to_int16_mips;
#endif
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_mips;
+#endif
}
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index f0256f3..c7476d0 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1172,13 +1172,13 @@ found2:
}
#if CONFIG_FLOAT
-#if HAVE_MIPSFPU
+#if HAVE_MIPSFPU && HAVE_INLINE_ASM
# include "mips/compute_antialias_float.h"
-#endif /* HAVE_MIPSFPU */
+#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM */
#else
-#if HAVE_MIPSDSPR1
+#if HAVE_MIPSDSPR1 && HAVE_INLINE_ASM
# include "mips/compute_antialias_fixed.h"
-#endif /* HAVE_MIPSDSPR1 */
+#endif /* HAVE_MIPSDSPR1 && HAVE_INLINE_ASM */
#endif /* CONFIG_FLOAT */
#ifndef compute_antialias
--
1.7.3.4
More information about the ffmpeg-devel
mailing list