aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--multimedia/transcode/Makefile20
-rw-r--r--multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:dsputil_mmx.c13
-rw-r--r--multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:motion_est_mmx.c12
-rw-r--r--multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:simple_idct_mmx.c15
4 files changed, 60 insertions, 0 deletions
diff --git a/multimedia/transcode/Makefile b/multimedia/transcode/Makefile
index e99edd4e25d6..ef2d89396059 100644
--- a/multimedia/transcode/Makefile
+++ b/multimedia/transcode/Makefile
@@ -107,6 +107,14 @@ WITH_LZO= yes
WITH_DIVX5= yes
.endif
+.if exists(${LOCALBASE}/lib/libjpeg-mmx.so)
+WITH_JPEGMMX= yes
+.endif
+
+.if defined(WITH_JPEGMMX)
+WITH_NASM= yes
+.endif
+
.if defined(WITH_LIBTHEORA)
LIB_DEPENDS+= theora.0:${PORTSDIR}/graphics/libtheora
.else
@@ -121,6 +129,14 @@ CONFIGURE_ARGS+= --with-magick-mods=no
PLIST_SUB+= WITH_IMAGEMAGICK="@comment "
.endif
+.if defined(WITH_JPEGMMX)
+LIB_DEPENDS+= jpeg-mmx.62:${PORTSDIR}/graphics/jpeg-mmx
+
+PLIST_SUB+= WITH_JPEGMMX=""
+.else
+PLIST_SUB+= WITH_JPEGMMX="@comment "
+.endif
+
.if defined(WITH_NASM)
BUILD_DEPENDS+= ${LOCALBASE}/bin/nasm:${PORTSDIR}/devel/nasm
ONLY_FOR_ARCHS= i386
@@ -250,6 +266,10 @@ pre-everything::
@${ECHO_MSG}
@${ECHO_MSG} "You can enable extra optimizations by defining WITH_OPTIMIZED_CFLAGS."
.endif
+.if !defined(WITH_JPEGMMX)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can enable JPEG with MMX by defining WITH_JPEGMMX."
+.endif
.if !defined(WITH_LIBTHEORA)
@${ECHO_MSG}
@${ECHO_MSG} "You can enable Libtheora by defining WITH_LIBTHEORA."
diff --git a/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:dsputil_mmx.c b/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:dsputil_mmx.c
new file mode 100644
index 000000000000..4ad4f716a2e1
--- /dev/null
+++ b/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:dsputil_mmx.c
@@ -0,0 +1,13 @@
+--- ffmpeg/libavcodec/i386/dsputil_mmx.c.orig Wed Nov 17 17:30:15 2004
++++ ffmpeg/libavcodec/i386/dsputil_mmx.c Wed Nov 17 17:30:33 2004
+@@ -31,8 +31,8 @@
+ static const uint64_t mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
+ static const uint64_t mm_wtwo __attribute__ ((aligned(8))) = 0x0002000200020002ULL;
+
+-static const uint64_t ff_pw_20 __attribute__ ((aligned(8))) = 0x0014001400140014ULL;
+-static const uint64_t ff_pw_3 __attribute__ ((aligned(8))) = 0x0003000300030003ULL;
++static const uint64_t ff_pw_20 __attribute__ ((aligned(8), used)) = 0x0014001400140014ULL;
++static const uint64_t ff_pw_3 __attribute__ ((aligned(8), used)) = 0x0003000300030003ULL;
+ static const uint64_t ff_pw_16 __attribute__ ((aligned(8))) = 0x0010001000100010ULL;
+ static const uint64_t ff_pw_15 __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;
+
diff --git a/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:motion_est_mmx.c b/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:motion_est_mmx.c
new file mode 100644
index 000000000000..40309131718a
--- /dev/null
+++ b/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:motion_est_mmx.c
@@ -0,0 +1,12 @@
+--- ffmpeg/libavcodec/i386/motion_est_mmx.c.orig Wed Nov 17 17:31:38 2004
++++ ffmpeg/libavcodec/i386/motion_est_mmx.c Wed Nov 17 17:31:47 2004
+@@ -26,7 +26,7 @@
+ 0x0002000200020002ULL,
+ };
+
+-static __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL;
++static __attribute__ ((aligned(8), used)) uint64_t bone= 0x0101010101010101LL;
+
+ static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
+ {
+
diff --git a/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:simple_idct_mmx.c b/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:simple_idct_mmx.c
new file mode 100644
index 000000000000..6001e63cec67
--- /dev/null
+++ b/multimedia/transcode/files/patch-ffmpeg:libavcodec:i386:simple_idct_mmx.c
@@ -0,0 +1,15 @@
+--- ffmpeg/libavcodec/i386/simple_idct_mmx.c.orig Wed Nov 17 17:32:21 2004
++++ ffmpeg/libavcodec/i386/simple_idct_mmx.c Wed Nov 17 17:32:37 2004
+@@ -45,8 +45,8 @@
+ #define ROW_SHIFT 11
+ #define COL_SHIFT 20 // 6
+
+-static const uint64_t __attribute__((aligned(8))) wm1010= 0xFFFF0000FFFF0000ULL;
+-static const uint64_t __attribute__((aligned(8))) d40000= 0x0000000000040000ULL;
++static const uint64_t __attribute__((aligned(8), used)) wm1010= 0xFFFF0000FFFF0000ULL;
++static const uint64_t __attribute__((aligned(8), used)) d40000= 0x0000000000040000ULL;
+
+ static const int16_t __attribute__((aligned(8))) coeffs[]= {
+ 1<<(ROW_SHIFT-1), 0, 1<<(ROW_SHIFT-1), 0,
+
+