Commit 304a1ed1 authored by Nedeljko Babic's avatar Nedeljko Babic Committed by Michael Niedermayer

mips: Add dependencies on HAVE_INLINE_ASM

Add dependencies on HAVE_INLINE_ASM for files and parts of code
 where it is necessary.
Signed-off-by: 's avatarNedeljko Babic <nbabic@mips.com>
Reviewed-by: 's avatarVitor Sessak <vitor1001@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2d71f31d
......@@ -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
......@@ -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
}
......@@ -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
}
......@@ -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 */
......@@ -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
}
......@@ -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
}
......@@ -55,6 +55,7 @@
#ifndef AVCODEC_MIPS_COMPUTE_ANTIALIAS_FIXED_H
#define AVCODEC_MIPS_COMPUTE_ANTIALIAS_FIXED_H
#if HAVE_INLINE_ASM
static void compute_antialias_mips_fixed(MPADecodeContext *s,
GranuleDef *g)
{
......@@ -242,5 +243,6 @@ static void compute_antialias_mips_fixed(MPADecodeContext *s,
}
}
#define compute_antialias compute_antialias_mips_fixed
#endif /* HAVE_INLINE_ASM */
#endif /* AVCODEC_MIPS_COMPUTE_ANTIALIAS_FIXED_H */
......@@ -55,6 +55,7 @@
#ifndef AVCODEC_MIPS_COMPUTE_ANTIALIAS_FLOAT_H
#define AVCODEC_MIPS_COMPUTE_ANTIALIAS_FLOAT_H
#if HAVE_INLINE_ASM
static void compute_antialias_mips_float(MPADecodeContext *s,
GranuleDef *g)
{
......@@ -178,5 +179,6 @@ static void compute_antialias_mips_float(MPADecodeContext *s,
);
}
#define compute_antialias compute_antialias_mips_float
#endif /* HAVE_INLINE_ASM */
#endif /* AVCODEC_MIPS_COMPUTE_ANTIALIAS_FLOAT_H */
......@@ -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
}
......@@ -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
}
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment