#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/h264chroma.h"
-#include "dsputil_altivec.h"
-#if HAVE_ALTIVEC
+#if HAVE_ALTIVEC && HAVE_BIGENDIAN
#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
#define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
av_cold void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth)
{
-#if HAVE_ALTIVEC
+#if HAVE_ALTIVEC && HAVE_BIGENDIAN
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;
+
if (!high_bit_depth) {
c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
}
- }
#endif /* HAVE_ALTIVEC */
}