diff options
Diffstat (limited to 'libhb')
91 files changed, 275 insertions, 112 deletions
diff --git a/libhb/audio_remap.c b/libhb/audio_remap.c index 40a07ed0d..d32adfb02 100644 --- a/libhb/audio_remap.c +++ b/libhb/audio_remap.c @@ -1,6 +1,6 @@ /* audio_remap.c * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/> * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/audio_remap.h b/libhb/audio_remap.h index 602f12e86..f0a1f3494 100644 --- a/libhb/audio_remap.h +++ b/libhb/audio_remap.h @@ -1,6 +1,6 @@ /* audio_remap.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/> * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/audio_resample.c b/libhb/audio_resample.c index 35585dd66..23d82402d 100644 --- a/libhb/audio_resample.c +++ b/libhb/audio_resample.c @@ -1,6 +1,6 @@ /* audio_resample.c * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/> * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/audio_resample.h b/libhb/audio_resample.h index c6bde532d..a8a1e2ad8 100644 --- a/libhb/audio_resample.h +++ b/libhb/audio_resample.h @@ -1,6 +1,6 @@ /* audio_resample.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/> * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/avfilter.c b/libhb/avfilter.c index 9729a2c9c..b82621426 100644 --- a/libhb/avfilter.c +++ b/libhb/avfilter.c @@ -161,7 +161,7 @@ static AVFilterContext * append_filter( hb_filter_private_t * pv, static int avfilter_init( hb_filter_object_t * filter, hb_filter_init_t * init ) { - hb_filter_private_t * pv = filter->private_data; + hb_filter_private_t * pv = NULL; char * sws_flags; AVFilterContext * avfilter; char * filter_args; diff --git a/libhb/batch.c b/libhb/batch.c index bab7ab983..1ae70d9ec 100644 --- a/libhb/batch.c +++ b/libhb/batch.c @@ -1,6 +1,6 @@ /* batch.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/bd.c b/libhb/bd.c index 23af8934b..b63918040 100644 --- a/libhb/bd.c +++ b/libhb/bd.c @@ -1,6 +1,6 @@ /* dvd.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/bits.h b/libhb/bits.h index 83b4759f6..150a8db60 100644 --- a/libhb/bits.h +++ b/libhb/bits.h @@ -1,6 +1,6 @@ /* bits.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/colormap.c b/libhb/colormap.c index 29e34113a..7cb22f994 100644 --- a/libhb/colormap.c +++ b/libhb/colormap.c @@ -1,6 +1,6 @@ /* colormap.c * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/colormap.h b/libhb/colormap.h index 542a012f1..cb214fdd6 100644 --- a/libhb/colormap.h +++ b/libhb/colormap.h @@ -1,6 +1,6 @@ /* colormap.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/comb_detect.c b/libhb/comb_detect.c index b0059cacb..4051f936c 100644 --- a/libhb/comb_detect.c +++ b/libhb/comb_detect.c @@ -1,6 +1,6 @@ /* comb_detect.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/common.c b/libhb/common.c index a6ee2c424..35150e756 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -1,6 +1,6 @@ /* common.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/common.h b/libhb/common.h index e14a5049e..3f5f15540 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -1,6 +1,6 @@ /* common.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/compat.c b/libhb/compat.c index c13584341..618fb52c0 100644 --- a/libhb/compat.c +++ b/libhb/compat.c @@ -1,6 +1,6 @@ /* compat.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/compat.h b/libhb/compat.h index 3b5858cee..2af0c2e08 100644 --- a/libhb/compat.h +++ b/libhb/compat.h @@ -1,6 +1,6 @@ /* compat.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/cropscale.c b/libhb/cropscale.c index 02e59eb29..aa91ee51a 100644 --- a/libhb/cropscale.c +++ b/libhb/cropscale.c @@ -1,6 +1,6 @@ /* cropscale.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 836c7f1be..33752c720 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -1,6 +1,6 @@ /* decavcodec.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/deccc608sub.c b/libhb/deccc608sub.c index ff044d28f..27b7e23b0 100644 --- a/libhb/deccc608sub.c +++ b/libhb/deccc608sub.c @@ -1,6 +1,6 @@ /* deccc608sub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/deccc608sub.h b/libhb/deccc608sub.h index 338d1182d..25a738f4f 100644 --- a/libhb/deccc608sub.h +++ b/libhb/deccc608sub.h @@ -1,6 +1,6 @@ /* deccc608sub.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/declpcm.c b/libhb/declpcm.c index af43c8e1d..88776dedf 100644 --- a/libhb/declpcm.c +++ b/libhb/declpcm.c @@ -1,6 +1,6 @@ /* declpcm.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decomb.c b/libhb/decomb.c index d3a62cee3..28e96e046 100644 --- a/libhb/decomb.c +++ b/libhb/decomb.c @@ -1,6 +1,6 @@ /* decomb.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decomb.h b/libhb/decomb.h index 36b6fc54a..45ffbb7d5 100644 --- a/libhb/decomb.h +++ b/libhb/decomb.h @@ -1,6 +1,6 @@ /* decomb.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decpgssub.c b/libhb/decpgssub.c index 463c3b9e4..c0ce29bb0 100644 --- a/libhb/decpgssub.c +++ b/libhb/decpgssub.c @@ -1,6 +1,6 @@ /* decpgssub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c index f6b3fc28c..d4815dd81 100644 --- a/libhb/decsrtsub.c +++ b/libhb/decsrtsub.c @@ -1,6 +1,6 @@ /* decsrtsub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decsrtsub.h b/libhb/decsrtsub.h index b4c604b32..13fe49301 100644 --- a/libhb/decsrtsub.h +++ b/libhb/decsrtsub.h @@ -1,6 +1,6 @@ /* decsrtsub.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decssasub.c b/libhb/decssasub.c index 18990c32c..4ad0b1558 100644 --- a/libhb/decssasub.c +++ b/libhb/decssasub.c @@ -1,6 +1,6 @@ /* decssasub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. @@ -348,7 +348,10 @@ ssa_decode_line_to_mkv_ssa( hb_work_object_t * w, hb_buffer_t * in, // when there is no layer field. numPartsRead = sscanf( (char *)in_data, "Dialogue:%128[^,],", layerField ); if ( numPartsRead != 1 ) + { + free(layerField); goto fail; + } styleToTextFields = (char *)find_field( in_data, in_data + in_size, 4 ); if ( styleToTextFields == NULL ) { diff --git a/libhb/decssasub.h b/libhb/decssasub.h index dc0fc2d73..91c696614 100644 --- a/libhb/decssasub.h +++ b/libhb/decssasub.h @@ -1,6 +1,6 @@ /* decssasub.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/dectx3gsub.c b/libhb/dectx3gsub.c index 74cad6447..c6399e5e1 100644 --- a/libhb/dectx3gsub.c +++ b/libhb/dectx3gsub.c @@ -1,6 +1,6 @@ /* dectx3gsub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decutf8sub.c b/libhb/decutf8sub.c index ad6787ad0..2d475f228 100644 --- a/libhb/decutf8sub.c +++ b/libhb/decutf8sub.c @@ -1,6 +1,6 @@ /* decutf8sub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/decvobsub.c b/libhb/decvobsub.c index 009c12e96..1ddb659ad 100644 --- a/libhb/decvobsub.c +++ b/libhb/decvobsub.c @@ -1,6 +1,6 @@ /* decvobsub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c index be1373edb..2b4d2e1c7 100644 --- a/libhb/demuxmpeg.c +++ b/libhb/demuxmpeg.c @@ -1,6 +1,6 @@ /* demuxmpeg.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/detelecine.c b/libhb/detelecine.c index e5c5a48fb..f53ffcc49 100644 --- a/libhb/detelecine.c +++ b/libhb/detelecine.c @@ -1,6 +1,6 @@ /* detelecine.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/dvd.c b/libhb/dvd.c index 4dfd81661..dee82eb3e 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -1,6 +1,6 @@ /* dvd.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/dvd.h b/libhb/dvd.h index 4ecbf2420..ffa114167 100644 --- a/libhb/dvd.h +++ b/libhb/dvd.h @@ -1,6 +1,6 @@ /* dvd.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c index acc30007b..bdcdcaae0 100644 --- a/libhb/dvdnav.c +++ b/libhb/dvdnav.c @@ -1,6 +1,6 @@ /* dvdnav.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/eedi2.c b/libhb/eedi2.c index 899029b29..e12dbaef9 100644 --- a/libhb/eedi2.c +++ b/libhb/eedi2.c @@ -1,6 +1,6 @@ /* eedi2.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/eedi2.h b/libhb/eedi2.h index b6e72ae34..fa04b71ba 100644 --- a/libhb/eedi2.h +++ b/libhb/eedi2.h @@ -1,6 +1,6 @@ /* eedi2.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c index 05771b7e5..b5d387b44 100644 --- a/libhb/enc_qsv.c +++ b/libhb/enc_qsv.c @@ -304,9 +304,11 @@ static int qsv_hevc_make_header(hb_work_object_t *w, mfxSession session) } /* need more space for 10bits */ + int bpp12 = 3; if (pv->param.videoParam->mfx.FrameInfo.FourCC == MFX_FOURCC_P010) { hb_buffer_realloc(bitstream_buf,bitstream_buf->size*2); + bpp12 = 6; } bitstream.Data = bitstream_buf->data; bitstream.MaxLength = bitstream_buf->alloc; @@ -315,9 +317,9 @@ static int qsv_hevc_make_header(hb_work_object_t *w, mfxSession session) mfxU16 Height = pv->param.videoParam->mfx.FrameInfo.Height; mfxU16 Width = pv->param.videoParam->mfx.FrameInfo.Width; frameSurface1.Info = pv->param.videoParam->mfx.FrameInfo; - frameSurface1.Data.Y = av_mallocz(Width * Height * 3 / 2); - frameSurface1.Data.VU = frameSurface1.Data.Y + Width * Height; - frameSurface1.Data.Pitch = Width; + frameSurface1.Data.Y = av_mallocz(Width * Height * (bpp12 / 2.0)); + frameSurface1.Data.VU = frameSurface1.Data.Y + Width * Height * (bpp12 == 6 ? 2 : 1); + frameSurface1.Data.Pitch = Width * (bpp12 == 6 ? 2 : 1); /* Encode a single blank frame */ do diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index 5e637fb57..b30ce13f9 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -1,6 +1,6 @@ /* encavcodec.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c index 544cd3304..206a3010d 100644 --- a/libhb/encavcodecaudio.c +++ b/libhb/encavcodecaudio.c @@ -1,6 +1,6 @@ /* encavcodecaudio.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/enctheora.c b/libhb/enctheora.c index 00b4d18eb..636afa76f 100644 --- a/libhb/enctheora.c +++ b/libhb/enctheora.c @@ -1,6 +1,6 @@ /* enctheora.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/encvobsub.c b/libhb/encvobsub.c index f5f12d891..44550d442 100644 --- a/libhb/encvobsub.c +++ b/libhb/encvobsub.c @@ -1,6 +1,6 @@ /* encvobsub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/encvorbis.c b/libhb/encvorbis.c index 053f3aaab..ac2b7892f 100644 --- a/libhb/encvorbis.c +++ b/libhb/encvorbis.c @@ -1,6 +1,6 @@ /* encvorbis.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/encx264.c b/libhb/encx264.c index 26645213a..04ac22824 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -1,6 +1,6 @@ /* encx264.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. @@ -151,7 +151,11 @@ static void * x264_lib_open_ubuntu_10bit(void) void hb_x264_global_init(void) { +#if X264_BUILD < 153 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 < 153 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 >= 153 + 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 >= 153 + 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) { diff --git a/libhb/encx264.h b/libhb/encx264.h index 81348a9a9..ccc93afa0 100644 --- a/libhb/encx264.h +++ b/libhb/encx264.h @@ -1,6 +1,6 @@ /* encx264.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/encx265.c b/libhb/encx265.c index 242dc6f1f..bc32a5e78 100644 --- a/libhb/encx265.c +++ b/libhb/encx265.c @@ -1,6 +1,6 @@ /* encx265.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/fifo.c b/libhb/fifo.c index f2175e90c..8d869c8d9 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -1,6 +1,6 @@ /* fifo.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/grayscale.c b/libhb/grayscale.c index 4d42f83c9..cb3a77ec9 100644 --- a/libhb/grayscale.c +++ b/libhb/grayscale.c @@ -1,6 +1,6 @@ /* grayscale.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/h264_common.h b/libhb/h264_common.h index 09db213f3..422136e93 100644 --- a/libhb/h264_common.h +++ b/libhb/h264_common.h @@ -1,6 +1,6 @@ /* h264_common.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/h265_common.h b/libhb/h265_common.h index ef156da42..f12c76dc0 100644 --- a/libhb/h265_common.h +++ b/libhb/h265_common.h @@ -1,6 +1,6 @@ /* h265_common.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hb.c b/libhb/hb.c index 41e8e3c34..733c3d2a3 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1,6 +1,6 @@ /* hb.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hb.h b/libhb/hb.h index d26b32319..c8dfa8ebb 100644 --- a/libhb/hb.h +++ b/libhb/hb.h @@ -1,6 +1,6 @@ /* hb.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hb_dict.c b/libhb/hb_dict.c index 09b3855a8..393f0dd30 100644 --- a/libhb/hb_dict.c +++ b/libhb/hb_dict.c @@ -1,6 +1,6 @@ /* hb_dict.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hb_dict.h b/libhb/hb_dict.h index d02c7dd50..668854bdd 100644 --- a/libhb/hb_dict.h +++ b/libhb/hb_dict.h @@ -1,6 +1,6 @@ /* hb_dict.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hb_json.c b/libhb/hb_json.c index c267bf86d..672810efb 100644 --- a/libhb/hb_json.c +++ b/libhb/hb_json.c @@ -1,6 +1,6 @@ /* json.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hb_json.h b/libhb/hb_json.h index 54ac92a46..5749f1001 100644 --- a/libhb/hb_json.h +++ b/libhb/hb_json.h @@ -1,6 +1,6 @@ /* hb_json.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hbffmpeg.h b/libhb/hbffmpeg.h index 535e4b3f5..898e3ade1 100644 --- a/libhb/hbffmpeg.h +++ b/libhb/hbffmpeg.h @@ -1,6 +1,6 @@ /* hbffmpeg.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/hbtypes.h b/libhb/hbtypes.h index 064ba7b6d..9cdabfa34 100644 --- a/libhb/hbtypes.h +++ b/libhb/hbtypes.h @@ -1,6 +1,6 @@ /* hbtypes.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/internal.h b/libhb/internal.h index 4510f0e01..025c09008 100644 --- a/libhb/internal.h +++ b/libhb/internal.h @@ -1,6 +1,6 @@ /* internal.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/lang.c b/libhb/lang.c index 91d5754f0..69fbfa7c8 100644 --- a/libhb/lang.c +++ b/libhb/lang.c @@ -1,6 +1,6 @@ /* lang.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/lang.h b/libhb/lang.h index 88866b328..e3cb97ab5 100644 --- a/libhb/lang.h +++ b/libhb/lang.h @@ -1,6 +1,6 @@ /* lang.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/lapsharp.c b/libhb/lapsharp.c index 5f1606d3c..59f7c174b 100644 --- a/libhb/lapsharp.c +++ b/libhb/lapsharp.c @@ -1,6 +1,6 @@ /* lapsharp.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/mt_frame_filter.c b/libhb/mt_frame_filter.c index 7ae009c0e..e632bcd54 100644 --- a/libhb/mt_frame_filter.c +++ b/libhb/mt_frame_filter.c @@ -1,6 +1,6 @@ /* mt_frame_filter.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c index 99ba9c9a4..6cacd6cee 100644 --- a/libhb/muxavformat.c +++ b/libhb/muxavformat.c @@ -1,6 +1,6 @@ /* muxavformat.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index 88072edad..196965bec 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -1,6 +1,6 @@ /* muxcommon.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/nal_units.c b/libhb/nal_units.c index fe66eca9c..51c73518a 100644 --- a/libhb/nal_units.c +++ b/libhb/nal_units.c @@ -1,6 +1,6 @@ /* nal_units.c * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code. * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/nal_units.h b/libhb/nal_units.h index aae33e77e..71d8dad7f 100644 --- a/libhb/nal_units.h +++ b/libhb/nal_units.h @@ -1,6 +1,6 @@ /* nal_units.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code. * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/nlmeans.c b/libhb/nlmeans.c index 02433e3d3..d5dd4a2c1 100644 --- a/libhb/nlmeans.c +++ b/libhb/nlmeans.c @@ -1,7 +1,7 @@ /* nlmeans.c Copyright (c) 2013 Dirk Farin - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. @@ -72,8 +72,8 @@ #define NLMEANS_PREFILTER_MODE_MEAN5X5 2 #define NLMEANS_PREFILTER_MODE_MEDIAN3X3 4 #define NLMEANS_PREFILTER_MODE_MEDIAN5X5 8 -#define NLMEANS_PREFILTER_MODE_RESERVED16 16 // Reserved -#define NLMEANS_PREFILTER_MODE_RESERVED32 32 // Reserved +#define NLMEANS_PREFILTER_MODE_CSM3X3 16 +#define NLMEANS_PREFILTER_MODE_CSM5X5 32 #define NLMEANS_PREFILTER_MODE_RESERVED64 64 // Reserved #define NLMEANS_PREFILTER_MODE_RESERVED128 128 // Reserved #define NLMEANS_PREFILTER_MODE_REDUCE25 256 @@ -252,8 +252,9 @@ static void nlmeans_alloc(const uint8_t *src, dst->border = border; nlmeans_border(dst->mem, dst->w, dst->h, dst->border); - dst->mem_pre = dst->mem; - dst->image_pre = dst->image; + dst->mem_pre = dst->mem; + dst->image_pre = dst->image; + dst->prefiltered = 0; } @@ -386,6 +387,99 @@ static void nlmeans_filter_median(const uint8_t *src, } +static void nlmeans_filter_csm(const uint8_t *src, + uint8_t *dst, + const int w, + const int h, + const int border, + const int size) +{ + // CSM filter + const int bw = w + 2 * border; + const int offset_min = -((size - 1) /2); + const int offset_max = (size + 1) /2; + uint8_t min, max, + min2, max2, + min3, max3, + median, + pixel; + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + for (int k = offset_min; k < offset_max; k++) + { + for (int j = offset_min; j < offset_max; j++) + { + if (k == 0 && j == 0) + { + // Ignore origin + goto end; + } + pixel = *(src + bw*(y+j) + (x+k)); + if (k == offset_min && j == offset_min) + { + // Start calculating neighborhood thresholds + min = pixel; + max = min; + goto end; + } + if (pixel < min) + { + min = pixel; + } + if (pixel > max) + { + max = pixel; + } + } + end: + continue; + } + + // Final neighborhood thresholds + // min = minimum neighbor pixel value + // max = maximum neighbor pixel value + + // Median + median = (min + max) / 2; + + // Additional thresholds for median-like filtering + min2 = (min + median) / 2; + max2 = (max + median) / 2; + min3 = (min2 + median) / 2; + max3 = (max2 + median) / 2; + + // Clamp to thresholds + pixel = *(src + bw*(y) + (x)); + if (pixel < min) + { + *(dst + bw*y + x) = min; + } + else if (pixel > max) + { + *(dst + bw*y + x) = max; + } + else if (pixel < min2) + { + *(dst + bw*y + x) = min2; + } + else if (pixel > max2) + { + *(dst + bw*y + x) = max2; + } + else if (pixel < min3) + { + *(dst + bw*y + x) = min3; + } + else if (pixel > max3) + { + *(dst + bw*y + x) = max3; + } + } + } +} + static void nlmeans_filter_edgeboost(const uint8_t *src, uint8_t *dst, const int w, @@ -493,7 +587,7 @@ static void nlmeans_prefilter(BorderedPlane *src, const int filter_type) { hb_lock(src->mutex); - if (src->prefiltered) + if (src->prefiltered == 1) { hb_unlock(src->mutex); return; @@ -502,7 +596,9 @@ static void nlmeans_prefilter(BorderedPlane *src, if (filter_type & NLMEANS_PREFILTER_MODE_MEAN3X3 || filter_type & NLMEANS_PREFILTER_MODE_MEAN5X5 || filter_type & NLMEANS_PREFILTER_MODE_MEDIAN3X3 || - filter_type & NLMEANS_PREFILTER_MODE_MEDIAN5X5) + filter_type & NLMEANS_PREFILTER_MODE_MEDIAN5X5 || + filter_type & NLMEANS_PREFILTER_MODE_CSM3X3 || + filter_type & NLMEANS_PREFILTER_MODE_CSM5X5) { // Source image @@ -523,7 +619,17 @@ static void nlmeans_prefilter(BorderedPlane *src, } // Filter plane; should already have at least 2px extra border on each side - if (filter_type & NLMEANS_PREFILTER_MODE_MEDIAN5X5) + if (filter_type & NLMEANS_PREFILTER_MODE_CSM5X5) + { + // CSM 5x5 + nlmeans_filter_csm(image, image_pre, w, h, border, 5); + } + else if (filter_type & NLMEANS_PREFILTER_MODE_CSM3X3) + { + // CSM 3x3 + nlmeans_filter_csm(image, image_pre, w, h, border, 3); + } + else if (filter_type & NLMEANS_PREFILTER_MODE_MEDIAN5X5) { // Median 5x5 nlmeans_filter_median(image, image_pre, w, h, border, 5); @@ -580,12 +686,17 @@ static void nlmeans_prefilter(BorderedPlane *src, } } + // Recreate borders + nlmeans_border(mem_pre, w, h, border); + // Assign result src->mem_pre = mem_pre; src->image_pre = image_pre; - - // Recreate borders - nlmeans_border(mem_pre, w, h, border); + if (filter_type & NLMEANS_PREFILTER_MODE_PASSTHRU) + { + src->mem = src->mem_pre; + src->image = src->image_pre; + } } src->prefiltered = 1; @@ -998,16 +1109,16 @@ static void nlmeans_filter_thread(void *thread_args_v) for (int c = 0; c < 3; c++) { - if (pv->strength[c] == 0) + if (pv->prefilter[c] & NLMEANS_PREFILTER_MODE_PASSTHRU) { + nlmeans_prefilter(&frame->plane[c], pv->prefilter[c]); nlmeans_deborder(&frame->plane[c], buf->plane[c].data, buf->plane[c].width, buf->plane[c].stride, buf->plane[c].height); continue; } - if (pv->prefilter[c] & NLMEANS_PREFILTER_MODE_PASSTHRU) + if (pv->strength[c] == 0) { - nlmeans_prefilter(&frame->plane[c], pv->prefilter[c]); nlmeans_deborder(&frame->plane[c], buf->plane[c].data, buf->plane[c].width, buf->plane[c].stride, buf->plane[c].height); @@ -1129,16 +1240,16 @@ static hb_buffer_t * nlmeans_filter_flush(hb_filter_private_t *pv) for (int c = 0; c < 3; c++) { - if (pv->strength[c] == 0) + if (pv->prefilter[c] & NLMEANS_PREFILTER_MODE_PASSTHRU) { + nlmeans_prefilter(&frame->plane[c], pv->prefilter[c]); nlmeans_deborder(&frame->plane[c], buf->plane[c].data, buf->plane[c].width, buf->plane[c].stride, buf->plane[c].height); continue; } - if (pv->prefilter[c] & NLMEANS_PREFILTER_MODE_PASSTHRU) + if (pv->strength[c] == 0) { - nlmeans_prefilter(&pv->frame[f].plane[c], pv->prefilter[c]); nlmeans_deborder(&frame->plane[c], buf->plane[c].data, buf->plane[c].width, buf->plane[c].stride, buf->plane[c].height); diff --git a/libhb/nlmeans.h b/libhb/nlmeans.h index e0ede4a92..ae0f4f9f3 100644 --- a/libhb/nlmeans.h +++ b/libhb/nlmeans.h @@ -1,7 +1,7 @@ /* nlmeans.h Copyright (c) 2013 Dirk Farin - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/nlmeans_x86.c b/libhb/nlmeans_x86.c index c924ee221..79856b5d5 100644 --- a/libhb/nlmeans_x86.c +++ b/libhb/nlmeans_x86.c @@ -1,7 +1,7 @@ /* nlmeans_x86.c Copyright (c) 2013 Dirk Farin - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/param.c b/libhb/param.c index 11eb1733d..578b6a27a 100644 --- a/libhb/param.c +++ b/libhb/param.c @@ -1,6 +1,6 @@ /* param.c * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/param.h b/libhb/param.h index 92afb44ad..eee5f9222 100644 --- a/libhb/param.h +++ b/libhb/param.h @@ -1,6 +1,6 @@ /* param.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/platform/macosx/encca_aac.c b/libhb/platform/macosx/encca_aac.c index 5716cf399..22c35bbd9 100644 --- a/libhb/platform/macosx/encca_aac.c +++ b/libhb/platform/macosx/encca_aac.c @@ -1,6 +1,6 @@ /* encca_aac.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/plist.c b/libhb/plist.c index 818e39b80..03b0df493 100644 --- a/libhb/plist.c +++ b/libhb/plist.c @@ -1,6 +1,6 @@ /* plist.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/plist.h b/libhb/plist.h index e58db5887..8634b9e85 100644 --- a/libhb/plist.h +++ b/libhb/plist.h @@ -1,6 +1,6 @@ /* plist.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/ports.c b/libhb/ports.c index 399ddecc8..5d71541ab 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -1,6 +1,6 @@ /* ports.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. @@ -1306,6 +1306,7 @@ void hb_system_sleep_private_enable(void *opaque) if (opaque == NULL) { hb_error("hb_system_sleep: opaque is NULL"); + return; } IOPMAssertionID *assertionID = (IOPMAssertionID*)opaque; @@ -1336,6 +1337,7 @@ void hb_system_sleep_private_disable(void *opaque) if (opaque == NULL) { hb_error("hb_system_sleep: opaque is NULL"); + return; } IOPMAssertionID *assertionID = (IOPMAssertionID*)opaque; diff --git a/libhb/ports.h b/libhb/ports.h index 57723061b..f664170a4 100644 --- a/libhb/ports.h +++ b/libhb/ports.h @@ -1,6 +1,6 @@ /* ports.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/preset.c b/libhb/preset.c index 2d05b1c72..5840714ce 100644 --- a/libhb/preset.c +++ b/libhb/preset.c @@ -1,6 +1,6 @@ /* preset.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/preset.h b/libhb/preset.h index b90010553..09478e8fb 100644 --- a/libhb/preset.h +++ b/libhb/preset.h @@ -1,6 +1,6 @@ /* preset.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c index 97348dd43..3470f49e3 100644 --- a/libhb/qsv_common.c +++ b/libhb/qsv_common.c @@ -1,6 +1,6 @@ /* qsv_common.c * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code. * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. @@ -397,6 +397,7 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf init_video_param(&inputParam); inputParam.mfx.CodecId = info->codec_id; inputParam.mfx.RateControlMethod = MFX_RATECONTROL_LA; + inputParam.mfx.TargetKbps = 5000; memset(&videoParam, 0, sizeof(mfxVideoParam)); videoParam.mfx.CodecId = inputParam.mfx.CodecId; @@ -411,6 +412,7 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf inputParam.mfx.CodecId = info->codec_id; inputParam.mfx.RateControlMethod = MFX_RATECONTROL_LA; inputParam.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF; + inputParam.mfx.TargetKbps = 5000; memset(&videoParam, 0, sizeof(mfxVideoParam)); videoParam.mfx.CodecId = inputParam.mfx.CodecId; @@ -428,6 +430,7 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf init_video_param(&inputParam); inputParam.mfx.CodecId = info->codec_id; inputParam.mfx.RateControlMethod = MFX_RATECONTROL_ICQ; + inputParam.mfx.ICQQuality = 20; memset(&videoParam, 0, sizeof(mfxVideoParam)); videoParam.mfx.CodecId = inputParam.mfx.CodecId; diff --git a/libhb/qsv_common.h b/libhb/qsv_common.h index 620cb1aef..8ffd77994 100644 --- a/libhb/qsv_common.h +++ b/libhb/qsv_common.h @@ -1,6 +1,6 @@ /* qsv_common.h * - * Copyright (c) 2003-2017 HandBrake Team + * Copyright (c) 2003-2018 HandBrake Team * This file is part of the HandBrake source code. * Homepage: <http://handbrake.fr/>. * It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/reader.c b/libhb/reader.c index 53a8180a1..8d15ae8d6 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -1,6 +1,6 @@ /* reader.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/rendersub.c b/libhb/rendersub.c index 26d1058c5..2cf92b058 100644 --- a/libhb/rendersub.c +++ b/libhb/rendersub.c @@ -1,6 +1,6 @@ /* rendersub.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/scan.c b/libhb/scan.c index 8baeed356..5b3b0734d 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -1,6 +1,6 @@ /* scan.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/stream.c b/libhb/stream.c index 34670160b..98778711b 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -1,6 +1,6 @@ /* stream.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/sync.c b/libhb/sync.c index 72b779bde..3b1f6d183 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -1,6 +1,6 @@ /* sync.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/taskset.c b/libhb/taskset.c index b759a963b..e05c87e82 100644 --- a/libhb/taskset.c +++ b/libhb/taskset.c @@ -1,6 +1,6 @@ /* taskset.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/taskset.h b/libhb/taskset.h index 1b1739721..73a8f8d8d 100644 --- a/libhb/taskset.h +++ b/libhb/taskset.h @@ -1,6 +1,6 @@ /* taskset.h - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/unsharp.c b/libhb/unsharp.c index 8f1c99e6b..445615b84 100644 --- a/libhb/unsharp.c +++ b/libhb/unsharp.c @@ -1,7 +1,7 @@ /* unsharp.c Copyright (c) 2002 RĂ©mi Guyomarch <rguyom at pobox.com> - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/vfr.c b/libhb/vfr.c index 9f0e48263..ef7c1782d 100644 --- a/libhb/vfr.c +++ b/libhb/vfr.c @@ -1,6 +1,6 @@ /* vfr.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. diff --git a/libhb/work.c b/libhb/work.c index 94720d5f2..28fa36bd8 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1,6 +1,6 @@ /* work.c - Copyright (c) 2003-2017 HandBrake Team + Copyright (c) 2003-2018 HandBrake Team This file is part of the HandBrake source code Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License v2. |