summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2021-02-23 19:58:11 +0000
committersr55 <[email protected]>2021-02-23 19:58:40 +0000
commita829a6f6af9539c34c9865239a54a6e51d7a7c41 (patch)
tree7dae6027d83566ffa930bd4766e5c87d082916a0 /win/CS/HandBrakeWPF/ViewModels
parentd4773a2d2cb59814d2fbede899ac2038ec81288c (diff)
WinGui: Add support for Media Foundation 264/265 encoders for QC based ARM64 devices. #2887
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs41
1 files changed, 30 insertions, 11 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 779508839..976ba88e9 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -193,7 +193,9 @@ namespace HandBrakeWPF.ViewModels
|| this.SelectedVideoEncoder == VideoEncoder.VceH265
|| this.SelectedVideoEncoder == VideoEncoder.QuickSync
|| this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265
- || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b)
+ || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b
+ || this.SelectedVideoEncoder == VideoEncoder.MFH264
+ || this.SelectedVideoEncoder == VideoEncoder.MFH265)
{
return false;
}
@@ -337,6 +339,8 @@ namespace HandBrakeWPF.ViewModels
case VideoEncoder.VceH265:
case VideoEncoder.NvencH264:
case VideoEncoder.NvencH265:
+ case VideoEncoder.MFH264:
+ case VideoEncoder.MFH265:
rfValue = 51.0 - value;
rfValue = Math.Round(rfValue, 0);
this.Task.Quality = rfValue;
@@ -442,7 +446,10 @@ namespace HandBrakeWPF.ViewModels
}
if (this.SelectedVideoEncoder == VideoEncoder.NvencH264
- || this.SelectedVideoEncoder == VideoEncoder.NvencH265)
+ || this.SelectedVideoEncoder == VideoEncoder.NvencH265
+ || this.SelectedVideoEncoder == VideoEncoder.MFH264
+ || this.SelectedVideoEncoder == VideoEncoder.MFH265
+ )
{
return string.Empty;
}
@@ -600,8 +607,9 @@ namespace HandBrakeWPF.ViewModels
&& this.SelectedVideoEncoder != VideoEncoder.QuickSyncH265
&& this.SelectedVideoEncoder != VideoEncoder.QuickSyncH26510b
&& this.SelectedVideoEncoder != VideoEncoder.NvencH264
- && this.SelectedVideoEncoder != VideoEncoder.NvencH265;
-
+ && this.SelectedVideoEncoder != VideoEncoder.NvencH265
+ && this.SelectedVideoEncoder != VideoEncoder.MFH264
+ && this.SelectedVideoEncoder != VideoEncoder.MFH265;
}
}
@@ -961,7 +969,8 @@ namespace HandBrakeWPF.ViewModels
|| 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.VceH264 || preset.Task.VideoEncoder == VideoEncoder.VceH265
- || preset.Task.VideoEncoder == VideoEncoder.NvencH264 || preset.Task.VideoEncoder == VideoEncoder.NvencH265)
+ || preset.Task.VideoEncoder == VideoEncoder.NvencH264 || preset.Task.VideoEncoder == VideoEncoder.NvencH265
+ || preset.Task.VideoEncoder == VideoEncoder.MFH264 || preset.Task.VideoEncoder == VideoEncoder.MFH265)
{
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();
@@ -1083,7 +1092,8 @@ namespace HandBrakeWPF.ViewModels
|| 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.VceH264 || this.Task.VideoEncoder == VideoEncoder.VceH265
- || this.Task.VideoEncoder == VideoEncoder.NvencH264 || this.Task.VideoEncoder == VideoEncoder.NvencH265)
+ || this.Task.VideoEncoder == VideoEncoder.NvencH264 || this.Task.VideoEncoder == VideoEncoder.NvencH265
+ || this.Task.VideoEncoder == VideoEncoder.MFH264 || this.Task.VideoEncoder == VideoEncoder.MFH265)
{
if (!Equals(preset.Task.VideoPreset, this.Task.VideoPreset))
{
@@ -1185,6 +1195,8 @@ namespace HandBrakeWPF.ViewModels
case VideoEncoder.VceH265:
case VideoEncoder.NvencH264:
case VideoEncoder.NvencH265:
+ case VideoEncoder.MFH264:
+ case VideoEncoder.MFH265:
this.QualityMin = 0;
this.QualityMax = 51;
break;
@@ -1333,10 +1345,13 @@ namespace HandBrakeWPF.ViewModels
case VideoEncoder.VceH265:
case VideoEncoder.NvencH264:
case VideoEncoder.NvencH265:
+ case VideoEncoder.MFH264:
+ case VideoEncoder.MFH265:
if (this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265 || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b
|| this.SelectedVideoEncoder == VideoEncoder.VceH264 || this.SelectedVideoEncoder == VideoEncoder.VceH265
- || this.SelectedVideoEncoder == VideoEncoder.NvencH264 || this.SelectedVideoEncoder == VideoEncoder.NvencH265)
+ || this.SelectedVideoEncoder == VideoEncoder.NvencH264 || this.SelectedVideoEncoder == VideoEncoder.NvencH265
+ || this.SelectedVideoEncoder == VideoEncoder.MFH264 || this.SelectedVideoEncoder == VideoEncoder.MFH265)
{
cqStep = 1;
}
@@ -1468,7 +1483,8 @@ namespace HandBrakeWPF.ViewModels
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.NvencH264 || this.SelectedVideoEncoder == VideoEncoder.NvencH265;
+ this.SelectedVideoEncoder == VideoEncoder.NvencH264 || this.SelectedVideoEncoder == VideoEncoder.NvencH265 ||
+ this.SelectedVideoEncoder == VideoEncoder.MFH264 || this.SelectedVideoEncoder == VideoEncoder.MFH265;
this.DisplayFastDecode = this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10;
this.NotifyOfPropertyChange(() => this.DisplayFastDecode);
@@ -1489,7 +1505,9 @@ namespace HandBrakeWPF.ViewModels
|| this.SelectedVideoEncoder == VideoEncoder.VceH264
|| this.SelectedVideoEncoder == VideoEncoder.VceH265
|| this.SelectedVideoEncoder == VideoEncoder.NvencH264
- || this.SelectedVideoEncoder == VideoEncoder.NvencH265;
+ || this.SelectedVideoEncoder == VideoEncoder.NvencH265
+ || this.SelectedVideoEncoder == VideoEncoder.MFH264
+ || this.SelectedVideoEncoder == VideoEncoder.MFH265;
// Refresh Display
this.NotifyOfPropertyChange(() => this.Rfqp);
@@ -1507,7 +1525,9 @@ namespace HandBrakeWPF.ViewModels
if (selectedEncoder == VideoEncoder.NvencH264 || selectedEncoder == VideoEncoder.NvencH265
|| selectedEncoder == VideoEncoder.VceH264
- || selectedEncoder == VideoEncoder.VceH265)
+ || selectedEncoder == VideoEncoder.VceH265
+ || selectedEncoder == VideoEncoder.MFH264
+ || selectedEncoder == VideoEncoder.MFH265)
{
this.TwoPass = false;
this.TurboFirstPass = false;
@@ -1537,7 +1557,6 @@ namespace HandBrakeWPF.ViewModels
// Override for NVEnc
if (selectedEncoder == VideoEncoder.NvencH264 || selectedEncoder == VideoEncoder.NvencH265)
{
- // TODO -> is the RTX good enough to default to a more balanced preset?
defaultPreset = this.VideoPresets.IndexOf(this.VideoPresets.FirstOrDefault(s => s.ShortName == "slow"));
}