diff options
author | sr55 <[email protected]> | 2013-09-28 12:44:05 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-09-28 12:44:05 +0000 |
commit | 3e407aca4aad62fe7d7dea63065c0019ec9abe93 (patch) | |
tree | 7744cc2dfc9d0cb9251b76bc8514107783d6b15a | |
parent | 39d824512056405321ba2b192508037323f59409 (diff) |
WinGui: All the hardware acceleration options are now available view a new tab on the Options screen. This includes the OpenCL scaling, QuickSync and DXVA decode support.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5818 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj | 1 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs (renamed from win/CS/HandBrakeWPF/Model/VideoScaler.cs) | 6 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Encode.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs | 35 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/OptionsView.xaml | 12 |
12 files changed, 60 insertions, 29 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 477392a05..bbfed6f4e 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -97,6 +97,7 @@ <Compile Include="Isolation\BackgroundServiceConnector.cs" />
<Compile Include="Isolation\IsolatedEncodeService.cs" />
<Compile Include="LibHb\AudioVideoHelpers.cs" />
+ <Compile Include="Model\VideoScaler.cs" />
<Compile Include="Services\Interfaces\IEncodeServiceWrapper.cs" />
<Compile Include="Services\Interfaces\IHbServiceCallback.cs" />
<Compile Include="Services\Interfaces\IServerService.cs" />
diff --git a/win/CS/HandBrakeWPF/Model/VideoScaler.cs b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs index 53ff3eb1b..9772494cf 100644 --- a/win/CS/HandBrakeWPF/Model/VideoScaler.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrakeWPF.Model
+namespace HandBrake.ApplicationServices.Model
{
using System.ComponentModel.DataAnnotations;
@@ -19,8 +19,8 @@ namespace HandBrakeWPF.Model [Display(Name = "Lanczos")]
Lanczos = 0,
- [Display(Name = "Bicubic")]
- Bicubic,
+ // [Display(Name = "Bicubic")]
+ // Bicubic,
[Display(Name = "Bicubic (OpenCL)")]
BicubicCl,
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index 959ab1b1b..58f67401e 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -324,7 +324,9 @@ namespace HandBrake.ApplicationServices.Services.Base userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding));
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva),
+ userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode) == VideoScaler.BicubicCl);
this.logBuffer = new StringBuilder();
this.logBuffer.AppendLine(String.Format("CLI Query: {0}", query));
this.logBuffer.AppendLine(String.Format("User Query: {0}", encodeQueueTask.CustomQuery));
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs index 9e95b31cd..5ad95d08e 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs @@ -143,7 +143,9 @@ namespace HandBrake.ApplicationServices.Services userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding));
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva),
+ userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode) == VideoScaler.BicubicCl);
ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, query)
{
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs index 92cbdf4aa..9b007a618 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs @@ -46,10 +46,16 @@ namespace HandBrake.ApplicationServices.Utilities /// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
+ /// <param name="enableHwd">
+ /// The enable Hwd.
+ /// </param>
+ /// <param name="enableOpenCL">
+ /// The enable Open CL.
+ /// </param>
/// <returns>
/// A Cli Query
/// </returns>
- public static string GenerateQuery(EncodeTask task, int previewScanCount, int verbosity, bool disableLibDvdNav, bool disableQsvDecode)
+ public static string GenerateQuery(EncodeTask task, int previewScanCount, int verbosity, bool disableLibDvdNav, bool disableQsvDecode, bool enableHwd, bool enableOpenCL)
{
if (string.IsNullOrEmpty(task.Source))
{
@@ -59,7 +65,7 @@ namespace HandBrake.ApplicationServices.Utilities string query = string.Empty;
query += SourceQuery(task, null, null, previewScanCount);
query += DestinationQuery(task);
- query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode);
+ query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode, enableHwd, enableOpenCL);
return query;
}
@@ -96,7 +102,7 @@ namespace HandBrake.ApplicationServices.Utilities string query = string.Empty;
query += SourceQuery(task, duration, startAtPreview, previewScanCount);
query += DestinationQuery(task);
- query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode);
+ query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode, false, false);
return query;
}
@@ -121,10 +127,16 @@ namespace HandBrake.ApplicationServices.Utilities /// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
+ /// <param name="enableHwd">
+ /// The enable Hwd.
+ /// </param>
+ /// <param name="enableOpenCL">
+ /// The enable Open CL.
+ /// </param>
/// <returns>
/// The CLI query for the Tabbed section of the main window UI
/// </returns>
- private static string GenerateTabbedComponentsQuery(EncodeTask task, bool enableFilters, int verbosity, bool disableLibDvdNav, bool disableQsvDecode)
+ private static string GenerateTabbedComponentsQuery(EncodeTask task, bool enableFilters, int verbosity, bool disableLibDvdNav, bool disableQsvDecode, bool enableHwd, bool enableOpenCL)
{
string query = string.Empty;
@@ -154,7 +166,7 @@ namespace HandBrake.ApplicationServices.Utilities query += AdvancedQuery(task);
// Extra Settings
- query += ExtraSettings(verbosity, disableLibDvdNav, disableQsvDecode);
+ query += ExtraSettings(verbosity, disableLibDvdNav, disableQsvDecode, enableHwd, enableOpenCL);
return query;
}
@@ -1024,10 +1036,16 @@ namespace HandBrake.ApplicationServices.Utilities /// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
+ /// <param name="enableHwd">
+ /// The enable Hwd.
+ /// </param>
+ /// <param name="enableOpenCL">
+ /// The enable Open CL.
+ /// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
- private static string ExtraSettings(int verbosity, bool disableLibdvdNav, bool disableQsvDecode)
+ private static string ExtraSettings(int verbosity, bool disableLibdvdNav, bool disableQsvDecode, bool enableHwd, bool enableOpenCL)
{
string query = string.Empty;
@@ -1041,6 +1059,11 @@ namespace HandBrake.ApplicationServices.Utilities if (disableQsvDecode)
query += " --disable-qsv-decoding";
+ if (enableOpenCL)
+ query += " -P ";
+
+ if (enableHwd)
+ query += " -U ";
return query;
}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs index 1eeedd653..d7f7779d5 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs @@ -13,6 +13,7 @@ namespace HandBrakeWPF.Converters.Video using System.Globalization;
using System.Windows.Data;
+ using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Utilities;
using HandBrakeWPF.Model;
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 02b1f0bc7..bb24758b6 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -136,7 +136,6 @@ <Compile Include="Constants.cs" />
<Compile Include="Controls\SplitButton\SplitMenuButton.cs" />
<Compile Include="Converters\Video\ScalingConverter.cs" />
- <Compile Include="Model\VideoScaler.cs" />
<Compile Include="ViewModels\CountdownAlertViewModel.cs" />
<Compile Include="ViewModels\Interfaces\ICountdownAlertViewModel.cs" />
<Compile Include="Views\CountdownAlertView.xaml.cs">
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index b432cc0bd..3e55ad7e5 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -385,7 +385,7 @@ namespace HandBrakeWPF.Properties { /// <summary>
/// Looks up a localized string similar to Please note, this option is suitable only for slower systems.
- ///Hardware decoders are designed for playback, not for re-encoding video so will likely bottleneck on faster systems..
+ ///Hardware decoders are currently designed for playback, not for re-encoding video so will likely bottleneck on faster systems..
/// </summary>
public static string Video_DxvaDecode {
get {
@@ -466,9 +466,9 @@ namespace HandBrakeWPF.Properties { ///
///In order to use the QuickSync encoder, you must:
///
- ///- Have a Intel Core series CPU with HD Graphics.
+ ///- Have a Intel Core series CPU with HD Graphics. Haswell or newer parts are recommended.
///- Have a monitor connected to the HD Graphics
- ///- Note in multi-GPU environments, there may be workarounds but these are not officially supported..
+ ///- Note that in multi-GPU enviroments, you may need to use 3rd party tools and workarounds to active the hardware..
/// </summary>
public static string Video_QuickSyncNotAvailable {
get {
@@ -478,9 +478,9 @@ namespace HandBrakeWPF.Properties { /// <summary>
/// Looks up a localized string similar to Lanczos - This is HandBrakes default scaler. It provides the best quality downscaling.
- ///Bicubic - Bicubic is faster but quality may not be as good. Video may not appear as soft and as a result file sizes may be larger
///Bicubic OpenCL - A hardware accelerated version of the CPU based Bicubic scaler.
- /// This can be around 5~7% faster than software bicubic on a fast modern graphics card..
+ /// This can be around 5~7% faster than software bicubic on a fast modern graphics card.
+ /// If OpenCL is unavailable, it will fallback to a software scaler. .
/// </summary>
public static string Video_ScalingModes {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 3a7231687..95de8bf8f 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -352,21 +352,21 @@ If you do not use this tab, it can be hidden from: Tools Menu > Options > </data>
<data name="Video_DxvaDecode" xml:space="preserve">
<value>Please note, this option is suitable only for slower systems.
-Hardware decoders are designed for playback, not for re-encoding video so will likely bottleneck on faster systems.</value>
+Hardware decoders are currently designed for playback, not for re-encoding video so will likely bottleneck on faster systems.</value>
</data>
<data name="Video_QuickSyncNotAvailable" xml:space="preserve">
<value>QuickSync hardware not detected!
In order to use the QuickSync encoder, you must:
-- Have a Intel Core series CPU with HD Graphics.
+- Have a Intel Core series CPU with HD Graphics. Haswell or newer parts are recommended.
- Have a monitor connected to the HD Graphics
-- Note in multi-GPU environments, there may be workarounds but these are not officially supported.</value>
+- Note that in multi-GPU enviroments, you may need to use 3rd party tools and workarounds to active the hardware.</value>
</data>
<data name="Video_ScalingModes" xml:space="preserve">
<value>Lanczos - This is HandBrakes default scaler. It provides the best quality downscaling.
-Bicubic - Bicubic is faster but quality may not be as good. Video may not appear as soft and as a result file sizes may be larger
Bicubic OpenCL - A hardware accelerated version of the CPU based Bicubic scaler.
- This can be around 5~7% faster than software bicubic on a fast modern graphics card.</value>
+ This can be around 5~7% faster than software bicubic on a fast modern graphics card.
+ If OpenCL is unavailable, it will fallback to a software scaler. </value>
</data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 1ce0f000e..0a4837719 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1342,7 +1342,9 @@ namespace HandBrakeWPF.ViewModels userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding)),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva),
+ userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode) == VideoScaler.BicubicCl),
"CLI Query",
MessageBoxButton.OK,
MessageBoxImage.Information);
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index e6d47241f..cd2d10423 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -22,6 +22,7 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index df7edf4e8..c31fccae6 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -313,28 +313,28 @@ <StackPanel Orientation="Vertical" Margin="0,10,0,20">
- <TextBlock Text="Decoding" FontSize="14" Margin="0,10,0,10" Visibility="Collapsed" />
+ <TextBlock Text="Decoding" FontSize="14" Margin="0,10,0,10" />
- <StackPanel Orientation="Vertical" Margin="20,0,0,0" Visibility="Collapsed" >
+ <StackPanel Orientation="Vertical" Margin="20,0,0,0" >
<CheckBox Content="Enable DXVA Hardware Accelerated Decoding" IsChecked="{Binding EnableDxvaDecoding}" />
</StackPanel>
- <StackPanel Orientation="Vertical" Margin="37,2,0,0" Visibility="Collapsed" >
+ <StackPanel Orientation="Vertical" Margin="37,2,0,0" >
<TextBlock Text="{x:Static Properties:Resources.Video_DxvaDecode}" />
</StackPanel>
- <TextBlock Text="Scaling" FontSize="14" Margin="0,20,0,10" Visibility="Collapsed" />
+ <TextBlock Text="Scaling" FontSize="14" Margin="0,20,0,10" />
- <StackPanel Orientation="Horizontal" Margin="20,0,0,0" Visibility="Collapsed">
+ <StackPanel Orientation="Horizontal" Margin="20,0,0,0">
<TextBlock Text="Choose Scaler: " Margin="0,0,5,0" VerticalAlignment="Center" />
<ComboBox ItemsSource="{Binding ScalingOptions, Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding SelectedScalingMode, Converter={StaticResource enumComboConverter}}"
Width="120" VerticalAlignment="Center" />
</StackPanel>
- <StackPanel Orientation="Vertical" Margin="26,2,0,0" Visibility="Collapsed" >
+ <StackPanel Orientation="Vertical" Margin="26,2,0,0" >
<TextBlock Text="{x:Static Properties:Resources.Video_ScalingModes}" TextWrapping="Wrap "/>
</StackPanel>
|