]> granicus.if.org Git - handbrake/commitdiff
x264: bump to build 155
authorJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 26 Dec 2017 20:38:21 +0000 (12:38 -0800)
committerBradley Sepos <bradley@bradleysepos.com>
Wed, 10 Jan 2018 06:39:48 +0000 (01:39 -0500)
Requires NASM to build
Unified 8 and 10 bit library support
AVX-512 optimizations
Various other bug fixes and improvements

contrib/x264/A00-version-string.patch
contrib/x264/module.defs
libhb/encx264.c

index 8e46d601c859d0b9df7a271a74ae0a569dff0042..2f7c9f96cf755eb7ae3d5297ec83a494f1667e66 100644 (file)
@@ -6,7 +6,7 @@ index 2b59b92..86b7198 100644
  
  #include "x264_config.h"
  
--#define X264_BUILD 148
+-#define X264_BUILD 155
 +/*
 + * Define the full version explicitly so that it survives a git --archive.
 + *
@@ -22,9 +22,9 @@ index 2b59b92..86b7198 100644
 +#ifdef  X264_POINTVER
 +#undef  X264_POINTVER
 +#endif
-+#define X264_BUILD    148
-+#define X264_VERSION  " r2708 86b7198"
-+#define X264_POINTVER "0.148.2708 86b7198"
++#define X264_BUILD    155
++#define X264_VERSION " r2893 b00bcaf"
++#define X264_POINTVER "0.155.2893 b00bcaf"
  
  /* Application developers planning to link against a shared library version of
   * libx264 from a Microsoft Visual Studio or similar development environment
index 17b1e58ec5f76e0c88cc82a555830bb349cefb52..ee71e70f100ce36c021291882401056a85adf12d 100644 (file)
@@ -1,16 +1,15 @@
 $(eval $(call import.MODULE.defs,X264,x264,YASM PTHREADW32))
 $(eval $(call import.CONTRIB.defs,X264))
 
-X264.FETCH.url     = https://download.handbrake.fr/handbrake/contrib/x264-snapshot-20160920-2245-stable.tar.bz2
-X264.FETCH.url    += https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20160920-2245-stable.tar.bz2
-X264.FETCH.sha256  = 6ba2d848eabbca0d9d2c2a12b263e02f856a81fce87fbc74df52a1097c88e39c
+X264.FETCH.url     = https://download.handbrake.fr/handbrake/contrib/x264-snapshot-20171225-2245.tar.bz2
+X264.FETCH.url    += https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20171225-2245.tar.bz2
+X264.FETCH.sha256  = ea39f32ccb3bd3aeaccd663c8d210117be5d9cfbe89e1a8b5f631e0f7ed74954
 
 X264.GCC.args.c_std =
 
 X264.CONFIGURE.deps   =
 X264.CONFIGURE.shared =
 
-X264.CONFIGURE.extra  = --bit-depth=8 --chroma-format=420
 X264.CONFIGURE.extra += --disable-lavf --disable-ffms --disable-avs --disable-swscale --disable-gpac --disable-lsmash --disable-cli
 
 ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system))
index 4e9d12689f422ff995617fa35e1379713b48dfff..593111fb02b842cdffd712d9e119d817d71f432c 100644 (file)
@@ -151,7 +151,11 @@ static void * x264_lib_open_ubuntu_10bit(void)
 
 void hb_x264_global_init(void)
 {
+#if X264_BUILD < 155
     x264_apis[0].bit_depth                 = x264_bit_depth;
+#else
+    x264_apis[0].bit_depth                 = X264_BIT_DEPTH;
+#endif
     x264_apis[0].param_default             = x264_param_default;
     x264_apis[0].param_default_preset      = x264_param_default_preset;
     x264_apis[0].param_apply_profile       = x264_param_apply_profile;
@@ -164,13 +168,32 @@ void hb_x264_global_init(void)
     x264_apis[0].encoder_close             = x264_encoder_close;
     x264_apis[0].picture_init              = x264_picture_init;
 
+    if (x264_apis[0].bit_depth == 0)
+    {
+        // libx264 supports 8 and 10 bit
+        x264_apis[0].bit_depth                 = 8;
+        x264_apis[1].bit_depth                 = 10;
+        x264_apis[1].param_default             = x264_param_default;
+        x264_apis[1].param_default_preset      = x264_param_default_preset;
+        x264_apis[1].param_apply_profile       = x264_param_apply_profile;
+        x264_apis[1].param_apply_fastfirstpass = x264_param_apply_fastfirstpass;
+        x264_apis[1].param_parse               = x264_param_parse;
+        x264_apis[1].encoder_open              = x264_encoder_open;
+        x264_apis[1].encoder_headers           = x264_encoder_headers;
+        x264_apis[1].encoder_encode            = x264_encoder_encode;
+        x264_apis[1].encoder_delayed_frames    = x264_encoder_delayed_frames;
+        x264_apis[1].encoder_close             = x264_encoder_close;
+        x264_apis[1].picture_init              = x264_picture_init;
+        return;
+    }
+
     // Invalidate other apis
     x264_apis[1].bit_depth = -1;
 
     // Attempt to dlopen a library for handling the bit-depth that we do
     // not already have.
     void *h;
-    if (x264_bit_depth == 8)
+    if (x264_apis[0].bit_depth == 8)
     {
         h = x264_lib_open(libx264_10bit_names);
 #if defined(SYS_LINUX)
@@ -190,8 +213,23 @@ void hb_x264_global_init(void)
     }
 
     int ii;
+    int dll_bitdepth = 0;
+#if X264_BUILD < 155
     int *pbit_depth                   = (int*)hb_dlsym(h, "x264_bit_depth");
+    if (pbit_depth != NULL)
+    {
+        dll_bitdepth = *pbit_depth;
+    }
+#endif
     x264_apis[1].param_default        = hb_dlsym(h, "x264_param_default");
+#if X264_BUILD >= 155
+    if (x264_apis[1].param_default != NULL)
+    {
+        x264_param_t defaults;
+        x264_apis[1].param_default(&defaults);
+        dll_bitdepth = defaults.i_bitdepth;
+    }
+#endif
     x264_apis[1].param_default_preset = hb_dlsym(h, "x264_param_default_preset");
     x264_apis[1].param_apply_profile  = hb_dlsym(h, "x264_param_apply_profile");
     x264_apis[1].param_apply_fastfirstpass =
@@ -215,7 +253,7 @@ void hb_x264_global_init(void)
     x264_apis[1].encoder_close        = hb_dlsym(h, "x264_encoder_close");
     x264_apis[1].picture_init         = hb_dlsym(h, "x264_picture_init");
 
-    if (pbit_depth                             != NULL &&
+    if (dll_bitdepth > 0 && dll_bitdepth != x264_apis[0].bit_depth &&
         x264_apis[1].param_default             != NULL &&
         x264_apis[1].param_default_preset      != NULL &&
         x264_apis[1].param_apply_profile       != NULL &&
@@ -228,7 +266,7 @@ void hb_x264_global_init(void)
         x264_apis[1].encoder_close             != NULL &&
         x264_apis[1].picture_init              != NULL)
     {
-        x264_apis[1].bit_depth = *pbit_depth;
+        x264_apis[1].bit_depth = dll_bitdepth;
     }
 }
 
@@ -321,6 +359,10 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
         return 1;
     }
 
+#if X264_BUILD >= 155
+    param.i_bitdepth = bit_depth;
+#endif
+
     /* If the PSNR or SSIM tunes are in use, enable the relevant metric */
     if (job->encoder_tune != NULL && *job->encoder_tune)
     {