ppc: Consistently use convenience macro for runtime CPU detection

pull/76/merge
Diego Biurrun 11 years ago
parent 205fdd4ea5
commit 27860819d5
  1. 3
      libavcodec/ppc/fft_altivec.c
  2. 3
      libavcodec/ppc/fmtconvert_altivec.c
  3. 3
      libavcodec/ppc/h264chroma_init.c
  4. 3
      libavcodec/ppc/h264dsp.c
  5. 3
      libavcodec/ppc/h264qpel.c
  6. 3
      libavcodec/ppc/hpeldsp_altivec.c
  7. 3
      libavcodec/ppc/mpegaudiodsp_altivec.c
  8. 3
      libavcodec/ppc/mpegvideo_altivec.c
  9. 3
      libavcodec/ppc/vc1dsp_altivec.c
  10. 3
      libavcodec/ppc/vorbisdsp_altivec.c
  11. 3
      libavcodec/ppc/vp3dsp_altivec.c
  12. 3
      libavcodec/ppc/vp8dsp_altivec.c

@ -22,6 +22,7 @@
#include "config.h" #include "config.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/fft.h" #include "libavcodec/fft.h"
@ -143,7 +144,7 @@ static void imdct_calc_altivec(FFTContext *s, FFTSample *output, const FFTSample
av_cold void ff_fft_init_ppc(FFTContext *s) av_cold void ff_fft_init_ppc(FFTContext *s)
{ {
#if HAVE_GNU_AS && HAVE_ALTIVEC #if HAVE_GNU_AS && HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
s->fft_calc = ff_fft_calc_interleave_altivec; s->fft_calc = ff_fft_calc_interleave_altivec;

@ -22,6 +22,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/fmtconvert.h" #include "libavcodec/fmtconvert.h"
@ -164,7 +165,7 @@ av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c,
AVCodecContext *avctx) AVCodecContext *avctx)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec; c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec;

@ -22,6 +22,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/h264chroma.h" #include "libavcodec/h264chroma.h"
@ -52,7 +53,7 @@ av_cold void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth)
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
const int high_bit_depth = bit_depth > 8; const int high_bit_depth = bit_depth > 8;
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
if (!high_bit_depth) { if (!high_bit_depth) {

@ -22,6 +22,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/h264data.h" #include "libavcodec/h264data.h"
@ -745,7 +746,7 @@ av_cold void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc) const int chroma_format_idc)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
if (bit_depth == 8) { if (bit_depth == 8) {

@ -22,6 +22,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/h264qpel.h" #include "libavcodec/h264qpel.h"
@ -288,7 +289,7 @@ av_cold void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth)
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
const int high_bit_depth = bit_depth > 8; const int high_bit_depth = bit_depth > 8;
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
if (!high_bit_depth) { if (!high_bit_depth) {

@ -28,6 +28,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/hpeldsp.h" #include "libavcodec/hpeldsp.h"
@ -449,7 +450,7 @@ static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdi
av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags) av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_altivec; c->avg_pixels_tab[0][0] = ff_avg_pixels16_altivec;

@ -23,6 +23,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/mpegaudiodsp.h" #include "libavcodec/mpegaudiodsp.h"
@ -132,7 +133,7 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,
av_cold void ff_mpadsp_init_ppc(MPADSPContext *s) av_cold void ff_mpadsp_init_ppc(MPADSPContext *s)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
s->apply_window_float = apply_window_mp3; s->apply_window_float = apply_window_mp3;

@ -27,6 +27,7 @@
#include "config.h" #include "config.h"
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/mpegvideo.h" #include "libavcodec/mpegvideo.h"
@ -117,7 +118,7 @@ static void dct_unquantize_h263_altivec(MpegEncContext *s,
av_cold void ff_MPV_common_init_ppc(MpegEncContext *s) av_cold void ff_MPV_common_init_ppc(MpegEncContext *s)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
if ((s->avctx->dct_algo == FF_DCT_AUTO) || if ((s->avctx->dct_algo == FF_DCT_AUTO) ||

@ -22,6 +22,7 @@
#include "config.h" #include "config.h"
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vc1dsp.h" #include "libavcodec/vc1dsp.h"
@ -344,7 +345,7 @@ static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block)
av_cold void ff_vc1dsp_init_ppc(VC1DSPContext *dsp) av_cold void ff_vc1dsp_init_ppc(VC1DSPContext *dsp)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec; dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec;

@ -24,6 +24,7 @@
#endif #endif
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavcodec/vorbisdsp.h" #include "libavcodec/vorbisdsp.h"
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
@ -54,7 +55,7 @@ static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
av_cold void ff_vorbisdsp_init_ppc(VorbisDSPContext *c) av_cold void ff_vorbisdsp_init_ppc(VorbisDSPContext *c)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
c->vorbis_inverse_coupling = vorbis_inverse_coupling_altivec; c->vorbis_inverse_coupling = vorbis_inverse_coupling_altivec;

@ -23,6 +23,7 @@
#include "config.h" #include "config.h"
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp3dsp.h" #include "libavcodec/vp3dsp.h"
@ -179,7 +180,7 @@ static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64])
av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags) av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
c->idct_put = vp3_idct_put_altivec; c->idct_put = vp3_idct_put_altivec;

@ -23,6 +23,7 @@
#include "config.h" #include "config.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp8dsp.h" #include "libavcodec/vp8dsp.h"
@ -315,7 +316,7 @@ static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *s
av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c) av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec; c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec;

Loading…
Cancel
Save