summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-06-08 23:04:22 +0100
committersr55 <[email protected]>2018-06-08 23:04:22 +0100
commitc2a7fba08f489844a1474c01be455ae1e9a03abb (patch)
treef3a7a414d0d6a1ad3b9e2c553d74b5d0b32b95d4 /win/CS/HandBrakeWPF
parentf4bd868418555189faac85e0af3f3ad64058836a (diff)
WinGui: Add Support for the VCE Encoders.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs10
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs8
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs43
3 files changed, 51 insertions, 10 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
index 285b1a373..42ccf1c10 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
@@ -91,6 +91,16 @@ namespace HandBrakeWPF.Converters.Video
encoders.Remove(VideoEncoder.QuickSyncH26510b);
}
+ if (!SystemInfo.IsVceH264Available)
+ {
+ encoders.Remove(VideoEncoder.VceH264);
+ }
+
+ if (!SystemInfo.IsVceH265Available)
+ {
+ encoders.Remove(VideoEncoder.VceH265);
+ }
+
return EnumHelper<VideoEncoder>.GetEnumDisplayValuesSubset(encoders);
}
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
index 1ee4665de..8396a584f 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
@@ -295,7 +295,11 @@ namespace HandBrakeWPF.Services.Encode.Factories
}
}
- if (job.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality) video.Quality = job.Quality;
+ if (job.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality)
+ {
+ video.Quality = job.Quality;
+ }
+
if (job.VideoEncodeRateType == VideoEncodeRateType.AverageBitrate)
{
video.Bitrate = job.VideoBitrate;
@@ -306,7 +310,7 @@ namespace HandBrakeWPF.Services.Encode.Factories
video.QSV.Decode = SystemInfo.IsQsvAvailable && configuration.EnableQuickSyncDecoding;
// The use of the QSV decoder is configurable for non QSV encoders.
- if (video.QSV.Decode && job.VideoEncoder != VideoEncoder.QuickSync && job.VideoEncoder != VideoEncoder.QuickSyncH265)
+ if (video.QSV.Decode && job.VideoEncoder != VideoEncoder.QuickSync && job.VideoEncoder != VideoEncoder.QuickSyncH265 && job.VideoEncoder != VideoEncoder.QuickSyncH26510b)
{
video.QSV.Decode = configuration.UseQSVDecodeForNonQSVEnc;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 18f07e06d..4bd5b777d 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -347,6 +347,8 @@ namespace HandBrakeWPF.ViewModels
break;
case VideoEncoder.QuickSync:
case VideoEncoder.QuickSyncH265:
+ case VideoEncoder.VceH264:
+ case VideoEncoder.VceH265:
rfValue = 51.0 - value;
rfValue = Math.Round(rfValue, 0);
this.Task.Quality = rfValue;
@@ -588,6 +590,7 @@ namespace HandBrakeWPF.ViewModels
{
return this.displayOptimiseOptions;
}
+
set
{
this.displayOptimiseOptions = value;
@@ -605,6 +608,7 @@ namespace HandBrakeWPF.ViewModels
{
return this.displayNonQsvControls;
}
+
set
{
if (value.Equals(this.displayNonQsvControls))
@@ -972,7 +976,8 @@ namespace HandBrakeWPF.ViewModels
{
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 || preset.Task.VideoEncoder == VideoEncoder.QuickSyncH26510b)
+ || preset.Task.VideoEncoder == VideoEncoder.QuickSync || preset.Task.VideoEncoder == VideoEncoder.QuickSyncH265 || preset.Task.VideoEncoder == VideoEncoder.QuickSyncH26510b
+ || preset.Task.VideoEncoder == VideoEncoder.VceH264 || preset.Task.VideoEncoder == VideoEncoder.VceH265)
{
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();
@@ -1084,8 +1089,8 @@ namespace HandBrakeWPF.ViewModels
if (this.Task.VideoEncoder == VideoEncoder.X264 || this.Task.VideoEncoder == VideoEncoder.X264_10
|| this.Task.VideoEncoder == VideoEncoder.X265 || this.Task.VideoEncoder == VideoEncoder.X265_10
|| this.Task.VideoEncoder == VideoEncoder.X265_12 || this.Task.VideoEncoder == VideoEncoder.QuickSync
- || this.Task.VideoEncoder == VideoEncoder.QuickSyncH265
- || this.Task.VideoEncoder == VideoEncoder.QuickSyncH26510b)
+ || this.Task.VideoEncoder == VideoEncoder.QuickSyncH265 || this.Task.VideoEncoder == VideoEncoder.QuickSyncH26510b
+ || this.Task.VideoEncoder == VideoEncoder.VceH264 || this.Task.VideoEncoder == VideoEncoder.VceH265)
{
if (!Equals(preset.Task.VideoPreset, this.Task.VideoPreset))
{
@@ -1176,6 +1181,8 @@ namespace HandBrakeWPF.ViewModels
break;
case VideoEncoder.QuickSync:
case VideoEncoder.QuickSyncH265:
+ case VideoEncoder.VceH264:
+ case VideoEncoder.VceH265:
this.QualityMin = 0;
this.QualityMax = 51;
break;
@@ -1298,6 +1305,7 @@ namespace HandBrakeWPF.ViewModels
int.TryParse(quality.Value.ToString(CultureInfo.InvariantCulture), out cq);
this.RF = 63 - cq;
}
+
break;
case VideoEncoder.X265:
case VideoEncoder.X265_10:
@@ -1307,10 +1315,15 @@ namespace HandBrakeWPF.ViewModels
case VideoEncoder.QuickSync:
case VideoEncoder.QuickSyncH265:
case VideoEncoder.QuickSyncH26510b:
- if (this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265)
+ case VideoEncoder.VceH264:
+ case VideoEncoder.VceH265:
+
+ if (this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265 || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b
+ || this.SelectedVideoEncoder == VideoEncoder.VceH264 || this.SelectedVideoEncoder == VideoEncoder.VceH265)
{
cqStep = 1;
}
+
double multiplier = 1.0 / cqStep;
if (quality.HasValue)
{
@@ -1327,6 +1340,7 @@ namespace HandBrakeWPF.ViewModels
{
this.RF = (int)quality.Value;
}
+
break;
}
}
@@ -1426,16 +1440,27 @@ namespace HandBrakeWPF.ViewModels
this.SetQualitySliderBounds();
// Update control display
- this.UseAdvancedTab = selectedEncoder != VideoEncoder.QuickSync && selectedEncoder != VideoEncoder.QuickSyncH265 && selectedEncoder != VideoEncoder.QuickSyncH26510b && this.UseAdvancedTab;
+ this.UseAdvancedTab = selectedEncoder != VideoEncoder.QuickSync && selectedEncoder != VideoEncoder.QuickSyncH265 && selectedEncoder != VideoEncoder.QuickSyncH26510b
+ && selectedEncoder != VideoEncoder.VceH264 && selectedEncoder != VideoEncoder.VceH265 && this.UseAdvancedTab;
+
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.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b ||
+ this.SelectedVideoEncoder == VideoEncoder.VceH264 || this.SelectedVideoEncoder == VideoEncoder.VceH265 ||
this.SelectedVideoEncoder == VideoEncoder.VP8 || this.SelectedVideoEncoder == VideoEncoder.VP9;
+
this.DisplayNonQSVControls = this.SelectedVideoEncoder != VideoEncoder.QuickSync && this.SelectedVideoEncoder != VideoEncoder.QuickSyncH265 && this.SelectedVideoEncoder != VideoEncoder.QuickSyncH26510b;
+
this.DisplayTurboFirstPass = selectedEncoder == VideoEncoder.X264 || selectedEncoder == VideoEncoder.X264_10 ||
selectedEncoder == VideoEncoder.X265 || selectedEncoder == VideoEncoder.X265_10 || selectedEncoder == VideoEncoder.X265_12;
- 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 || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b;
+
+ this.DisplayTuneControls = this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ||
+ this.SelectedVideoEncoder == VideoEncoder.X265 || this.SelectedVideoEncoder == VideoEncoder.X265_10 || this.SelectedVideoEncoder == VideoEncoder.X265_12;
+
+ this.DisplayLevelControl = this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ||
+ this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265 || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b ||
+ this.SelectedVideoEncoder == VideoEncoder.VceH264 || this.SelectedVideoEncoder == VideoEncoder.VceH265;
+
this.DisplayProfileControl = this.SelectedVideoEncoder == VideoEncoder.X264
|| this.SelectedVideoEncoder == VideoEncoder.X264_10
|| this.SelectedVideoEncoder == VideoEncoder.X265
@@ -1443,7 +1468,9 @@ namespace HandBrakeWPF.ViewModels
|| this.SelectedVideoEncoder == VideoEncoder.X265_12
|| this.SelectedVideoEncoder == VideoEncoder.QuickSync
|| this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265
- || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b;
+ || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b
+ || this.SelectedVideoEncoder == VideoEncoder.VceH264
+ || this.SelectedVideoEncoder == VideoEncoder.VceH265;
// Refresh Display
this.NotifyOfPropertyChange(() => this.Rfqp);