summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-29 15:04:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-29 15:04:59 +0200
commit4399e727237316c6491d800b7053dd44322c0ee7 (patch)
tree42bbe2b849ac8e420a04da06edb2b7c322ae7e52 /libavcodec
parent3e75f986675fe522dfe4e35c6bf761e9cb668597 (diff)
parent6af2c351b3ae61e4478950ffddd0dfcad06188b8 (diff)
downloadffmpeg-streaming-4399e727237316c6491d800b7053dd44322c0ee7.zip
ffmpeg-streaming-4399e727237316c6491d800b7053dd44322c0ee7.tar.gz
Merge commit '6af2c351b3ae61e4478950ffddd0dfcad06188b8'
* commit '6af2c351b3ae61e4478950ffddd0dfcad06188b8': ppc: Add missing AltiVec cpuflag detection invocations Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ppc/fft_altivec.c4
-rw-r--r--libavcodec/ppc/fmtconvert_altivec.c4
-rw-r--r--libavcodec/ppc/mpegaudiodsp_altivec.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/ppc/fft_altivec.c b/libavcodec/ppc/fft_altivec.c
index 92b7adb..2357198 100644
--- a/libavcodec/ppc/fft_altivec.c
+++ b/libavcodec/ppc/fft_altivec.c
@@ -21,6 +21,7 @@
*/
#include "config.h"
+#include "libavutil/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/fft.h"
@@ -142,6 +143,9 @@ static void imdct_calc_altivec(FFTContext *s, FFTSample *output, const FFTSample
av_cold void ff_fft_init_ppc(FFTContext *s)
{
#if HAVE_GNU_AS && HAVE_ALTIVEC
+ if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
+ return;
+
s->fft_calc = ff_fft_calc_interleave_altivec;
if (s->mdct_bits >= 5) {
s->imdct_calc = imdct_calc_altivec;
diff --git a/libavcodec/ppc/fmtconvert_altivec.c b/libavcodec/ppc/fmtconvert_altivec.c
index ee35754..cd32e39 100644
--- a/libavcodec/ppc/fmtconvert_altivec.c
+++ b/libavcodec/ppc/fmtconvert_altivec.c
@@ -20,6 +20,7 @@
#include "config.h"
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/fmtconvert.h"
@@ -164,6 +165,9 @@ av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c,
AVCodecContext *avctx)
{
#if HAVE_ALTIVEC
+ if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
+ return;
+
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec;
if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
c->float_to_int16 = float_to_int16_altivec;
diff --git a/libavcodec/ppc/mpegaudiodsp_altivec.c b/libavcodec/ppc/mpegaudiodsp_altivec.c
index 1d82f74..091f9a3 100644
--- a/libavcodec/ppc/mpegaudiodsp_altivec.c
+++ b/libavcodec/ppc/mpegaudiodsp_altivec.c
@@ -21,6 +21,7 @@
#include "config.h"
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
#include "libavutil/internal.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/mpegaudiodsp.h"
@@ -132,6 +133,9 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,
av_cold void ff_mpadsp_init_ppc(MPADSPContext *s)
{
#if HAVE_ALTIVEC
+ if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
+ return;
+
s->apply_window_float = apply_window_mp3;
#endif /* HAVE_ALTIVEC */
}
OpenPOWER on IntegriCloud