]> granicus.if.org Git - handbrake/commitdiff
WinGui: use Range 0-63 for QSV H.265 10bit. It's not strictly correct but it's proba...
authorsr55 <sr55.hb@outlook.com>
Mon, 4 Dec 2017 18:53:01 +0000 (18:53 +0000)
committersr55 <sr55.hb@outlook.com>
Mon, 4 Dec 2017 18:53:14 +0000 (18:53 +0000)
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs

index 2c1df3fdbad06e4a6625a6fe90f2a4b6c31efb18..5b6caa1f5c4e9123f45895457f5860d8f8ed70ec 100644 (file)
@@ -67,7 +67,7 @@ namespace HandBrakeWPF.ViewModels
         private bool displayLevelControl;\r
         private bool displayProfileControl;\r
         private Dictionary<string, string> encoderOptions = new Dictionary<string, string>();\r
-        \r
+\r
         #endregion\r
 \r
         #region Constructors and Destructors\r
@@ -326,7 +326,7 @@ namespace HandBrakeWPF.ViewModels
                     case VideoEncoder.FFMpeg:\r
                     case VideoEncoder.FFMpeg2:\r
                         this.Task.Quality = (32 - value);\r
-                        break;    \r
+                        break;\r
                     case VideoEncoder.VP8:\r
                     case VideoEncoder.VP9:\r
                         this.Task.Quality = (63 - value);\r
@@ -340,15 +340,19 @@ namespace HandBrakeWPF.ViewModels
                         double rfValue = 51.0 - (value * cqStep);\r
                         rfValue = Math.Round(rfValue, 2);\r
                         this.Task.Quality = rfValue;\r
-                        break;           \r
+                        break;\r
                     case VideoEncoder.QuickSync:\r
                     case VideoEncoder.QuickSyncH265:\r
-                    case VideoEncoder.QuickSyncH26510b:\r
                         rfValue = 51.0 - value;\r
                         rfValue = Math.Round(rfValue, 0);\r
                         this.Task.Quality = rfValue;\r
                         break;\r
-                    case VideoEncoder.Theora:                 \r
+                    case VideoEncoder.QuickSyncH26510b:\r
+                        rfValue = 63.0 - (value - 0);\r
+                        rfValue = Math.Round(rfValue, 0);\r
+                        this.Task.Quality = rfValue;\r
+                        break;\r
+                    case VideoEncoder.Theora:\r
                         Task.Quality = value;\r
                         break;\r
                 }\r
@@ -432,7 +436,7 @@ namespace HandBrakeWPF.ViewModels
             get\r
             {\r
                 return this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 || this.SelectedVideoEncoder == VideoEncoder.X265\r
-                    || this.SelectedVideoEncoder == VideoEncoder.X265_10 || this.SelectedVideoEncoder == VideoEncoder.X265_12 ? "RF" : "QP";\r
+                       || this.SelectedVideoEncoder == VideoEncoder.X265_10 || this.SelectedVideoEncoder == VideoEncoder.X265_12 ? "RF" : "QP";\r
             }\r
         }\r
 \r
@@ -935,12 +939,12 @@ namespace HandBrakeWPF.ViewModels
                     this.ShowPeakFramerate = true;\r
                     break;\r
             }\r
-         \r
+\r
             this.TwoPass = preset.Task.TwoPass;\r
             this.TurboFirstPass = preset.Task.TurboFirstPass;\r
 \r
             this.VideoBitrate = preset.Task.VideoEncodeRateType == VideoEncodeRateType.AverageBitrate ? preset.Task.VideoBitrate : null;\r
-         \r
+\r
             this.NotifyOfPropertyChange(() => this.Task);\r
 \r
             this.HandleEncoderChange(preset.Task.VideoEncoder);\r
@@ -1004,14 +1008,14 @@ namespace HandBrakeWPF.ViewModels
             this.NotifyOfPropertyChange(() => this.ExtraArguments);\r
 \r
             this.VideoTune = (task.VideoTunes != null && task.VideoTunes.Any() ? task.VideoTunes.FirstOrDefault(t => !Equals(t, VideoTune.FastDecode)) : this.VideoTunes.FirstOrDefault())\r
-                                        ?? VideoTune.None;\r
+                             ?? VideoTune.None;\r
 \r
             HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper<VideoEncoder>.GetShortName(this.SelectedVideoEncoder));\r
             if (encoder != null && this.VideoPreset != null)\r
             {\r
                 int index = encoder.Presets.IndexOf(this.VideoPreset.ShortName);\r
                 this.VideoPresetValue = index;\r
-            }          \r
+            }\r
         }\r
 \r
         public bool MatchesPreset(Preset preset)\r
