Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Sep 2016 13:14:11 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r422671 - in head/multimedia: libx264 x264 x264/files
Message-ID:  <201609231314.u8NDEBsx064074@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Sep 23 13:14:10 2016
New Revision: 422671
URL: https://svnweb.freebsd.org/changeset/ports/422671

Log:
  multimedia/x264: add OPENCL option, enabled by default
  
  Before OpenCL can be used for lookahead install at least one
  implementation: devel/freeocl, devel/pocl, lang/beignet or lang/clover.
  
    $ x264 --fullhelp | fgrep opencl
  	--opencl                Enable use of OpenCL
  	--opencl-clbin <string> Specify path of compiled OpenCL kernel cache
  	--opencl-device <integer> Specify OpenCL device ordinal
  
  where the options also work in other apps e.g.,
  
    $ ffmpeg -i <input-file> -codec:v libx264 -x264opts opencl:opencl-device=1 <output-file>
    $ mpv --ovc libx264 --ovcopts-add x264opts=opencl:opencl-device=1 -o <output-file> <input-file>
  
  Differential Revision:	https://reviews.freebsd.org/D7958
  Approved by:	koobs (maintainer)

Modified:
  head/multimedia/libx264/Makefile   (contents, props changed)
  head/multimedia/x264/Makefile   (contents, props changed)
  head/multimedia/x264/files/patch-configure   (contents, props changed)

Modified: head/multimedia/libx264/Makefile
==============================================================================
--- head/multimedia/libx264/Makefile	Fri Sep 23 13:12:07 2016	(r422670)
+++ head/multimedia/libx264/Makefile	Fri Sep 23 13:14:10 2016	(r422671)
@@ -3,7 +3,7 @@
 #
 # Updating notes: see multimedia/x264/Makefile.
 
-PORTREVISION=	2
+PORTREVISION=	3
 PKGNAMEPREFIX=	lib
 COMMENT=	H.264/MPEG-4 AVC Video Encoding (Library)
 MASTERDIR=	${.CURDIR}/../x264
@@ -13,12 +13,17 @@ LIB_DEPENDS=	#
 
 USES=		pathfix
 
-OPTIONS_DEFINE=		HI10P
+OPTIONS_DEFINE=		HI10P OPENCL
+OPTIONS_DEFAULT=	OPENCL
 OPTIONS_EXCLUDE=	FFMS GPAC LAVF LSMASH SWSCALE
 
 HI10P_DESC=		Enable High 10 Profile 10-bit encoding
 HI10P_CONFIGURE_ON=	--bit-depth=10
 
+OPENCL_DESC=		Heterogeneous computing via OpenCL
+OPENCL_BUILD_DEPENDS=	${LOCALBASE}/include/CL/opencl.h:devel/opencl
+OPENCL_CONFIGURE_OFF=	--disable-opencl
+
 CONFIGURE_ARGS=		\
 			--enable-static \
 			--enable-shared \

Modified: head/multimedia/x264/Makefile
==============================================================================
--- head/multimedia/x264/Makefile	Fri Sep 23 13:12:07 2016	(r422670)
+++ head/multimedia/x264/Makefile	Fri Sep 23 13:14:10 2016	(r422671)
@@ -103,8 +103,7 @@ SWSCALE_LIB_DEPENDS=	libavutil.so:multim
 CONFIGURE_ARGS?=	--system-libx264
 CONFIGURE_ARGS+=	--prefix="${PREFIX}" \
 			--extra-cflags="${CPPFLAGS} ${CFLAGS}" \
-			--extra-ldflags="${LDFLAGS}" \
-			--disable-opencl \
+			--extra-ldflags="${LDFLAGS}"
 
 CFLAGS_armv6+=		-mcpu=arm1136jf-s
 

Modified: head/multimedia/x264/files/patch-configure
==============================================================================
--- head/multimedia/x264/files/patch-configure	Fri Sep 23 13:12:07 2016	(r422670)
+++ head/multimedia/x264/files/patch-configure	Fri Sep 23 13:14:10 2016	(r422671)
@@ -51,3 +51,13 @@
  if [ $compiler = ICC -o $compiler = ICL ] ; then
      if cc_check 'extras/intel_dispatcher.h' '' 'x264_intel_dispatcher_override();' ; then
          define HAVE_INTEL_DISPATCHER
+@@ -1128,6 +1118,9 @@ if [ "$opencl" = "yes" ]; then
+         opencl="yes"
+         define HAVE_OPENCL
+         libdl="-ldl"
++    else
++        opencl="yes"
++        define HAVE_OPENCL
+     fi
+     LDFLAGS="$LDFLAGS $libdl"
+ fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609231314.u8NDEBsx064074>