From 890a551270ef8110e47d9c503e1588d3d2bc710f Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sat, 17 Oct 2015 15:57:03 -0700 Subject: x264: add multilib support (a.k.a. 10-bit) This adds the structure to load an libx264 10-bit shared library. The user must install this library themselves to an appropriate place. --- macosx/HBJob+HBJobConversion.m | 2 +- macosx/HBVideo+UIAdditions.m | 17 +++++++++-------- macosx/HBVideo.m | 2 +- macosx/HBVideoController.m | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) (limited to 'macosx') diff --git a/macosx/HBJob+HBJobConversion.m b/macosx/HBJob+HBJobConversion.m index a07ca98ff..f19e3c125 100644 --- a/macosx/HBJob+HBJobConversion.m +++ b/macosx/HBJob+HBJobConversion.m @@ -109,7 +109,7 @@ job->ipod_atom = self.mp4iPodCompatible; } - if (self.video.twoPass && (self.video.encoder == HB_VCODEC_X264 || + if (self.video.twoPass && ((self.video.encoder & HB_VCODEC_X264_MASK) || self.video.encoder == HB_VCODEC_X265)) { job->fastfirstpass = self.video.turboTwoPass; diff --git a/macosx/HBVideo+UIAdditions.m b/macosx/HBVideo+UIAdditions.m index f0e6b2678..0d6aaf1c1 100644 --- a/macosx/HBVideo+UIAdditions.m +++ b/macosx/HBVideo+UIAdditions.m @@ -83,7 +83,8 @@ - (BOOL)turboTwoPassSupported { - return (self.encoder == HB_VCODEC_X264 || self.encoder == HB_VCODEC_X265); + return ((self.encoder & HB_VCODEC_X264_MASK) || + self.encoder == HB_VCODEC_X265); } /** @@ -92,7 +93,7 @@ */ - (NSString *)unparseOptions { - if (self.encoder != HB_VCODEC_X264) + if (!(self.encoder & HB_VCODEC_X264_MASK)) { return @""; } @@ -132,12 +133,12 @@ } // now, unparse - char *fX264PresetsUnparsedUTF8String = hb_x264_param_unparse(x264_preset, - x264_tune, - advanced_opts, - h264_profile, - h264_level, - self.job.picture.width, self.job.picture.height); + char *fX264PresetsUnparsedUTF8String = hb_x264_param_unparse( + hb_video_encoder_get_depth(self.encoder), + x264_preset, x264_tune, advanced_opts, + h264_profile, h264_level, + self.job.picture.width, + self.job.picture.height); // update the text field if (fX264PresetsUnparsedUTF8String != NULL) { diff --git a/macosx/HBVideo.m b/macosx/HBVideo.m index 604e4aecc..70b7c09a1 100644 --- a/macosx/HBVideo.m +++ b/macosx/HBVideo.m @@ -576,7 +576,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; if (hb_video_encoder_get_presets(self.encoder) != NULL) { - if (self.encoder == HB_VCODEC_X264 && [preset[@"x264UseAdvancedOptions"] boolValue]) + if ((self.encoder & HB_VCODEC_X264_MASK) && [preset[@"x264UseAdvancedOptions"] boolValue]) { // preset does not use the x264 preset system, reset the widgets. self.preset = @"medium"; diff --git a/macosx/HBVideoController.m b/macosx/HBVideoController.m index 8ade4da8b..9a0ecb14a 100644 --- a/macosx/HBVideoController.m +++ b/macosx/HBVideoController.m @@ -128,7 +128,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext; } else if ([keyPath isEqualToString:@"video.unparseOptions"]) { - if (self.video.encoder == HB_VCODEC_X264) + if (self.video.encoder & HB_VCODEC_X264_MASK) { fDisplayX264PresetsUnparseTextField.stringValue = [NSString stringWithFormat:@"x264 Unparse: %@", self.video.unparseOptions]; } @@ -214,7 +214,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext; fPresetsBox.contentView = fPresetView; [self setupPresetsSlider]; - if (self.video.encoder == HB_VCODEC_X264) + if (self.video.encoder & HB_VCODEC_X264_MASK) { self.advancedController.hidden = NO; } @@ -250,7 +250,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext; */ - (void)toggleAdvancedOptionsCheckBoxForEncoder:(int)encoder { - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HBShowAdvancedTab"] && (encoder == HB_VCODEC_X264)) + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HBShowAdvancedTab"] && (encoder & HB_VCODEC_X264_MASK)) { fX264UseAdvancedOptionsCheck.hidden = NO; fDividerLine.hidden = YES; -- cgit v1.2.3