summaryrefslogtreecommitdiff
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2016-09-09 18:30:51 +0200
committerDiego Biurrun <diego@biurrun.de>2016-09-11 23:30:40 +0200
commit468bfe38c66d4d020984158e53b09a6a5749f394 (patch)
tree5ebbf38aa44eb9491e33b65c6f2859c54acdb1ae /libavcodec/ppc
parent6ce93757ee6b81fe727bfdc9f546fd0ddf9139c3 (diff)
downloadffmpeg-468bfe38c66d4d020984158e53b09a6a5749f394.tar.gz
ppc: mpegvideo: Add proper runtime AltiVec detection
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/mpegvideodsp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ppc/mpegvideodsp.c b/libavcodec/ppc/mpegvideodsp.c
index e6c0457cd6..eef3e1dcbe 100644
--- a/libavcodec/ppc/mpegvideodsp.c
+++ b/libavcodec/ppc/mpegvideodsp.c
@@ -20,7 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/cpu.h"
#include "libavutil/mem.h"
+#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/mpegvideodsp.h"
@@ -128,6 +130,9 @@ static void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */,
av_cold void ff_mpegvideodsp_init_ppc(MpegVideoDSPContext *c)
{
#if HAVE_ALTIVEC && HAVE_BIGENDIAN
+ if (!PPC_ALTIVEC(av_get_cpu_flags()))
+ return;
+
c->gmc1 = gmc1_altivec;
#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
}