@@ -1148,10 +1152,13 @@ namespace HandBrakeWPF.ViewModels
                     break;\r
                 case VideoEncoder.QuickSync:\r
                 case VideoEncoder.QuickSyncH265:\r
-                case VideoEncoder.QuickSyncH26510b:\r
                     this.QualityMin = 0;\r
                     this.QualityMax = 51;\r
                     break;\r
+                case VideoEncoder.QuickSyncH26510b:\r
+                    this.QualityMin = 0;\r
+                    this.QualityMax = 63;\r
+                    break;\r
                 case VideoEncoder.X264:\r
                 case VideoEncoder.X264_10:\r
                 case VideoEncoder.X265:\r
@@ -1178,7 +1185,7 @@ namespace HandBrakeWPF.ViewModels
         private string GetActualx264Query()\r
         {\r
             string preset = this.VideoPreset != null ? this.VideoPreset.ShortName : string.Empty;\r
-            string profile = this.VideoProfile != null ? this.VideoProfile.ShortName : string.Empty; \r
+            string profile = this.VideoProfile != null ? this.VideoProfile.ShortName : string.Empty;\r
 \r
             List<string> tunes = new List<string>();\r
             if (this.VideoTune != null && this.VideoTune.ShortName != "none")\r
@@ -1207,12 +1214,12 @@ namespace HandBrakeWPF.ViewModels
             try\r
             {\r
                 return HandBrakeUtils.CreateX264OptionsString(\r
-                    preset, \r
-                    tunes, \r
-                    this.ExtraArguments, \r
-                    profile, \r
-                    this.VideoLevel != null ? this.VideoLevel.ShortName : string.Empty, \r
-                    width, \r
+                    preset,\r
+                    tunes,\r
+                    this.ExtraArguments,\r
+                    profile,\r
+                    this.VideoLevel != null ? this.VideoLevel.ShortName : string.Empty,\r
+                    width,\r
                     height);\r
             }\r
             catch (Exception)\r
@@ -1367,7 +1374,7 @@ namespace HandBrakeWPF.ViewModels
                 {\r
                     this.VideoLevel = VideoLevel.Auto;\r
                 }\r
-                \r
+\r
                 // Setup Presets.\r
                 this.VideoPresets.Clear();\r
                 if (encoder.Presets != null)\r
@@ -1401,7 +1408,7 @@ namespace HandBrakeWPF.ViewModels
                                           this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265 || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b ||\r
                                           this.SelectedVideoEncoder == VideoEncoder.VP8 || this.SelectedVideoEncoder == VideoEncoder.VP9;\r
             this.DisplayNonQSVControls = this.SelectedVideoEncoder != VideoEncoder.QuickSync && this.SelectedVideoEncoder != VideoEncoder.QuickSyncH265 && this.SelectedVideoEncoder != VideoEncoder.QuickSyncH26510b;\r
-            this.DisplayTurboFirstPass = selectedEncoder == VideoEncoder.X264 || selectedEncoder == VideoEncoder.X264_10 || \r
+            this.DisplayTurboFirstPass = selectedEncoder == VideoEncoder.X264 || selectedEncoder == VideoEncoder.X264_10 ||\r
                                          selectedEncoder == VideoEncoder.X265 || selectedEncoder == VideoEncoder.X265_10 || selectedEncoder == VideoEncoder.X265_12;\r
             this.DisplayTuneControls = SelectedVideoEncoder == VideoEncoder.X264 || SelectedVideoEncoder == VideoEncoder.X264_10 || SelectedVideoEncoder == VideoEncoder.X265 || SelectedVideoEncoder == VideoEncoder.X265_10 || SelectedVideoEncoder == VideoEncoder.X265_12;\r
             this.DisplayLevelControl = SelectedVideoEncoder == VideoEncoder.X264 || SelectedVideoEncoder == VideoEncoder.X264_10 || this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265 || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH26510b;\r
@@ -1429,7 +1436,7 @@ namespace HandBrakeWPF.ViewModels
                 this.NotifyOfPropertyChange(() => SelectedFramerate);\r
                 this.UseAdvancedTab = false;\r
             }\r
-            \r
+\r
             // Cleanup Extra Arguments\r
             // Load the cached arguments. Saves the user from resetting when switching encoders.\r
             string result;\r