[FFmpeg-cvslog] Merge commit '468bfe38c66d4d020984158e53b09a6a5749f394'

Clément Bœsch git at videolan.org
Mon Mar 20 13:08:38 EET 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Mar 20 12:08:11 2017 +0100| [8e9dfe0d298b34cfbcdc5d7cbd8daab513fbfce4] | committer: Clément Bœsch

Merge commit '468bfe38c66d4d020984158e53b09a6a5749f394'

* commit '468bfe38c66d4d020984158e53b09a6a5749f394':
  ppc: mpegvideo: Add proper runtime AltiVec detection

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e9dfe0d298b34cfbcdc5d7cbd8daab513fbfce4
---

 libavcodec/ppc/mpegvideodsp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/ppc/mpegvideodsp.c b/libavcodec/ppc/mpegvideodsp.c
index 7696954..0219332 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
+    if (!PPC_ALTIVEC(av_get_cpu_flags()))
+        return;
+
     c->gmc1 = gmc1_altivec;
 #endif /* HAVE_ALTIVEC */
 }


======================================================================

diff --cc libavcodec/ppc/mpegvideodsp.c
index 7696954,eef3e1d..0219332
--- a/libavcodec/ppc/mpegvideodsp.c
+++ b/libavcodec/ppc/mpegvideodsp.c
@@@ -127,7 -129,10 +129,10 @@@ static void gmc1_altivec(uint8_t *dst /
  
  av_cold void ff_mpegvideodsp_init_ppc(MpegVideoDSPContext *c)
  {
 -#if HAVE_ALTIVEC && HAVE_BIGENDIAN
 +#if HAVE_ALTIVEC
+     if (!PPC_ALTIVEC(av_get_cpu_flags()))
+         return;
+ 
      c->gmc1 = gmc1_altivec;
 -#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
 +#endif /* HAVE_ALTIVEC */
  }



More information about the ffmpeg-cvslog mailing list