$(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))
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;
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)
}
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 =
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 &&
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;
}
}
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)
{