]> granicus.if.org Git - handbrake/commitdiff
WinGui: qsv bug fixes and a demo preset for testing purposes.
authorsr55 <sr55.hb@outlook.com>
Sun, 3 Mar 2013 18:09:57 +0000 (18:09 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 3 Mar 2013 18:09:57 +0000 (18:09 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/qsv@5288 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs

index 5edfb4e1e2f41cfe5e1bdfa95a7341ea922feffd..99369073b78801e1757af9e9d3ba34f871aab49b 100644 (file)
@@ -24,6 +24,7 @@ namespace HandBrake.ApplicationServices.Services
     using HandBrake.ApplicationServices.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Model.Encoding;\r
     using HandBrake.ApplicationServices.Utilities;\r
+    using HandBrake.Interop.Model.Encoding;\r
 \r
     /// <summary>\r
     /// The preset service manages HandBrake's presets\r
@@ -444,6 +445,8 @@ namespace HandBrake.ApplicationServices.Services
                             this.presets.Add(preset);\r
                         }\r
                     }\r
+\r
+                    this.presets.Add(this.QsvDemoPreset()); // TODO remove later.\r
                 } \r
             }\r
             catch (Exception exc)\r
@@ -505,5 +508,40 @@ namespace HandBrake.ApplicationServices.Services
         }\r
 \r
         #endregion\r
+\r
+        #region Tempory Hack\r
+\r
+        /// <summary>\r
+        /// The qsv preset temp.\r
+        /// </summary>\r
+        /// <returns>\r
+        /// The <see cref="Preset"/>.\r
+        /// </returns>\r
+        private Preset QsvDemoPreset()\r
+        {\r
+            Preset preset = new Preset();\r
+            preset.Name = "QuickSync Demo";\r
+            preset.Category = "Regular";\r
+            preset.Description = "An example preset for QSV";\r
+            preset.IsBuildIn = true;\r
+            preset.PictureSettingsMode = PresetPictureSettingsMode.None;\r
+            preset.Task = new EncodeTask();\r
+\r
+            preset.Task.VideoEncoder = VideoEncoder.QuickSync;\r
+            preset.Task.Quality = 20;\r
+            preset.Task.AdvancedEncoderOptions =\r
+                "qsv-num-ref-frame=3:qsv-gop-ref-dist=5:qsv-gop-pic-size=5:qsv-async-depth=4";\r
+            preset.Task.AudioTracks = new ObservableCollection<AudioTrack>();\r
+            preset.Task.AudioTracks.Add(new AudioTrack { Bitrate = 160, Encoder = AudioEncoder.Faac, MixDown = Mixdown.DolbyProLogicII});\r
+            preset.Task.Anamorphic = Anamorphic.Loose;\r
+            preset.Task.QsvPreset = QsvPreset.Balanced;\r
+            preset.Task.FramerateMode = FramerateMode.VFR;\r
+            preset.Task.OutputFormat = OutputFormat.Mp4;\r
+            preset.Task.VideoEncodeRateType = VideoEncodeRateType.ConstantQuality;\r
+            \r
+            return preset;\r
+        }\r
+\r
+        #endregion\r
     }\r
 }\r
index 88cfd28be177331199ee2f63c6c67de2dedfa4f9..f0f7402ad05c1fb4f8c28f86cc52fff308d904b6 100644 (file)
@@ -426,7 +426,6 @@ namespace HandBrake.ApplicationServices.Utilities
                 case VideoEncoder.FFMpeg2:\r
                     query += " -e ffmpeg2";\r
                     break;\r
-\r
                 case VideoEncoder.QuickSync:\r
                     query += " -e qsv";\r
                     break;\r
@@ -455,6 +454,7 @@ namespace HandBrake.ApplicationServices.Utilities
                         case VideoEncoder.FFMpeg2:\r
                             query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));\r
                             break;\r
+                        case VideoEncoder.QuickSync:\r
                         case VideoEncoder.X264:\r
                             query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));\r
                             break;\r
index 7aac803066b37e6a2a150e260354456f20281fa3..f3b4bf096b435d3caa6a81b1635c5f9237720b6e 100644 (file)
@@ -19,6 +19,9 @@ namespace HandBrake.Interop.Model.Encoding
                [Display(Name = "H.264 (x264)")]\r
                X264 = 0,\r
 \r
+        [Display(Name = "QuickSync (H.264)")]\r
+        QuickSync,\r
+\r
                [Display(Name = "MPEG-4 (FFmpeg)")]\r
                FFMpeg,\r
 \r
@@ -27,8 +30,5 @@ namespace HandBrake.Interop.Model.Encoding
 \r
                [Display(Name = "VP3 (Theora)")]\r
                Theora,\r
-\r
-        [Display(Name = "QuickSync (H.264)")]\r
-        QuickSync\r
        }\r
 }\r
index 39a51cf4e3775b935a746a6847e3fddb67fde31b..37ec57cab328c5c864e14bbd8d42b4d2b6ca309d 100644 (file)
@@ -310,7 +310,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             get\r
             {\r
-                return 51.Equals(this.RF);\r
+                return 51.Equals(this.RF) && this.SelectedVideoEncoder == VideoEncoder.X264;\r
             }\r
         }\r
 \r
@@ -373,6 +373,7 @@ namespace HandBrakeWPF.ViewModels
                     case VideoEncoder.FFMpeg2:\r
                         this.Task.Quality = (32 - value);\r
                         break;\r
+                    case VideoEncoder.QuickSync:\r
                     case VideoEncoder.X264:\r
                         double rfValue = 51.0 - value * cqStep;\r
                         rfValue = Math.Round(rfValue, 2);\r
@@ -840,6 +841,7 @@ namespace HandBrakeWPF.ViewModels
                         this.RF = 32 - cq;\r
                     }\r
                     break;\r
+                case VideoEncoder.QuickSync:\r
                 case VideoEncoder.X264:\r
 \r
                     double multiplier = 1.0 / cqStep;\r
@@ -913,6 +915,7 @@ namespace HandBrakeWPF.ViewModels
             this.NotifyOfPropertyChange(() => this.H264Profile);\r
             this.NotifyOfPropertyChange(() => this.FastDecode);\r
             this.NotifyOfPropertyChange(() => this.ExtraArguments);\r
+            this.NotifyOfPropertyChange(() => this.QsvPreset);\r
         }\r
 \r
         /// <summary>\r
@@ -953,7 +956,6 @@ namespace HandBrakeWPF.ViewModels
         {\r
             this.canClear = false;\r
             this.X264PresetValue = 5;\r
-            this.qsvPresetValue = 2;\r
             this.X264Tune = x264Tune.None;\r
             this.H264Profile = x264Profile.None;\r
             this.FastDecode = false;\r
@@ -979,6 +981,7 @@ namespace HandBrakeWPF.ViewModels
                     this.QualityMax = 31;\r
                     break;\r
                 case VideoEncoder.X264:\r
+                case VideoEncoder.QuickSync:\r
                     this.QualityMin = 0;\r
                     this.QualityMax = (int)(51 / userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step));\r
                     break;\r