summaryrefslogtreecommitdiffstats
path: root/contrib/x264
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-07-21 22:57:15 +0000
committerRodeo <[email protected]>2013-07-21 22:57:15 +0000
commit19108e773a915ad047d99315086cdaafb335c392 (patch)
tree5b1e247505a1f6ae0fded9fee00441f785de4c1f /contrib/x264
parenta3d27b2e6c41d8d856b935bf55f85c719a850cc3 (diff)
Bump x264 to r2345-f0c1c53.
Miscellaneous fixes and improvements as usual, plus lets us drop a patch that has now been pushed upstream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5656 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib/x264')
-rw-r--r--contrib/x264/A00-version-string.patch8
-rw-r--r--contrib/x264/A01-opencl-fixes.patch235
-rw-r--r--contrib/x264/module.defs2
3 files changed, 5 insertions, 240 deletions
diff --git a/contrib/x264/A00-version-string.patch b/contrib/x264/A00-version-string.patch
index 49a652256..6610bd1a6 100644
--- a/contrib/x264/A00-version-string.patch
+++ b/contrib/x264/A00-version-string.patch
@@ -1,12 +1,12 @@
diff --git a/x264.h b/x264.h
-index e5a1600..f635d9e 100644
+index b88f510..7dd0891 100644
--- a/x264.h
+++ b/x264.h
@@ -41,7 +41,17 @@
#include "x264_config.h"
--#define X264_BUILD 133
+-#define X264_BUILD 135
+/*
+ * Define the full version explicitly so that it survives a git --archive.
+ *
@@ -16,8 +16,8 @@ index e5a1600..f635d9e 100644
+#ifdef X264_VERSION
+#undef X264_VERSION
+#endif
-+#define X264_BUILD 133
-+#define X264_VERSION " r2334 a3ac64b"
++#define X264_BUILD 135
++#define X264_VERSION " r2345 f0c1c53"
/* Application developers planning to link against a shared library version of
* libx264 from a Microsoft Visual Studio or similar development environment
diff --git a/contrib/x264/A01-opencl-fixes.patch b/contrib/x264/A01-opencl-fixes.patch
deleted file mode 100644
index 17720c239..000000000
--- a/contrib/x264/A01-opencl-fixes.patch
+++ /dev/null
@@ -1,235 +0,0 @@
-From a87c3f61c93351a106976af5b3f5f2b95b277d20 Mon Sep 17 00:00:00 2001
-From: Anton Mitrofanov <[email protected]>
-Date: Wed, 22 May 2013 22:43:59 +0400
-Subject: [PATCH] Fix compilation with OpenCL on MacOS X
-
-Also fix crash in the case of OpenCL error during encoding.
----
- common/opencl.c | 46 +++++++++++++++++++++++-----------------------
- encoder/slicetype-cl.c | 10 ++++++++--
- extras/cl_platform.h | 38 ++++++++++++++++++++++++++------------
- 3 files changed, 57 insertions(+), 37 deletions(-)
-
-diff --git a/common/opencl.c b/common/opencl.c
-index 5b1bb69..63c49e8 100644
---- a/common/opencl.c
-+++ b/common/opencl.c
-@@ -34,7 +34,7 @@
- #else
- #include <dlfcn.h> //dlopen, dlsym, dlclose
- #if SYS_MACOSX
--#define ocl_open dlopen( "libOpenCL.dylib", RTLD_NOW )
-+#define ocl_open dlopen( "/System/Library/Frameworks/OpenCL.framework/OpenCL", RTLD_NOW )
- #else
- #define ocl_open dlopen( "libOpenCL.so", RTLD_NOW )
- #endif
-@@ -119,7 +119,7 @@ static int x264_detect_switchable_graphics( void );
-
- /* Try to load the cached compiled program binary, verify the device context is
- * still valid before reuse */
--static cl_program x264_opencl_cache_load( x264_t *h, char *devname, char *devvendor, char *driverversion )
-+static cl_program x264_opencl_cache_load( x264_t *h, char *dev_name, char *dev_vendor, char *driver_version )
- {
- /* try to load cached program binary */
- FILE *fp = fopen( h->param.psz_clbin_file, "rb" );
-@@ -149,9 +149,9 @@ static cl_program x264_opencl_cache_load( x264_t *h, char *devname, char *devven
- }\
- } while( 0 )
-
-- CHECK_STRING( devname );
-- CHECK_STRING( devvendor );
-- CHECK_STRING( driverversion );
-+ CHECK_STRING( dev_name );
-+ CHECK_STRING( dev_vendor );
-+ CHECK_STRING( driver_version );
- CHECK_STRING( x264_opencl_source_hash );
- #undef CHECK_STRING
-
-@@ -167,7 +167,7 @@ fail:
-
- /* Save the compiled program binary to a file for later reuse. Device context
- * is also saved in the cache file so we do not reuse stale binaries */
--static void x264_opencl_cache_save( x264_t *h, cl_program program, char *devname, char *devvendor, char *driverversion )
-+static void x264_opencl_cache_save( x264_t *h, cl_program program, char *dev_name, char *dev_vendor, char *driver_version )
- {
- FILE *fp = fopen( h->param.psz_clbin_file, "wb" );
- if( !fp )
-@@ -186,11 +186,11 @@ static void x264_opencl_cache_save( x264_t *h, cl_program program, char *devname
- status = ocl->clGetProgramInfo( program, CL_PROGRAM_BINARIES, sizeof(uint8_t *), &binary, NULL );
- if( status == CL_SUCCESS )
- {
-- fputs( devname, fp );
-+ fputs( dev_name, fp );
- fputc( '\n', fp );
-- fputs( devvendor, fp );
-+ fputs( dev_vendor, fp );
- fputc( '\n', fp );
-- fputs( driverversion, fp );
-+ fputs( driver_version, fp );
- fputc( '\n', fp );
- fputs( x264_opencl_source_hash, fp );
- fputc( '\n', fp );
-@@ -218,17 +218,17 @@ static cl_program x264_opencl_compile( x264_t *h )
- cl_program program;
- cl_int status;
-
-- char devname[64];
-- char devvendor[64];
-- char driverversion[64];
-- status = ocl->clGetDeviceInfo( h->opencl.device, CL_DEVICE_NAME, sizeof(devname), devname, NULL );
-- status |= ocl->clGetDeviceInfo( h->opencl.device, CL_DEVICE_VENDOR, sizeof(devvendor), devvendor, NULL );
-- status |= ocl->clGetDeviceInfo( h->opencl.device, CL_DRIVER_VERSION, sizeof(driverversion), driverversion, NULL );
-+ char dev_name[64];
-+ char dev_vendor[64];
-+ char driver_version[64];
-+ status = ocl->clGetDeviceInfo( h->opencl.device, CL_DEVICE_NAME, sizeof(dev_name), dev_name, NULL );
-+ status |= ocl->clGetDeviceInfo( h->opencl.device, CL_DEVICE_VENDOR, sizeof(dev_vendor), dev_vendor, NULL );
-+ status |= ocl->clGetDeviceInfo( h->opencl.device, CL_DRIVER_VERSION, sizeof(driver_version), driver_version, NULL );
- if( status != CL_SUCCESS )
- return NULL;
-
- // Most AMD GPUs have vector registers
-- int vectorize = !strcmp( devvendor, "Advanced Micro Devices, Inc." );
-+ int vectorize = !strcmp( dev_vendor, "Advanced Micro Devices, Inc." );
- h->opencl.b_device_AMD_SI = 0;
-
- if( vectorize )
-@@ -250,9 +250,9 @@ static cl_program x264_opencl_compile( x264_t *h )
- }
- }
-
-- x264_log( h, X264_LOG_INFO, "OpenCL acceleration enabled with %s %s %s\n", devvendor, devname, h->opencl.b_device_AMD_SI ? "(SI)" : "" );
-+ x264_log( h, X264_LOG_INFO, "OpenCL acceleration enabled with %s %s %s\n", dev_vendor, dev_name, h->opencl.b_device_AMD_SI ? "(SI)" : "" );
-
-- program = x264_opencl_cache_load( h, devname, devvendor, driverversion );
-+ program = x264_opencl_cache_load( h, dev_name, dev_vendor, driver_version );
- if( !program )
- {
- /* clCreateProgramWithSource() requires a pointer variable, you cannot just use &x264_opencl_source */
-@@ -272,7 +272,7 @@ static cl_program x264_opencl_compile( x264_t *h )
- status = ocl->clBuildProgram( program, 1, &h->opencl.device, buildopts, NULL, NULL );
- if( status == CL_SUCCESS )
- {
-- x264_opencl_cache_save( h, program, devname, devvendor, driverversion );
-+ x264_opencl_cache_save( h, program, dev_name, dev_vendor, driver_version );
- return program;
- }
-
-@@ -388,7 +388,7 @@ fail:
- return -1;
- }
-
--static void x264_opencl_error_notify( const char *errinfo, const void *private_info, size_t cb, void *user_data )
-+static void CL_CALLBACK x264_opencl_error_notify( const char *errinfo, const void *private_info, size_t cb, void *user_data )
- {
- /* Any error notification can be assumed to be fatal to the OpenCL context.
- * We need to stop using it immediately to prevent further damage. */
-@@ -493,13 +493,13 @@ int x264_opencl_lookahead_init( x264_t *h )
- x264_free( imageType );
- if( !b_has_r || !b_has_rgba )
- {
-- char devname[64];
-- status = ocl->clGetDeviceInfo( h->opencl.device, CL_DEVICE_NAME, sizeof(devname), devname, NULL );
-+ char dev_name[64];
-+ status = ocl->clGetDeviceInfo( h->opencl.device, CL_DEVICE_NAME, sizeof(dev_name), dev_name, NULL );
- if( status == CL_SUCCESS )
- {
- /* emit warning if we are discarding the user's explicit choice */
- int level = h->param.opencl_device_id ? X264_LOG_WARNING : X264_LOG_DEBUG;
-- x264_log( h, level, "OpenCL: %s does not support required image formats\n", devname);
-+ x264_log( h, level, "OpenCL: %s does not support required image formats\n", dev_name);
- }
- ocl->clReleaseContext( context );
- continue;
-diff --git a/encoder/slicetype-cl.c b/encoder/slicetype-cl.c
-index 17650c5..334215f 100644
---- a/encoder/slicetype-cl.c
-+++ b/encoder/slicetype-cl.c
-@@ -40,13 +40,18 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
- #define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
-
- #define OCLCHECK( method, ... )\
-+do\
-+{\
-+ if( h->opencl.b_fatal_error )\
-+ return -1;\
- status = ocl->method( __VA_ARGS__ );\
- if( status != CL_SUCCESS ) {\
- h->param.b_opencl = 0;\
- h->opencl.b_fatal_error = 1;\
- x264_log( h, X264_LOG_ERROR, # method " error '%d'\n", status );\
-- return status;\
-- }
-+ return -1;\
-+ }\
-+} while( 0 )
-
- void x264_opencl_flush( x264_t *h )
- {
-@@ -152,6 +157,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
- CREATEBUF( fenc->opencl.lowres_mv_costs1, CL_MEM_READ_WRITE, mb_count * sizeof(int16_t) * (h->param.i_bframe + 1) );
- }
- #undef CREATEBUF
-+#undef CREATEIMAGE
-
- /* Copy image to the GPU, downscale to unpadded 8x8, then continue for all scales */
-
-diff --git a/extras/cl_platform.h b/extras/cl_platform.h
-index edc7321..7b06e09 100644
---- a/extras/cl_platform.h
-+++ b/extras/cl_platform.h
-@@ -47,13 +47,27 @@ extern "C" {
-
- #ifdef __APPLE__
- #define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
-- #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-- #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-- #define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-- #define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-- #define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-- #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
--
-+ #ifndef UNAVAILABLE_ATTRIBUTE
-+ #define UNAVAILABLE_ATTRIBUTE
-+ #endif
-+ #ifdef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-+ #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-+ #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-+ #else
-+ #define CL_API_SUFFIX__VERSION_1_0 UNAVAILABLE_ATTRIBUTE
-+ #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK UNAVAILABLE_ATTRIBUTE
-+ #endif
-+ #ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-+ #define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-+ #define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-+ #define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-+ #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
-+ #else
-+ #define CL_API_SUFFIX__VERSION_1_1 UNAVAILABLE_ATTRIBUTE
-+ #define GCL_API_SUFFIX__VERSION_1_1 UNAVAILABLE_ATTRIBUTE
-+ #define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK UNAVAILABLE_ATTRIBUTE
-+ #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATE CL_EXT_SUFFIX__VERSION_1_0
-+ #endif
- #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
- #define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
- #define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
-@@ -61,11 +75,11 @@ extern "C" {
- #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
- #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
- #else
-- #warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
-- #define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-- #define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-- #define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-- #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-+ #define CL_API_SUFFIX__VERSION_1_2 UNAVAILABLE_ATTRIBUTE
-+ #define GCL_API_SUFFIX__VERSION_1_2 UNAVAILABLE_ATTRIBUTE
-+ #define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK UNAVAILABLE_ATTRIBUTE
-+ #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
-+ #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXT_SUFFIX__VERSION_1_1
- #endif
- #else
- #define CL_EXTENSION_WEAK_LINK
---
-1.7.12.4 (Apple Git-37)
-
diff --git a/contrib/x264/module.defs b/contrib/x264/module.defs
index 7c8808500..876dc6462 100644
--- a/contrib/x264/module.defs
+++ b/contrib/x264/module.defs
@@ -1,7 +1,7 @@
$(eval $(call import.MODULE.defs,X264,x264,YASM PTHREADW32))
$(eval $(call import.CONTRIB.defs,X264))
-X264.FETCH.url = http://download.handbrake.fr/handbrake/contrib/x264-r2334-a3ac64b.tar.gz
+X264.FETCH.url = http://download.handbrake.fr/handbrake/contrib/x264-r2345-f0c1c53.tar.gz
X264.EXTRACT.tarbase = x264
X264.CONFIGURE.deps =