From 9667fe056a99b83bdc90cf75f8922ee745f87d52 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 13 Feb 2016 14:22:03 +0000 Subject: WinGui: x264/5 multilib support. You can now encode 10bit x264, 10bit x265 and 12bit x265 if you provide MinGW-W64 compiled dll libraries in the HandBrake install directory. --- .../HandBrakeWPF/ViewModels/AdvancedViewModel.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 35 +++++++++++++++------- win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs | 2 +- 3 files changed, 26 insertions(+), 13 deletions(-) (limited to 'win/CS/HandBrakeWPF/ViewModels') diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs index 069f097e7..746d457ef 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs @@ -78,7 +78,7 @@ namespace HandBrakeWPF.ViewModels public void SetEncoder(VideoEncoder encoder) { this.X264ViewModel.SetEncoder(encoder); - this.ShowX264Panel = encoder == VideoEncoder.X264; + this.ShowX264Panel = encoder == VideoEncoder.X264 || encoder == VideoEncoder.X264_10; } /// diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 981413a9a..bcccab989 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -121,7 +121,7 @@ namespace HandBrakeWPF.ViewModels this.UseAdvancedTab = false; } - if (this.SelectedVideoEncoder != VideoEncoder.X264) + if (this.SelectedVideoEncoder != VideoEncoder.X264 && this.SelectedVideoEncoder != VideoEncoder.X264_10) { return false; } @@ -275,7 +275,7 @@ namespace HandBrakeWPF.ViewModels { get { - return 0.0.Equals(this.DisplayRF) && this.SelectedVideoEncoder == VideoEncoder.X264; + return 0.0.Equals(this.DisplayRF) && this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10; } } @@ -341,7 +341,10 @@ namespace HandBrakeWPF.ViewModels this.Task.Quality = (63 - value); break; case VideoEncoder.X264: + case VideoEncoder.X264_10: case VideoEncoder.X265: + case VideoEncoder.X265_10: + case VideoEncoder.X265_12: double cqStep = userSettingService.GetUserSetting(UserSettingConstants.X264Step); double rfValue = 51.0 - value * cqStep; rfValue = Math.Round(rfValue, 2); @@ -436,7 +439,8 @@ namespace HandBrakeWPF.ViewModels { get { - return this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X265 ? "RF" : "QP"; + return this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 || this.SelectedVideoEncoder == VideoEncoder.X265 + || this.SelectedVideoEncoder == VideoEncoder.X265_10 || this.SelectedVideoEncoder == VideoEncoder.X265_12 ? "RF" : "QP"; } } @@ -447,7 +451,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.SelectedVideoEncoder == VideoEncoder.X264 ? Resources.Video_PlaceboQuality : Resources.Video_HigherQuality; + return this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ? Resources.Video_PlaceboQuality : Resources.Video_HigherQuality; } } @@ -822,7 +826,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.SelectedVideoEncoder != VideoEncoder.X264 ? Resources.Video_EncoderExtraArgsTooltip : string.Format(Resources.Video_EncoderExtraArgs, this.GetActualx264Query()); + return this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder != VideoEncoder.X264_10 ? string.Format(Resources.Video_EncoderExtraArgs, this.GetActualx264Query()) : Resources.Video_EncoderExtraArgsTooltip ; } } @@ -924,7 +928,9 @@ namespace HandBrakeWPF.ViewModels HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper.GetShortName(preset.Task.VideoEncoder)); if (encoder != null) { - if (preset.Task.VideoEncoder == VideoEncoder.X264 || preset.Task.VideoEncoder == VideoEncoder.X265 || preset.Task.VideoEncoder == VideoEncoder.QuickSync || preset.Task.VideoEncoder == VideoEncoder.QuickSyncH265) + if (preset.Task.VideoEncoder == VideoEncoder.X264 || preset.Task.VideoEncoder == VideoEncoder.X264_10 + || preset.Task.VideoEncoder == VideoEncoder.X265 || preset.Task.VideoEncoder == VideoEncoder.X265_10 || preset.Task.VideoEncoder == VideoEncoder.X265_12 + || preset.Task.VideoEncoder == VideoEncoder.QuickSync || preset.Task.VideoEncoder == VideoEncoder.QuickSyncH265) { this.VideoLevel = preset.Task.VideoLevel != null ? preset.Task.VideoLevel.Clone() : this.VideoLevels.FirstOrDefault(); this.VideoProfile = preset.Task.VideoProfile != null ? preset.Task.VideoProfile.Clone() : this.VideoProfiles.FirstOrDefault(); @@ -1021,7 +1027,7 @@ namespace HandBrakeWPF.ViewModels /// public void CopyQuery() { - Clipboard.SetDataObject(this.SelectedVideoEncoder == VideoEncoder.X264 ? this.GetActualx264Query() : this.ExtraArguments); + Clipboard.SetDataObject(this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ? this.GetActualx264Query() : this.ExtraArguments); } #endregion @@ -1046,7 +1052,10 @@ namespace HandBrakeWPF.ViewModels this.QualityMax = 51; break; case VideoEncoder.X264: + case VideoEncoder.X264_10: case VideoEncoder.X265: + case VideoEncoder.X265_10: + case VideoEncoder.X265_12: this.QualityMin = 0; this.QualityMax = (int)(51 / userSettingService.GetUserSetting(UserSettingConstants.X264Step)); break; @@ -1169,7 +1178,10 @@ namespace HandBrakeWPF.ViewModels } break; case VideoEncoder.X265: + case VideoEncoder.X265_10: + case VideoEncoder.X265_12: case VideoEncoder.X264: + case VideoEncoder.X264_10: case VideoEncoder.QuickSync: case VideoEncoder.QuickSyncH265: if (this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265) @@ -1292,11 +1304,12 @@ namespace HandBrakeWPF.ViewModels // Update control display this.UseAdvancedTab = selectedEncoder != VideoEncoder.QuickSync && selectedEncoder != VideoEncoder.QuickSyncH265 && this.UseAdvancedTab; - this.DisplayOptimiseOptions = this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X265 || this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265; + this.DisplayOptimiseOptions = this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 || this.SelectedVideoEncoder == VideoEncoder.X265 || this.SelectedVideoEncoder == VideoEncoder.X265_10 || this.SelectedVideoEncoder == VideoEncoder.X265_12 + || this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265; this.DisplayNonQSVControls = this.SelectedVideoEncoder != VideoEncoder.QuickSync && this.SelectedVideoEncoder != VideoEncoder.QuickSyncH265; - this.DisplayTurboFirstPass = selectedEncoder == VideoEncoder.X264; - this.DisplayTuneControls = SelectedVideoEncoder == VideoEncoder.X264 || SelectedVideoEncoder == VideoEncoder.X265; - this.DisplayLevelControl = SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265; + this.DisplayTurboFirstPass = selectedEncoder == VideoEncoder.X264 || selectedEncoder == VideoEncoder.X264_10; + this.DisplayTuneControls = SelectedVideoEncoder == VideoEncoder.X264 || SelectedVideoEncoder == VideoEncoder.X264_10 || SelectedVideoEncoder == VideoEncoder.X265 || SelectedVideoEncoder == VideoEncoder.X265_10 || SelectedVideoEncoder == VideoEncoder.X265_12; + this.DisplayLevelControl = SelectedVideoEncoder == VideoEncoder.X264 || SelectedVideoEncoder == VideoEncoder.X264_10 || this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265; // Refresh Display this.NotifyOfPropertyChange(() => this.Rfqp); diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs index 2789dcc19..5b2694cd9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs @@ -945,7 +945,7 @@ namespace HandBrakeWPF.ViewModels this.Task.PropertyChanged += this.Task_PropertyChanged; this.AdvancedOptionsString = preset.Task.AdvancedEncoderOptions; - if (task.ShowAdvancedTab && task.VideoEncoder == VideoEncoder.X264) + if (task.ShowAdvancedTab && task.VideoEncoder == VideoEncoder.X264 && task.VideoEncoder == VideoEncoder.X264_10) { this.ShowX264AdvancedOptions = true; this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions); -- cgit v1.2.3