Skip to content

Commit

Permalink
ffmpeg PowerPC fixes (#8181)
Browse files Browse the repository at this point in the history
* ffmpeg: vec_xl intrinsic does not exist on older PowerPC processors

use upstream patch (not yet committed)
closes: https://trac.macports.org/ticket/61001

* ffmpeg: remove no-longer-needed compiler selection

this is now taken care of by base and the
compiler.c_standard setting
  • Loading branch information
kencu authored Aug 23, 2020
1 parent 65b5702 commit 8964eba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
12 changes: 4 additions & 8 deletions multimedia/ffmpeg/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ depends_lib port:lame \

patchfiles patch-libavcodec-audiotoolboxenc.c.diff

# work around vec_xl intrinsic does not exist on older PowerPC processors
# https://trac.ffmpeg.org/ticket/8750
patchfiles-append patch-ffmpeg-powerpc-yuv2rgb-altivec-fix.diff

#
# enable auto configure of asm optimizations
# requires Xcode 3.1 or better on Leopard
Expand All @@ -105,14 +109,6 @@ if {[lsearch [get_canonical_archs] i386] != -1} {
compiler.blacklist-append {clang < 422.1.7}
}

platform darwin powerpc {
# https://trac.macports.org/ticket/55124
# requires newer compiler than gcc4.2 to build
compiler.blacklist
compiler.whitelist macports-gcc-6
universal_variant no
}

# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
default_variants-append +gpl2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- libswscale/ppc/yuv2rgb_altivec.c.orig 2020-08-22 16:39:38.000000000 -0700
+++ libswscale/ppc/yuv2rgb_altivec.c 2020-08-22 16:46:11.000000000 -0700
@@ -283,6 +283,17 @@
* ------------------------------------------------------------------------------
*/

+
+#if !HAVE_VSX
+static inline vector unsigned char vec_xl(signed long long offset, const ubyte *addr)
+{
+ const vector unsigned char *v_addr = (const vector unsigned char *) (addr + offset);
+ vector unsigned char align_perm = vec_lvsl(offset, addr);
+
+ return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
+}
+#endif /* !HAVE_VSX */
+
#define DEFCSP420_CVT(name, out_pixels) \
static int altivec_ ## name(SwsContext *c, const unsigned char **in, \
int *instrides, int srcSliceY, int srcSliceH, \

0 comments on commit 8964eba

Please sign in to comment.