From 5a4ccc3a37e631ddb9ebe51ebd69c245949e1796 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 12 Jan 2019 19:41:52 +0000 Subject: [PATCH] WinGui: Strip out some legacy code for x264 options handling. --- .../Video/EncoderOptionsTooltipConverter.cs | 20 +- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 13 - .../Helpers/AdvancedChoicesHelper.cs | 367 - win/CS/HandBrakeWPF/Model/AdvancedChoice.cs | 32 - .../Properties/Resources.Designer.cs | 10657 ++++++++-------- .../HandBrakeWPF/Properties/Resources.de.resx | 160 +- win/CS/HandBrakeWPF/Properties/Resources.resx | 126 - .../Encode/Factories/EncodeTaskFactory.cs | 24 +- .../Services/Encode/Model/EncodeTask.cs | 124 +- .../Presets/Factories/JsonPresetFactory.cs | 8 - .../Services/UserSettingService.cs | 1 - .../HandBrakeWPF/Startup/AppBootstrapper.cs | 1 - win/CS/HandBrakeWPF/UserSettingConstants.cs | 1 - .../ViewModels/Interfaces/IX264ViewModel.cs | 32 - .../HandBrakeWPF/ViewModels/MainViewModel.cs | 52 +- .../HandBrakeWPF/ViewModels/VideoViewModel.cs | 84 +- .../HandBrakeWPF/ViewModels/X264ViewModel.cs | 1151 -- win/CS/HandBrakeWPF/Views/VideoView.xaml | 1 - win/CS/HandBrakeWPF/Views/X264View.xaml | 533 - win/CS/HandBrakeWPF/Views/X264View.xaml.cs | 25 - win/CS/HandBrakeWPF/defaultsettings.xml | 8 - 21 files changed, 5282 insertions(+), 8138 deletions(-) delete mode 100644 win/CS/HandBrakeWPF/Helpers/AdvancedChoicesHelper.cs delete mode 100644 win/CS/HandBrakeWPF/Model/AdvancedChoice.cs delete mode 100644 win/CS/HandBrakeWPF/ViewModels/Interfaces/IX264ViewModel.cs delete mode 100644 win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs delete mode 100644 win/CS/HandBrakeWPF/Views/X264View.xaml delete mode 100644 win/CS/HandBrakeWPF/Views/X264View.xaml.cs diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs index d0486eff9..c66b339cc 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs @@ -16,15 +16,12 @@ namespace HandBrakeWPF.Converters.Video using HandBrake.Interop.Interop.Model.Encoding; - using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask; - using VideoLevel = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoLevel; - using VideoPreset = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoPreset; - using VideoProfile = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoProfile; - using VideoTune = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoTune; + using EncodeTask = Services.Encode.Model.EncodeTask; + using VideoLevel = Services.Encode.Model.Models.Video.VideoLevel; + using VideoPreset = Services.Encode.Model.Models.Video.VideoPreset; + using VideoProfile = Services.Encode.Model.Models.Video.VideoProfile; + using VideoTune = Services.Encode.Model.Models.Video.VideoTune; - /// - /// The x 264 queue tooltip converter. - /// public class EncoderOptionsTooltipConverter : IValueConverter { /// @@ -50,11 +47,6 @@ namespace HandBrakeWPF.Converters.Video EncodeTask task = value as EncodeTask; if (task != null && (task.VideoEncoder == VideoEncoder.X264 || task.VideoEncoder == VideoEncoder.X264_10 || task.VideoEncoder == VideoEncoder.X265 || task.VideoEncoder == VideoEncoder.X265_10 || task.VideoEncoder == VideoEncoder.X265_12)) { - if (task.ShowAdvancedTab) - { - return task.AdvancedEncoderOptions; - } - VideoTune tune = task.VideoTunes.FirstOrDefault(); return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}", @@ -66,7 +58,7 @@ namespace HandBrakeWPF.Converters.Video Environment.NewLine); } - return task != null ? task.AdvancedEncoderOptions : string.Empty; + return string.Empty; } /// diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index d241ecaa0..de74348b3 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -339,7 +339,6 @@ - @@ -373,11 +372,9 @@ - - @@ -385,7 +382,6 @@ - @@ -425,9 +421,6 @@ SummaryView.xaml - - X264View.xaml - AudioView.xaml @@ -583,10 +576,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -735,11 +724,9 @@ - $(TargetFrameworkSDKToolsDirectory)$(Platform)\ - - - + + - + - - - - + + + + - - + + - - + + - - - - + + + + - + - + @@ -117,120 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - x264 hat eine Menge Algorithmen um zu entscheiden, wann B-Frames verwendet werden sollen und wie sie verwendet werden. - -Der schnelle Modus benötigt ungefähr die selbe Zeit, ganz egal wie viele B-Frames festgelegt sind. - -Der optimale Modus wird langsamer wenn sich die maximale Anzahl an B-Frames erhöht, macht aber viel exaktere Entscheidungen, speziell wenn B-Pyramid verwendet wird. - - - H.264 erlaubt in B-Frames zwei verschiedene Vorhersagemethoden, räumlich und zeitlich. - -Räumlich, der Standard, ist in den meisten Fällen die besser Wahl, jedoch kann 'zeitlich' in manchen Fällen auch nützlich sein. - -x264 kann, unter der Einbuße von etwas Geschwindigkeit (und demzufolge für einen kleinen Vorteil bezüglich der Kompression), adaptiv entscheiden welche Methode für das jeweilige Einzelbild die bessere ist. - - - Die adaptive Quantisierung steuert, wie der Enkoder die Bits über das Einzelbild verteilt. -Höhere Werte entfernen mehr Bits von Kanten und komplexen Bereichen, um Bereiche mit feineren Details zu verbessern. - - - Die Modusentscheidung wählt aus einer Vielzahl von Optionen aus, um eine Entscheidung zu treffen: Diese Einstellung wählt, welche Optionen das sind. -Weniger zu überprüfende Partitionen bedeuten eine schnellere Kodierung auf Kosten schlechterer Entscheidungen, da die beste Option möglicherweise eine deaktivierte war. - - - Vernünftige Werte liegen im Bereich ~2-5. -Dies legt die maximale Anzahl aufeinanderfolgender B-Frames fest, die der Enkoder verwenden kann. -Große Werte helfen in der Regel nicht viel, solange adaptive B-Frames nicht auf Optimal eingestellt ist. -Cel-animiertes Ausgangsmaterial und B-Pyramid erhöhen ebenfalls signifikant den Nutzen größerer Werte. -Das Basisprofil, wie es für iPods und ähnliche Geräte erforderlich ist, erfordert, dass die B-Frames auf 0 (aus) gesetzt ist. - - - Nachdem der Enkoder seine Arbeit getan hat, hat er eine Menge Daten, die verlustfrei komprimiert werden müssen, ähnlich wie ZIP oder RAR. H.264 bietet dafür zwei Möglichkeiten: CAVLC und CABAC. CABAC dekodiert viel langsamer, komprimiert aber deutlich besser (10-30%), insbesondere bei niedrigeren Bitraten. Wenn die CPU-Anforderungen für die Videowiedergabe minimieren werden soll, sollte diese Option deaktiviert sein. Das Basisprofil, wie es für iPods und ähnliche Geräte erforderlich ist, erfordert, dass CABAC deaktiviert wird. - - - H.264 besitzt einen eingebauten Deblockingfilter, der nach jedem dekodierten Einzelbild Blockartefakte glättet. Dies verbessert nicht nur die visuelle Qualität, sondern verbessert auch signifikant die Kompression. -Der Deblockingfilter benötigt viel CPU-Leistung, wenn also die CPU-Anforderungen beim Abspielen des Videos minimiert werden soll, sollte diese Option deaktiviert werden. -Der Deblockingfilter hat zwei einstellbare Parameter, "Stärke" und "Schwellenwert". -Ersteres beeinflusst wie stark (oder schwach) der Deblocker ist, wohingegen letzteres festlegt auf wie viele (oder wenige) Kanten er angewandt wird. -Kleinere Werte bedeuten weniger Deblocking, höhere Werte bedeuten mehr Deblocking. Der Standardwert ist 0 (normale Stärke) für beide Parameter. - - - Die 8x8-Transformation ist die nützlichste Funktion von x264 in Bezug auf Kompression pro Geschwindigkeit. -Es verbessert die Kompression um mindestens 5% bei sehr geringen Geschwindigkeitskosten und kann im Vergleich zu seiner Kompressionsverstärkung einen ungewöhnlich hohen visuellen Qualitätsvorteil bieten. -Allerdings erfordert es 'High Profile', das einige Geräte möglicherweise nicht unterstützen. - - - Steuert die Methode der Bewegungsschätzung. Die Bewegungsschätzung ist die Art und Weise, wie der Enkoder schätzt, wie sich jeder Pixelblock in einem Einzelbild bewegt hat. -Eine bessere Bewegungssuchmethode verbessert die Kompression auf Kosten der Geschwindigkeit. - -Diamond: Führt eine extrem schnelle und einfache Suche mit einem Diamantmuster durch. - -Hexagon: Führt eine etwas effektivere, aber etwas langsamere Suche mit einem Hexagonmuster durch. - -Uneven Multi-Hex: Führt eine sehr breite Suche mit einer Vielzahl von Mustern durch, um komplexe Bewegungen genauer zu erfassen. - -Exhaustive: Führt eine "dumme" Suche nach jedem Pixel in einem großen Bereich durch. Deutlich langsamer mit nur einem geringen Kompressionsgewinn. - -Transformed Exhaustive: Wie Exhaustive, aber trifft noch genauere Entscheidungen. Dementsprechend etwas langsamer, auch für nur eine kleine Verbesserung. - - - Dies ist die Entfernung, die x264 aus seiner besten Schätzung bei der Bewegung eines Blocks sucht, um zu versuchen, seine tatsächliche Bewegung zu finden. - -Die Standardeinstellung ist für die meisten Inhalte in Ordnung, aber Videos mit extremen Bewegungen, insbesondere bei HD-Auflösungen, können von höheren Werten profitieren, wenn auch unter hohen Geschwindigkeitskosten. - - - x264 entfernt normalerweise fast leere Datenblöcke, um Bits zu speichern, die besser für einen anderen Zweck im Video verwendet werden können. -Dies kann jedoch manchmal leicht negative Auswirkungen auf die Beibehaltung von feiner Körnung und Dither haben. -Dies auf den Standardeinstellungen belassen, es sei denn bei Banding-Problemen oder oder Problemen bei denen geringes Rauschen beibehalten werden soll. - - - Psychovisuelle Ratenverzerrung bedeutet, dass x264 versucht, Details zu erhalten, um eine bessere Qualität für das menschliche Auge zu erreichen, -im Gegensatz zu dem Versuch, die Qualität so zu maximieren, wie ein Computer sie versteht, durch Signal-Rausch-Abstände, welche Probleme haben, feine Details und Rauschen zu unterscheiden. - - - Psychovisuelles Trellis versucht, mehr Schärfe und Details zu erhalten, kann aber Artefakte verursachen. -Es gilt als experimentell, weshalb es standardmäßig ausgeschaltet ist. Gute Werte sind 0.1 bis 0.2. - - - B-Pyramid verbessert die Kompression, indem es eine pyramidenförmige Struktur (daher der Name) von B-Frames -erzeugt, die es B-Frames ermöglicht, sich gegenseitig zu referenzieren, um die Kompression zu verbessern. - -Erfordert Max B-Frames größer als 1; optimale adaptive B-Frames werden für den vollen Kompressionsvorteil dringend empfohlen. - - - Vernünftige Werte liegen bei ~1-6. - -Je mehr hinzugefügt wird, desto besser ist die Komprimierung, aber desto langsamer ist die Kodierung. - -Cel-Animationen profitieren tendenziell eher von mehr Referenzeinzelbildern als Filminhalte. - -Beachten Sie, dass viele Hardwaregeräte eine Begrenzung der Anzahl der unterstützten Referenzeinzelbilder haben. Wenn also für einen Handheld oder Standalone-Player kodiert wird, sollte dies auf den Standardwerten bleiben, es sei denn, man ist sich absolut sicher, dass man weiß was man tut! - - - Diese Einstellung steuert sowohl die Subpixel-Bewegungsabschätzung der Bewegungsschätzung als auch die Methoden zur Modusentscheidung. - -Die Subpixel-Bewegungsabschätzung wird verwendet, um Bewegungsschätzungen über die reine Pixelgenauigkeit hinaus zu verfeinern und die Kompression zu verbessern. - -Die Modusentscheidung ist die Methode, mit der man wählt, wie man jeden Block des Einzelbildes kodiert: eine sehr wichtige Entscheidung. - -SAD ist die schnellste Methode, gefolgt von SATD, RD, RD-Verfeinerung und der langsamsten, QPRD. -6 oder höher wird dringend empfohlen: Psy-RD, eine sehr leistungsstarke psychovisuelle Optimierung, die hilft, Details zu erhalten, erfordert RD. -10, die mächtigste und langsamste Option, erfordert trellis=2. - - - Trellis verfeinert die Rundung der Transformationskoeffizienten, um 3-5% mehr Kompression auf Kosten einer gewissen Geschwindigkeit zu erreichen. -"Immer" verwendet Trellis nicht nur während des Hauptkodierungsprozesses, sondern auch während der Analyse, was die Kompression noch weiter verbessert, wenn auch unter hohen Geschwindigkeitskosten. - -Trellis kostet mehr Geschwindigkeit bei höheren Bitraten. - - - Führt zusätzliche Analysen durch, um die Gewichtungsparameter für jedes Einzelbild festzulegen. -Dies verbessert die Gesamtkompression leicht und verbessert die Qualität der Überblendungen stark. -Das Basisprofil, wie es für iPods und ähnliche Geräte erforderlich ist, erfordert, dass die gewichtete P-Frame-Vorhersage deaktiviert wird. -Beachtet werden sollte, dass einige Geräte und Abspielgeräte auch solche, die das Hauptprofil unterstützen, Probleme mit der Vorhersage von gewichteten P-Frames haben können: Das Apple TV ist damit beispielsweise völlig inkompatibel. - Komplette Liste der Enkoderparameter: {0} @@ -259,11 +145,6 @@ Keine: Die Bildeinstellungen werden nicht in der Voreinstellung gespeichert. Bei Eigene: Es kann optional eine maximale Breite und Höhe eingestellt werden. Dabei ist eine Kodierung kleiner oder gleich diesen Werten. 'Das Seitenverhältnis beibehalten' wird automatisch angewendet. Quellenmaximum: Kodiert nach Möglichkeit immer mit der Quellauflösung. - - - Die Optionen werden an den x264-Enkoder weitergeleitet. -Die obigen Steuerelemente sind nur ein Teil nützlicher x264-Parameter. -In diesem Feld können zusätzliche oder aktuelle Parameter nach Belieben hinzugefügt oder geändert werden. Copyright (C) 2003-2019 Das HandBrake-Team @@ -485,11 +366,6 @@ Nicht beide zur selben Zeit! Die Voreinstellung könnte beschädigt sein oder von einer älteren Version von HandBrake stammen welche nicht mehr unterstützt wird. Voreinstellungen aus älteren Versionen müssen mit einer aktuellen Version neu erstellt werden. - - - Für diesen Enkoder ist kein Einstellungsfenster verfügbar. - -Bitte das Feld 'Zusätzliche Einstellungen' im Video-Tab verwenden um zusätzliche benötigte Enkoderparameter einzugeben. Zusätzliche erweiterte Argumente, die vom Videoenkoder angewendet werden. @@ -2008,4 +1884,4 @@ Dies beeinflusst nicht die momentanen Einstellungen im Untertitel-Tab. Auswahl zur Warteschlange hinzufügen - + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 521194d2c..b432b9eeb 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -117,122 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - x264 has a variety of algorithms to decide when to use B-frames and how many to use. - -Fast mode takes roughly the same amount of time no matter how many B-frames you specify. However, while fast, its decisions are often suboptimal. - -Optimal mode gets slower as the maximum number of B-Frames increases, but makes much more accurate decisions, especially when used with B-pyramid. - - - H.264 allows for two different prediction modes, spatial and temporal, in B-frames. - -Spatial, the default, is almost always better, but temporal is sometimes useful too. - -x264 can, at the cost of a small amount of speed (and accordingly for a small compression gain), adaptively select which is better for each particular frame. - - - Adaptive quantization controls how the encoder distributes bits across the frame. -Higher values take more bits away from edges and complex areas to improve areas with finer detail. - - - Mode decision picks from a variety of options to make its decision: this option chooses what options those are. -Fewer partitions to check means faster encoding, at the cost of worse decisions, since the best option might have been one that was turned off. - - - Sane values are ~2-5. -This specifies the maximum number of sequential B-frames that the encoder can use. - Large numbers generally won't help significantly unless Adaptive B-frames is set to Optimal. -Cel-animated source material and B-pyramid also significantly increase the usefulness of larger values. -Baseline profile, as required for iPods and similar devices, requires B-frames to be set to 0 (off). - - - After the encoder has done its work, it has a bunch of data that needs to be compressed losslessly, similar to ZIP or RAR. H.264 provides two options for this: CAVLC and CABAC. CABAC decodes a lot slower but compresses significantly better (10-30%), especially at lower bitrates. If you're looking to minimize CPU requirements for video playback, disable this option. Baseline profile, as required for iPods and similar devices, requires CABAC to be disabled. - - - H.264 has a built-in deblocking filter that smooths out blocking artifacts after decoding each frame. This not only improves visual quality, but also helps compression significantly. -The deblocking filter takes a lot of CPU power, so if you're looking to minimize CPU requirements for video playback, disable it. - -The deblocking filter has two adjustable parameters, "strength" and "threshold". -The former controls how strong (or weak) the deblocker is, while the latter controls how many (or few) edges it applies to. -Lower values mean less deblocking, higher values mean more deblocking. The default is 0 (normal strength) for both parameters. - - - The 8x8 transform is the single most useful feature of x264 in terms of compression-per-speed. -It improves compression by at least 5% at a very small speed cost and may provide an unusually high visual quality benefit compared to its compression gain. -However, it requires High Profile, which many devices may not support. - - - Controls the motion estimation method. Motion estimation is how the encoder estimates how each block of pixels in a frame has moved. -A better motion search method improves compression at the cost of speed. - -Diamond: performs an extremely fast and simple search using a diamond pattern. - -Hexagon: performs a somewhat more effective but slightly slower search using a hexagon pattern. - -Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex motion. - -Exhaustive: performs a "dumb" search of every pixel in a wide area. Significantly slower for only a small compression gain. - -Transformed Exhaustive: Like exhaustive, but makes even more accurate decisions. Accordingly, somewhat slower, also for only a small improvement. - - - This is the distance x264 searches from its best guess at the motion of a block in order to try to find its actual motion. - -The default is fine for most content, but extremely high motion video, especially at HD resolutions, may benefit from higher ranges, albeit at a high speed cost. - - - x264 normally zeroes out nearly-empty data blocks to save bits to be better used for some other purpose in the video. -However, this can sometimes have slight negative effects on retention of subtle grain and dither. -Don't touch this unless you're having banding issues or other such cases where you are having trouble keeping fine noise. - - - Psychovisual Rate Distortion means x264 tries to retain detail, for better quality to the human eye, -as opposed to trying to maximize quality the way a computer understands it, through signal-to-noise ratios that have trouble telling apart fine detail and noise. - - - Psychovisual Trellis tries to retain more sharpness and detail, but can cause artifacting. -It is considered experimental, which is why it's off by default. Good values are 0.1 to 0.2. - - - B-pyramid improves compression by creating a pyramidal structure (hence the name) of B-frames, allowing B-frames to -reference each other to improve compression. - -Requires Max B-frames greater than 1; optimal adaptive B-frames is strongly recommended for full compression benefit. - - - Sane values are ~1-6. - -The more you add, the better the compression, but the slower the encode. - -Cel animation tends to benefit from more reference frames a lot more than film content. - -Note that many hardware devices have limitations on the number of supported reference frames, so if you're encoding for a handheld or standalone player, don't touch this unless you're absolutely sure you know what you're doing! - - - This setting controls both subpixel-precision motion estimation and mode decision methods. - -Subpixel motion estimation is used for refining motion estimates beyond mere pixel accuracy, improving compression. - -Mode decision is the method used to choose how to encode each block of the frame: a very important decision. - -SAD is the fastest method, followed by SATD, RD, RD refinement, and the slowest, QPRD. -6 or higher is strongly recommended: Psy-RD, a very powerful psy optimization that helps retain detail, requires RD. -10, the most powerful and slowest option, requires trellis=2. - - - Trellis fine-tunes the rounding of transform coefficients to squeeze out 3-5% more compression at the cost of some speed. -"Always" uses trellis not only during the main encoding process, but also during analysis, which improves compression even more, albeit at great speed cost. - -Trellis costs more speed at higher bitrates. - - - Performs extra analysis to decide upon weighting parameters for each frame. -This improves overall compression slightly and improves the quality of fades greatly. -Baseline profile, as required for iPods and similar devices, requires weighted P-frame prediction to be disabled. -Note that some devices and players, even those that support Main Profile, -may have problems with Weighted P-frame prediction: the Apple TV is completely incompatible with it, for example. - The full list of encoder parameters: {0} @@ -261,11 +145,6 @@ None: Picture settings are not stored in the preset. When loading a source, the Custom: You can optionally set a Maximum width and Height. When doing this an encode will be less than or equal to these values. Keep Aspect Ratio will be automatically turned on. Source Maximum: Always encode at the sources resolution where possible. - - - The options passed to the x264 encoder. -The above controls are only a subset of useful x264 parameters. -This box allows you to add or modify additional or current parameters as desired. Copyright (C) 2003-2019 The HandBrake Team @@ -488,11 +367,6 @@ Not both at the same time! The preset may be corrupted or from an older version of HandBrake which is not supported. Presets from older versions must be re-created in the current version. - - - There is no options pane available for this encoder. - -Please use the 'Extra Options' box on the 'Video' tab to input any additional encoder parameters you may need. Additional advanced arguments that can be passed to the video encoder. diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs index e938f8b5a..46ff1e97a 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs @@ -273,24 +273,16 @@ namespace HandBrakeWPF.Services.Encode.Factories video.Encoder = videoEncoder.ShortName; } - string advancedOptions = job.ShowAdvancedTab ? job.AdvancedEncoderOptions : string.Empty; - if (!string.IsNullOrEmpty(advancedOptions)) - { - video.Options = advancedOptions; - } - else - { - video.Level = job.VideoLevel != null ? job.VideoLevel.ShortName : null; - video.Options = job.ExtraAdvancedArguments; - video.Preset = job.VideoPreset != null ? job.VideoPreset.ShortName : null; - video.Profile = job.VideoProfile != null ? job.VideoProfile.ShortName : null; + video.Level = job.VideoLevel?.ShortName; + video.Options = job.ExtraAdvancedArguments; + video.Preset = job.VideoPreset?.ShortName; + video.Profile = job.VideoProfile?.ShortName; - if (job.VideoTunes != null && job.VideoTunes.Count > 0) + if (job.VideoTunes != null && job.VideoTunes.Count > 0) + { + foreach (var item in job.VideoTunes) { - foreach (var item in job.VideoTunes) - { - video.Tune += string.IsNullOrEmpty(video.Tune) ? item.ShortName : "," + item.ShortName; - } + video.Tune += string.IsNullOrEmpty(video.Tune) ? item.ShortName : "," + item.ShortName; } } diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index a57b2e43b..aec7219c2 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -12,42 +12,29 @@ namespace HandBrakeWPF.Services.Encode.Model using System.Collections.Generic; using System.Collections.ObjectModel; - using Caliburn.Micro; - using HandBrake.Interop.Interop.Model; using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Model.Filters; using HandBrakeWPF.Services.Encode.Model.Models; - using AllowedPassthru = HandBrakeWPF.Services.Encode.Model.Models.AllowedPassthru; - using AudioTrack = HandBrakeWPF.Services.Encode.Model.Models.AudioTrack; - using ChapterMarker = HandBrakeWPF.Services.Encode.Model.Models.ChapterMarker; - using DenoisePreset = HandBrakeWPF.Services.Encode.Model.Models.DenoisePreset; - using DenoiseTune = HandBrakeWPF.Services.Encode.Model.Models.DenoiseTune; - using FramerateMode = HandBrakeWPF.Services.Encode.Model.Models.FramerateMode; - using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat; - using PointToPointMode = HandBrakeWPF.Services.Encode.Model.Models.PointToPointMode; - using SubtitleTrack = HandBrakeWPF.Services.Encode.Model.Models.SubtitleTrack; - using VideoLevel = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoLevel; - using VideoPreset = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoPreset; - using VideoProfile = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoProfile; - using VideoTune = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoTune; - - public class EncodeTask : PropertyChangedBase + using AllowedPassthru = Models.AllowedPassthru; + using AudioTrack = Models.AudioTrack; + using ChapterMarker = Models.ChapterMarker; + using DenoisePreset = Models.DenoisePreset; + using DenoiseTune = Models.DenoiseTune; + using FramerateMode = Models.FramerateMode; + using OutputFormat = Models.OutputFormat; + using PointToPointMode = Models.PointToPointMode; + using SubtitleTrack = Models.SubtitleTrack; + using VideoLevel = Models.Video.VideoLevel; + using VideoPreset = Models.Video.VideoPreset; + using VideoProfile = Models.Video.VideoProfile; + using VideoTune = Models.Video.VideoTune; + + public class EncodeTask { - #region Private Fields - - /// - /// The advanced panel enabled. - /// - private bool showAdvancedTab; - - #endregion - /// - /// Initializes a new instance of the class. - /// public EncodeTask() { this.Cropping = new Cropping(); @@ -70,7 +57,6 @@ namespace HandBrakeWPF.Services.Encode.Model /// public EncodeTask(EncodeTask task) { - this.AdvancedEncoderOptions = task.AdvancedEncoderOptions; this.AllowedPassthruOptions = new AllowedPassthru(task.AllowedPassthruOptions); this.Anamorphic = task.Anamorphic; this.Angle = task.Angle; @@ -153,8 +139,6 @@ namespace HandBrakeWPF.Services.Encode.Model this.ExtraAdvancedArguments = task.ExtraAdvancedArguments; this.MetaData = new MetaData(task.MetaData); - - this.ShowAdvancedTab = task.ShowAdvancedTab; } #region Source @@ -380,6 +364,31 @@ namespace HandBrakeWPF.Services.Encode.Model /// public VideoEncoder VideoEncoder { get; set; } + /// + /// Gets or sets the video profile. + /// + public VideoProfile VideoProfile { get; set; } + + /// + /// Gets or sets the video level. + /// + public VideoLevel VideoLevel { get; set; } + + /// + /// Gets or sets the video preset. + /// + public VideoPreset VideoPreset { get; set; } + + /// + /// Gets or sets the video tunes. + /// + public List VideoTunes { get; set; } + + /// + /// Gets or sets Extra Advanced Arguments for the Video Tab. + /// + public string ExtraAdvancedArguments { get; set; } + /// /// Gets or sets the Video Encode Mode /// @@ -455,59 +464,6 @@ namespace HandBrakeWPF.Services.Encode.Model #endregion - #region Advanced - - /// - /// Gets or sets AdvancedEncoderOptions. - /// - public string AdvancedEncoderOptions { get; set; } - - /// - /// Gets or sets the video profile. - /// - public VideoProfile VideoProfile { get; set; } - - /// - /// Gets or sets the video level. - /// - public VideoLevel VideoLevel { get; set; } - - /// - /// Gets or sets the video preset. - /// - public VideoPreset VideoPreset { get; set; } - - /// - /// Gets or sets the video tunes. - /// - public List VideoTunes { get; set; } - - /// - /// Gets or sets Extra Advanced Arguments for the Video Tab. - /// - public string ExtraAdvancedArguments { get; set; } - - /// - /// Gets or sets a value indicating whether advanced panel enabled. - /// - public bool ShowAdvancedTab - { - get - { - return this.showAdvancedTab; - } - set - { - if (!Equals(value, this.showAdvancedTab)) - { - this.showAdvancedTab = value; - this.NotifyOfPropertyChange(() => this.ShowAdvancedTab); - } - } - } - - #endregion - #region MetaData /// diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index b36a83951..177f30f03 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -444,10 +444,6 @@ namespace HandBrakeWPF.Services.Presets.Factories /* Chapter Marker Settings */ preset.Task.IncludeChapterMarkers = importedPreset.ChapterMarkers; - /* Advanced Settings */ - preset.Task.ShowAdvancedTab = importedPreset.x264UseAdvancedOptions; - preset.Task.AdvancedEncoderOptions = importedPreset.x264Option; - /* Not Supported Yet */ // public int VideoColorMatrixCode { get; set; } // public string VideoScaler { get; set; } @@ -646,10 +642,6 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.VideoTurboTwoPass = export.Task.TurboFirstPass; preset.VideoTwoPass = export.Task.TwoPass; - // Advanced - preset.x264Option = export.Task.AdvancedEncoderOptions; - preset.x264UseAdvancedOptions = export.Task.ShowAdvancedTab; - // Unknown preset.ChildrenArray = new List(); // We don't support nested presets. preset.Folder = false; // TODO diff --git a/win/CS/HandBrakeWPF/Services/UserSettingService.cs b/win/CS/HandBrakeWPF/Services/UserSettingService.cs index 3c71854a3..836605a2d 100644 --- a/win/CS/HandBrakeWPF/Services/UserSettingService.cs +++ b/win/CS/HandBrakeWPF/Services/UserSettingService.cs @@ -208,7 +208,6 @@ namespace HandBrakeWPF.Services } // Legacy Settings forced Reset. - this.userSettings[UserSettingConstants.ShowAdvancedTab] = false; this.userSettings[UserSettingConstants.ScalingMode] = VideoScaler.Lanczos; } catch (Exception exc) diff --git a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs index 66cc7aafa..458c071c3 100644 --- a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs @@ -82,7 +82,6 @@ namespace HandBrakeWPF.Startup // Tab Components this.container.Singleton(); - this.container.Singleton(); this.container.Singleton(); this.container.Singleton(); this.container.Singleton(); diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 02a74cb82..964270960 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -31,7 +31,6 @@ namespace HandBrakeWPF public const string VLCPath = "VLC_Path"; public const string InstanceId = "InstanceId"; public const string X264Step = "X264Step"; - public const string ShowAdvancedTab = "ShowAdvancedTab"; public const string LastPreviewDuration = "LastPreviewDuration"; public const string WhenCompleteAction = "WhenCompleteAction"; public const string SendFile = "SendFile"; diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IX264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IX264ViewModel.cs deleted file mode 100644 index eb96e1628..000000000 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IX264ViewModel.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the IX264ViewModel type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.ViewModels.Interfaces -{ - using HandBrake.Interop.Interop.Model.Encoding; - - /// - /// The Advanced View Model Interface - /// - public interface IX264ViewModel : ITabInterface - { - /// - /// Set the currently selected encoder. - /// - /// - /// The Video Encoder. - /// - void SetEncoder(VideoEncoder encoder); - - /// - /// Clear out the settings. - /// - void Clear(); - } -} diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 0aa0cdd59..924b08ebf 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -59,7 +59,6 @@ namespace HandBrakeWPF.ViewModels using Execute = Caliburn.Micro.Execute; using HandBrakeInstanceManager = HandBrakeWPF.Instance.HandBrakeInstanceManager; using LogManager = HandBrakeWPF.Helpers.LogManager; - using MessageBox = System.Windows.MessageBox; using OpenFileDialog = Microsoft.Win32.OpenFileDialog; using SaveFileDialog = Microsoft.Win32.SaveFileDialog; @@ -169,7 +168,7 @@ namespace HandBrakeWPF.ViewModels IErrorService errorService, IUpdateService updateService, IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, ISummaryViewModel summaryViewModel, IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel, - IX264ViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel, + IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel, IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel, INotifyIconService notifyIconService) : base(userSettingService) { @@ -193,13 +192,11 @@ namespace HandBrakeWPF.ViewModels this.AudioViewModel = audioViewModel; this.SubtitleViewModel = subtitlesViewModel; this.ChaptersViewModel = chaptersViewModel; - this.AdvancedViewModel = advancedViewModel; this.StaticPreviewViewModel = staticPreviewViewModel; // Setup Properties this.WindowTitle = Resources.HandBrake_Title; this.CurrentTask = new EncodeTask(); - this.CurrentTask.PropertyChanged += this.CurrentTask_PropertyChanged; this.ScannedSource = new Source(); this.HasSource = false; @@ -269,11 +266,6 @@ namespace HandBrakeWPF.ViewModels /// public IChaptersViewModel ChaptersViewModel { get; set; } - /// - /// Gets or sets AdvancedViewModel. - /// - public IX264ViewModel AdvancedViewModel { get; set; } - /// /// Gets or sets VideoViewModel. /// @@ -958,17 +950,6 @@ namespace HandBrakeWPF.ViewModels } } - /// - /// Gets a value indicating whether show advanced tab. - /// - public bool ShowAdvancedTab - { - get - { - return this.userSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedTab); - } - } - /// /// Gets or sets a value indicating whether is preset panel showing. /// @@ -1315,7 +1296,6 @@ namespace HandBrakeWPF.ViewModels this.AudioViewModel.TabStatusChanged += this.TabStatusChanged; this.SubtitleViewModel.TabStatusChanged += this.TabStatusChanged; this.ChaptersViewModel.TabStatusChanged += this.TabStatusChanged; - this.AdvancedViewModel.TabStatusChanged += this.TabStatusChanged; this.MetaDataViewModel.TabStatusChanged += this.TabStatusChanged; this.SummaryViewModel.TabStatusChanged += this.TabStatusChanged; } @@ -1361,7 +1341,6 @@ namespace HandBrakeWPF.ViewModels this.AudioViewModel.TabStatusChanged -= this.TabStatusChanged; this.SubtitleViewModel.TabStatusChanged -= this.TabStatusChanged; this.ChaptersViewModel.TabStatusChanged -= this.TabStatusChanged; - this.AdvancedViewModel.TabStatusChanged -= this.TabStatusChanged; this.MetaDataViewModel.TabStatusChanged -= this.TabStatusChanged; this.SummaryViewModel.TabStatusChanged -= this.TabStatusChanged; } @@ -2227,7 +2206,6 @@ namespace HandBrakeWPF.ViewModels this.AudioViewModel.SetPreset(this.selectedPreset, this.CurrentTask); this.SubtitleViewModel.SetPreset(this.selectedPreset, this.CurrentTask); this.ChaptersViewModel.SetPreset(this.selectedPreset, this.CurrentTask); - this.AdvancedViewModel.SetPreset(this.selectedPreset, this.CurrentTask); this.MetaDataViewModel.SetPreset(this.selectedPreset, this.CurrentTask); this.isSettingPreset = false; } @@ -2355,7 +2333,6 @@ namespace HandBrakeWPF.ViewModels this.AudioViewModel.UpdateTask(this.CurrentTask); this.SubtitleViewModel.UpdateTask(this.CurrentTask); this.ChaptersViewModel.UpdateTask(this.CurrentTask); - this.AdvancedViewModel.UpdateTask(this.CurrentTask); this.MetaDataViewModel.UpdateTask(this.CurrentTask); // Cleanup @@ -2380,7 +2357,6 @@ namespace HandBrakeWPF.ViewModels this.AudioViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.selectedPreset, this.CurrentTask); this.SubtitleViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.selectedPreset, this.CurrentTask); this.ChaptersViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.selectedPreset, this.CurrentTask); - this.AdvancedViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.selectedPreset, this.CurrentTask); this.MetaDataViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.selectedPreset, this.CurrentTask); this.SummaryViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.selectedPreset, this.CurrentTask); this.isSettingPreset = false; @@ -2431,11 +2407,6 @@ namespace HandBrakeWPF.ViewModels matchesPreset = false; } - if (!this.AdvancedViewModel.MatchesPreset(this.selectedPreset)) - { - matchesPreset = false; - } - if (!this.MetaDataViewModel.MatchesPreset(this.selectedPreset)) { matchesPreset = false; @@ -2797,10 +2768,6 @@ namespace HandBrakeWPF.ViewModels { switch (e.Key) { - case UserSettingConstants.ShowAdvancedTab: - this.NotifyOfPropertyChange(() => this.ShowAdvancedTab); - break; - case UserSettingConstants.WhenCompleteAction: this.QueueViewModel.WhenDone(this.userSettingService.GetUserSetting(UserSettingConstants.WhenCompleteAction), false); break; @@ -2813,23 +2780,6 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.ShowAddSelectionMenuName); } - /// - /// Handle the property changed event of the encode task. - /// Allows the main window to respond to changes. - /// - /// - /// The sender. - /// - /// - /// The e. - /// - private void CurrentTask_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == UserSettingConstants.ShowAdvancedTab) - { - this.NotifyOfPropertyChange(() => this.ShowAdvancedTab); - } - } #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index f316395f9..72b74ffa1 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -110,51 +110,6 @@ namespace HandBrakeWPF.ViewModels /// public EncodeTask Task { get; set; } - /// - /// Gets a value indicating whether show advanced tab. - /// - public bool IsAdvancedTabOptionEnabled - { - get - { - bool showAdvTabSetting = this.userSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedTab); - if (!showAdvTabSetting) - { - this.UseAdvancedTab = false; - } - - if (this.SelectedVideoEncoder != VideoEncoder.X264 && this.SelectedVideoEncoder != VideoEncoder.X264_10) - { - this.UseAdvancedTab = false; - return false; - } - - return showAdvTabSetting; - } - } - - /// - /// Gets or sets a value indicating whether use video tab. - /// - public bool UseAdvancedTab - { - get - { - return this.Task.ShowAdvancedTab; - } - set - { - if (!Equals(value, this.Task.ShowAdvancedTab)) - { - // Set the Advanced Tab up with the current settings, if we can. - this.Task.AdvancedEncoderOptions = value ? this.GetActualx264Query() : string.Empty; - this.Task.ShowAdvancedTab = value; - - this.NotifyOfPropertyChange(() => this.UseAdvancedTab); - } - } - } - /// /// Gets Framerates. /// @@ -1005,7 +960,6 @@ namespace HandBrakeWPF.ViewModels } this.ExtraArguments = preset.Task.ExtraAdvancedArguments; - this.UseAdvancedTab = this.IsAdvancedTabOptionEnabled && preset.Task.ShowAdvancedTab; } /// @@ -1175,25 +1129,6 @@ namespace HandBrakeWPF.ViewModels Clipboard.SetDataObject(this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ? this.GetActualx264Query() : this.ExtraArguments); } - public void ToggleAdvancedTab() - { - if (!this.userSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedTab)) - { - this.errorService.ShowMessageBox( - "The 'Advanced' tab is no longer supported and will be removed in an upcoming release. We strongly recommend using the video tab instead.", - "Advanced Tab Deprecated", - MessageBoxButton.OK, - MessageBoxImage.Information); - this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, true); - this.UseAdvancedTab = true; - } - else - { - this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, false); - this.UseAdvancedTab = false; - } - } - #endregion protected virtual void OnTabStatusChanged(TabStatusEventArgs e) @@ -1313,9 +1248,8 @@ namespace HandBrakeWPF.ViewModels /// private void UserSettingServiceSettingChanged(object sender, SettingChangedEventArgs e) { - if (e.Key == UserSettingConstants.ShowAdvancedTab) + if (e.Key == UserSettingConstants.EnableVceEncoder || e.Key == UserSettingConstants.EnableNvencEncoder || e.Key == UserSettingConstants.EnableQuickSyncEncoding) { - this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled); this.NotifyOfPropertyChange(() => this.VideoEncoders); } } @@ -1400,11 +1334,6 @@ namespace HandBrakeWPF.ViewModels /// private void HandleEncoderChange(VideoEncoder selectedEncoder) { - if (selectedEncoder != VideoEncoder.X264) - { - this.UseAdvancedTab = false; - } - HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper.GetShortName(selectedEncoder)); if (encoder != null) { @@ -1485,19 +1414,10 @@ namespace HandBrakeWPF.ViewModels } } - // Tell the Advanced Panel off the change - IX264ViewModel advancedViewModel = IoC.Get(); - advancedViewModel.SetEncoder(this.Task.VideoEncoder); - // Update the Quality Slider. Make sure the bounds are up to date with the users settings. this.SetQualitySliderBounds(); // Update control display - this.UseAdvancedTab = selectedEncoder != VideoEncoder.QuickSync && selectedEncoder != VideoEncoder.QuickSyncH265 && selectedEncoder != VideoEncoder.QuickSyncH26510b - && selectedEncoder != VideoEncoder.VceH264 && selectedEncoder != VideoEncoder.VceH265 - && selectedEncoder != VideoEncoder.NvencH264 && selectedEncoder != VideoEncoder.NvencH265 - && 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 || @@ -1531,7 +1451,6 @@ namespace HandBrakeWPF.ViewModels // Refresh Display this.NotifyOfPropertyChange(() => this.Rfqp); - this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled); this.NotifyOfPropertyChange(() => this.HighQualityLabel); this.NotifyOfPropertyChange(() => this.IsTwoPassEnabled); this.NotifyOfPropertyChange(() => this.DisplayTwoPass); @@ -1543,7 +1462,6 @@ namespace HandBrakeWPF.ViewModels this.TurboFirstPass = false; this.Task.Framerate = null; this.NotifyOfPropertyChange(() => this.SelectedFramerate); - this.UseAdvancedTab = false; } if (selectedEncoder == VideoEncoder.NvencH264 || selectedEncoder == VideoEncoder.NvencH265 diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs deleted file mode 100644 index 41cfb1ef1..000000000 --- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs +++ /dev/null @@ -1,1151 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The X264 Advanced View Model -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.ViewModels -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - - using HandBrake.Interop.Interop.Model.Encoding; - - using HandBrakeWPF.EventArgs; - using HandBrakeWPF.Helpers; - using HandBrakeWPF.Model; - using HandBrakeWPF.Services.Presets.Model; - using HandBrakeWPF.Services.Scan.Model; - using HandBrakeWPF.ViewModels.Interfaces; - - using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask; - - /// - /// The Advanced View Model - /// - public class X264ViewModel : ViewModelBase, IX264ViewModel - { - #region Constants and Fields - - /// - /// The adaptive b frames. - /// - private AdvancedChoice adaptiveBFrames; - - /// - /// The adaptive quantization strength. - /// - private double adaptiveQuantizationStrength; - - /// - /// The analysis. - /// - private AdvancedChoice analysis; - - /// - /// The b frames. - /// - private AdvancedChoice bFrames; - - /// - /// The cabac entropy coding. - /// - private bool cabacEntropyCoding; - - /// - /// The deblocking strength. - /// - private AdvancedChoice deblockingStrength; - - /// - /// The deblocking threshold. - /// - private AdvancedChoice deblockingThreshold; - - /// - /// The direct prediction. - /// - private AdvancedChoice directPrediction; - - /// - /// The eight by eight dct. - /// - private bool eightByEightDct; - - /// - /// The motion estimation method. - /// - private AdvancedChoice motionEstimationMethod; - - /// - /// The motion estimation range. - /// - private int motionEstimationRange; - - /// - /// The no dct decimate. - /// - private bool noDctDecimate; - - /// - /// The psychovisual rate distortion. - /// - private double psychovisualRateDistortion; - - /// - /// The psychovisual trellis. - /// - private double psychovisualTrellis; - - /// - /// The pyramidal b frames. - /// - private AdvancedChoice pyramidalBFrames; - - /// - /// The reference frames. - /// - private AdvancedChoice referenceFrames; - - /// - /// The subpixel motion estimation. - /// - private AdvancedChoice subpixelMotionEstimation; - - /// - /// The trellis. - /// - private AdvancedChoice trellis; - - /// - /// X264 options that have UI elements that correspond to them. - /// - private HashSet uiOptions = new HashSet - { - "ref", - "bframes", - "b-adapt", - "direct", - "weightp", - "b-pyramid", - "me", - "subme", - "subq", - "merange", - "analyse", - "8x8dct", - "cabac", - "trellis", - "aq-strength", - "psy-rd", - "no-dct-decimate", - "deblock" - }; - - /// - /// The weighted p frames. - /// - private bool weightedPFrames; - - #endregion - - #region Constructors and Destructors - - /// - /// Initializes a new instance of the class. - /// - public X264ViewModel() - { - this.Task = new EncodeTask(); - this.UpdateUIFromAdvancedOptions(); - } - - /// - /// The task object property changed. - /// - /// - /// The sender. - /// - /// - /// The PropertyChangedEventArgs. - /// - private void Task_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - if (e.PropertyName == UserSettingConstants.ShowAdvancedTab) - { - this.NotifyOfPropertyChange(() => this.AdvancedOptionsString); - - if (this.Task.ShowAdvancedTab) - { - this.UpdateUIFromAdvancedOptions(); - } - } - } - - #endregion - - public event EventHandler TabStatusChanged; - - #region Properties - - - /// - /// Gets or sets AdaptiveBFrames. - /// - public AdvancedChoice AdaptiveBFrames - { - get - { - return this.adaptiveBFrames; - } - - set - { - this.adaptiveBFrames = value; - this.NotifyOfPropertyChange(() => this.AdaptiveBFrames); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets AdaptiveQuantizationStrength. - /// - public double AdaptiveQuantizationStrength - { - get - { - return this.adaptiveQuantizationStrength; - } - - set - { - this.adaptiveQuantizationStrength = value; - this.NotifyOfPropertyChange(() => this.AdaptiveQuantizationStrength); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets AdvancedOptionsString. - /// - public string AdvancedOptionsString - { - get - { - return this.Task.AdvancedEncoderOptions; - } - - set - { - this.Task.AdvancedEncoderOptions = value; - this.UpdateUIFromAdvancedOptions(); - this.NotifyOfPropertyChange(() => this.AdvancedOptionsString); - } - } - - /// - /// Gets or sets Analysis. - /// - public AdvancedChoice Analysis - { - get - { - return this.analysis; - } - - set - { - this.analysis = value; - this.NotifyOfPropertyChange(() => this.Analysis); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets a value indicating whether AutomaticChange. - /// - public bool AutomaticChange { get; set; } - - /// - /// Gets or sets BFrames. - /// - public AdvancedChoice BFrames - { - get - { - return this.bFrames; - } - - set - { - this.bFrames = value; - this.NotifyOfPropertyChange(() => this.BFrames); - this.NotifyOfPropertyChange(() => this.BFramesOptionsVisible); - this.NotifyOfPropertyChange(() => this.PyramidalBFramesVisible); - this.UpdateOptionsString(); - } - } - - /// - /// Gets a value indicating whether BFramesOptionsVisible. - /// - public bool BFramesOptionsVisible - { - get - { - return this.BFrames.Value != "0"; - } - } - - /// - /// Gets or sets a value indicating whether CabacEntropyCoding. - /// - public bool CabacEntropyCoding - { - get - { - return this.cabacEntropyCoding; - } - - set - { - this.cabacEntropyCoding = value; - this.NotifyOfPropertyChange(() => this.CabacEntropyCoding); - this.NotifyOfPropertyChange(() => this.PsychovisualTrellisVisible); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets DeblockingStrength. - /// - public AdvancedChoice DeblockingStrength - { - get - { - return this.deblockingStrength; - } - - set - { - this.deblockingStrength = value; - this.NotifyOfPropertyChange(() => this.DeblockingStrength); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets DeblockingThreshold. - /// - public AdvancedChoice DeblockingThreshold - { - get - { - return this.deblockingThreshold; - } - - set - { - this.deblockingThreshold = value; - this.NotifyOfPropertyChange(() => this.DeblockingThreshold); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets DirectPrediction. - /// - public AdvancedChoice DirectPrediction - { - get - { - return this.directPrediction; - } - - set - { - this.directPrediction = value; - this.NotifyOfPropertyChange(() => this.DirectPrediction); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets a value indicating whether EightByEightDct. - /// - public bool EightByEightDct - { - get - { - return this.eightByEightDct; - } - - set - { - this.eightByEightDct = value; - this.NotifyOfPropertyChange(() => this.EightByEightDct); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets MotionEstimationMethod. - /// - public AdvancedChoice MotionEstimationMethod - { - get - { - return this.motionEstimationMethod; - } - - set - { - this.motionEstimationMethod = value; - this.NotifyOfPropertyChange(() => this.MotionEstimationMethod); - - if ((MotionEstimationMethod.Value == "hex" || MotionEstimationMethod.Value == "dia") && (motionEstimationRange > 16)) - { - this.motionEstimationRange = 16; - this.NotifyOfPropertyChange(() => this.MotionEstimationRange); - } - - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets MotionEstimationRange. - /// - public int MotionEstimationRange - { - get - { - return this.motionEstimationRange; - } - - set - { - if ((MotionEstimationMethod.Value == "hex" || MotionEstimationMethod.Value == "dia") && (value > 16)) - { - this.motionEstimationRange = 16; - } - else if (value < 4) - { - this.motionEstimationRange = 4; - } - else - { - this.motionEstimationRange = value; - } - - this.NotifyOfPropertyChange(() => this.MotionEstimationRange); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets a value indicating whether NoDctDecimate. - /// - public bool NoDctDecimate - { - get - { - return this.noDctDecimate; - } - - set - { - this.noDctDecimate = value; - this.NotifyOfPropertyChange(() => this.NoDctDecimate); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets PsychovisualRateDistortion. - /// - public double PsychovisualRateDistortion - { - get - { - return this.psychovisualRateDistortion; - } - - set - { - this.psychovisualRateDistortion = value; - this.NotifyOfPropertyChange(() => this.PsychovisualRateDistortion); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets PsychovisualTrellis. - /// - public double PsychovisualTrellis - { - get - { - return this.psychovisualTrellis; - } - - set - { - this.psychovisualTrellis = value; - this.NotifyOfPropertyChange(() => this.PsychovisualTrellis); - this.UpdateOptionsString(); - } - } - - /// - /// Gets a value indicating whether PsychovisualTrellisVisible. - /// - public bool PsychovisualTrellisVisible - { - get - { - return this.CabacEntropyCoding && this.Trellis.Value != "0"; - } - } - - /// - /// Gets a value indicating whether PsychovisualRateDistortionVisible. - /// - public bool PsychovisualRateDistortionVisible - { - get - { - int value; - int.TryParse(this.SubpixelMotionEstimation.Value.Trim(), out value); - return value >= 6; - } - } - - /// - /// Gets or sets PyramidalBFrames. - /// - public AdvancedChoice PyramidalBFrames - { - get - { - return this.pyramidalBFrames; - } - - set - { - this.pyramidalBFrames = value; - this.NotifyOfPropertyChange(() => this.PyramidalBFrames); - this.UpdateOptionsString(); - } - } - - /// - /// Gets a value indicating whether PyramidalBFramesVisible. - /// - public bool PyramidalBFramesVisible - { - get - { - return int.Parse(this.BFrames.Value) > 1; - } - } - - /// - /// Gets or sets ReferenceFrames. - /// - public AdvancedChoice ReferenceFrames - { - get - { - return this.referenceFrames; - } - - set - { - this.referenceFrames = value; - this.NotifyOfPropertyChange(() => this.ReferenceFrames); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets SubpixelMotionEstimation. - /// - public AdvancedChoice SubpixelMotionEstimation - { - get - { - return this.subpixelMotionEstimation; - } - - set - { - this.subpixelMotionEstimation = value; - this.NotifyOfPropertyChange(() => this.SubpixelMotionEstimation); - this.NotifyOfPropertyChange(() => this.PsychovisualRateDistortionVisible); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets Task. - /// - public EncodeTask Task { get; set; } - - /// - /// Gets or sets Trellis. - /// - public AdvancedChoice Trellis - { - get - { - return this.trellis; - } - - set - { - this.trellis = value; - this.NotifyOfPropertyChange(() => this.Trellis); - this.NotifyOfPropertyChange(() => this.PsychovisualTrellisVisible); - this.UpdateOptionsString(); - } - } - - /// - /// Gets or sets a value indicating whether WeightedPFrames. - /// - public bool WeightedPFrames - { - get - { - return this.weightedPFrames; - } - - set - { - this.weightedPFrames = value; - this.NotifyOfPropertyChange(() => this.WeightedPFrames); - this.UpdateOptionsString(); - } - } - - #endregion - - #region Public Methods - - /// - /// The update ui from advanced options. - /// - public void UpdateUIFromAdvancedOptions() - { - this.AutomaticChange = true; - - // Reset UI to defaults, and re-apply options. - this.SetAdvancedToDefaults(); - - if (this.Task.AdvancedEncoderOptions == null) - { - this.AutomaticChange = false; - return; - } - - // Check the updated options string. Update UI for any recognized options. - string[] newOptionsSegments = this.Task.AdvancedEncoderOptions.Split(':'); - foreach (string newOptionsSegment in newOptionsSegments) - { - int equalsIndex = newOptionsSegment.IndexOf('='); - if (equalsIndex >= 0) - { - string optionName = newOptionsSegment.Substring(0, equalsIndex); - string optionValue = newOptionsSegment.Substring(equalsIndex + 1); - - if (optionName != string.Empty && optionValue != string.Empty) - { - AdvancedChoice newChoice; - int parseInt; - double parseDouble; - string[] subParts; - - switch (optionName) - { - case "ref": - if (int.TryParse(optionValue, out parseInt)) - { - newChoice = - AdvancedChoicesHelper.ReferenceFrames.SingleOrDefault( - choice => choice.Value == parseInt.ToString(CultureInfo.InvariantCulture)); - if (newChoice != null) - { - this.ReferenceFrames = newChoice; - } - } - - break; - case "bframes": - if (int.TryParse(optionValue, out parseInt)) - { - newChoice = - AdvancedChoicesHelper.BFrames.SingleOrDefault( - choice => choice.Value == parseInt.ToString(CultureInfo.InvariantCulture)); - if (newChoice != null) - { - this.BFrames = newChoice; - } - } - - break; - case "b-adapt": - newChoice = - AdvancedChoicesHelper.AdaptiveBFrames.SingleOrDefault( - choice => choice.Value == optionValue); - if (newChoice != null) - { - this.AdaptiveBFrames = newChoice; - } - - break; - case "direct": - newChoice = - AdvancedChoicesHelper.DirectPrediction.SingleOrDefault( - choice => choice.Value == optionValue); - if (newChoice != null) - { - this.DirectPrediction = newChoice; - } - - break; - case "weightp": - if (optionValue == "0") - { - this.WeightedPFrames = false; - } - else if (optionValue == "1") - { - this.WeightedPFrames = true; - } - - break; - case "b-pyramid": - newChoice = - AdvancedChoicesHelper.PyramidalBFrames.SingleOrDefault( - choice => choice.Value == optionValue); - if (newChoice != null) - { - this.PyramidalBFrames = newChoice; - } - - break; - case "me": - newChoice = - AdvancedChoicesHelper.MotionEstimationMethod.SingleOrDefault( - choice => choice.Value == optionValue); - if (newChoice != null) - { - this.MotionEstimationMethod = newChoice; - } - - break; - case "subme": - case "subq": - if (int.TryParse(optionValue, out parseInt)) - { - newChoice = - AdvancedChoicesHelper.SubpixelMotionEstimation.SingleOrDefault( - choice => choice.Value == parseInt.ToString(CultureInfo.InvariantCulture)); - if (newChoice != null) - { - this.SubpixelMotionEstimation = newChoice; - } - } - - break; - case "merange": - if (int.TryParse(optionValue, out parseInt)) - { - this.MotionEstimationRange = parseInt; - } - - break; - case "analyse": - newChoice = - AdvancedChoicesHelper.Analysis.SingleOrDefault( - choice => choice.Value == optionValue); - if (newChoice != null) - { - this.Analysis = newChoice; - } - - break; - case "8x8dct": - if (optionValue == "0") - { - this.EightByEightDct = false; - } - else if (optionValue == "1") - { - this.EightByEightDct = true; - } - - break; - case "cabac": - if (optionValue == "0") - { - this.CabacEntropyCoding = false; - } - else if (optionValue == "1") - { - this.CabacEntropyCoding = true; - } - - break; - case "trellis": - if (int.TryParse(optionValue, out parseInt)) - { - newChoice = - AdvancedChoicesHelper.Trellis.SingleOrDefault( - choice => choice.Value == parseInt.ToString(CultureInfo.InvariantCulture)); - if (newChoice != null) - { - this.Trellis = newChoice; - } - } - - break; - case "aq-strength": - if (double.TryParse(optionValue, NumberStyles.Any, CultureInfo.InvariantCulture, out parseDouble) && parseDouble >= 0.0 && - parseDouble <= 2.0) - { - this.AdaptiveQuantizationStrength = Math.Round(parseDouble, 1); - } - - break; - case "psy-rd": - subParts = optionValue.Split(','); - if (subParts.Length == 2) - { - double psyRD, psyTrellis; - if (double.TryParse(subParts[0], NumberStyles.Any, CultureInfo.InvariantCulture, out psyRD) && - double.TryParse(subParts[1], NumberStyles.Any, CultureInfo.InvariantCulture, out psyTrellis)) - { - if (psyRD >= 0.0 && psyRD <= 2.0 && psyTrellis >= 0.0 && psyTrellis <= 1.0) - { - this.PsychovisualRateDistortion = Math.Round(psyRD, 1); - this.PsychovisualTrellis = Math.Round(psyTrellis, 2); - } - } - } - - break; - case "no-dct-decimate": - if (optionValue == "0") - { - this.NoDctDecimate = false; - } - else if (optionValue == "1") - { - this.NoDctDecimate = true; - } - - break; - case "deblock": - subParts = optionValue.Split(','); - if (subParts.Length == 2) - { - int dbStrength, dbThreshold; - if (int.TryParse(subParts[0], out dbStrength) && - int.TryParse(subParts[1], out dbThreshold)) - { - newChoice = - AdvancedChoicesHelper.DeblockingStrength.SingleOrDefault( - choice => choice.Value == subParts[0]); - if (newChoice != null) - { - this.DeblockingStrength = newChoice; - } - - newChoice = - AdvancedChoicesHelper.DeblockingThreshold.SingleOrDefault( - choice => choice.Value == subParts[1]); - if (newChoice != null) - { - this.DeblockingThreshold = newChoice; - } - } - } - - break; - } - } - } - } - - this.AutomaticChange = false; - } - - #endregion - - #region Implemented Interfaces - - #region IAdvancedViewModel - - /// - /// The set encoder. - /// - /// - /// The encoder. - /// - public void SetEncoder(VideoEncoder encoder) - { - } - - /// - /// The clear. - /// - public void Clear() - { - this.AdvancedOptionsString = string.Empty; - } - - #endregion - - #region ITabInterface - - /// - /// Setup this tab for the specified preset. - /// - /// - /// The preset. - /// - /// - /// The task. - /// - public void SetPreset(Preset preset, EncodeTask task) - { - this.Task.PropertyChanged -= this.Task_PropertyChanged; - this.Task = task; - this.Task.PropertyChanged += this.Task_PropertyChanged; - this.AdvancedOptionsString = preset.Task.AdvancedEncoderOptions; - } - - /// - /// Update all the UI controls based on the encode task passed in. - /// - /// - /// The task. - /// - public void UpdateTask(EncodeTask task) - { - this.Task = task; - this.SetEncoder(task.VideoEncoder); - this.AdvancedOptionsString = task.AdvancedEncoderOptions; - } - - public bool MatchesPreset(Preset preset) - { - return true; - } - - /// - /// Setup this window for a new source - /// - /// - /// The source. - /// - /// - /// The title. - /// - /// - /// The preset. - /// - /// - /// The task. - /// - public void SetSource(Source source, Title title, Preset preset, EncodeTask task) - { - this.Task = task; - this.NotifyOfPropertyChange(() => this.AdvancedOptionsString); - } - - #endregion - - #endregion - - #region Methods - - protected virtual void OnTabStatusChanged(TabStatusEventArgs e) - { - this.TabStatusChanged?.Invoke(this, e); - } - - /// - /// The set advanced to defaults. - /// - private void SetAdvancedToDefaults() - { - this.ReferenceFrames = AdvancedChoicesHelper.ReferenceFrames.SingleOrDefault(choice => choice.IsDefault); - this.BFrames = AdvancedChoicesHelper.BFrames.SingleOrDefault(choice => choice.IsDefault); - this.AdaptiveBFrames = AdvancedChoicesHelper.AdaptiveBFrames.SingleOrDefault(choice => choice.IsDefault); - this.DirectPrediction = AdvancedChoicesHelper.DirectPrediction.SingleOrDefault(choice => choice.IsDefault); - this.WeightedPFrames = true; - this.PyramidalBFrames = AdvancedChoicesHelper.PyramidalBFrames.SingleOrDefault(choice => choice.IsDefault); - this.MotionEstimationMethod = - AdvancedChoicesHelper.MotionEstimationMethod.SingleOrDefault(choice => choice.IsDefault); - this.SubpixelMotionEstimation = - AdvancedChoicesHelper.SubpixelMotionEstimation.SingleOrDefault(choice => choice.IsDefault); - this.MotionEstimationRange = 16; - this.Analysis = AdvancedChoicesHelper.Analysis.SingleOrDefault(choice => choice.IsDefault); - this.EightByEightDct = true; - this.CabacEntropyCoding = true; - this.Trellis = AdvancedChoicesHelper.Trellis.SingleOrDefault(choice => choice.IsDefault); - this.AdaptiveQuantizationStrength = 1.0; - this.PsychovisualRateDistortion = 1.0; - this.PsychovisualTrellis = 0.0; - this.DeblockingStrength = - AdvancedChoicesHelper.DeblockingStrength.SingleOrDefault(choice => choice.IsDefault); - this.DeblockingThreshold = - AdvancedChoicesHelper.DeblockingThreshold.SingleOrDefault(choice => choice.IsDefault); - this.NoDctDecimate = false; - } - - /// - /// Update the x264 options string from a UI change. - /// - private void UpdateOptionsString() - { - if (this.AutomaticChange) - { - return; - } - - List newOptions = new List(); - - // First add any parts of the options string that don't correspond to the UI - if (this.AdvancedOptionsString != null) - { - string[] existingSegments = this.AdvancedOptionsString.Split(':'); - foreach (string existingSegment in existingSegments) - { - string optionName = existingSegment; - int equalsIndex = existingSegment.IndexOf('='); - if (equalsIndex >= 0) - { - optionName = existingSegment.Substring(0, existingSegment.IndexOf("=", System.StringComparison.Ordinal)); - } - - if (!this.uiOptions.Contains(optionName) && optionName != string.Empty) - { - newOptions.Add(existingSegment); - } - } - } - - // Now add everything from the UI - if (!this.ReferenceFrames.IsDefault) - { - newOptions.Add("ref=" + this.ReferenceFrames.Value); - } - - if (!this.BFrames.IsDefault) - { - newOptions.Add("bframes=" + this.BFrames.Value); - } - - if (this.BFrames.Value != "0") - { - if (!this.AdaptiveBFrames.IsDefault) - { - newOptions.Add("b-adapt=" + this.AdaptiveBFrames.Value); - } - - if (!this.DirectPrediction.IsDefault) - { - newOptions.Add("direct=" + this.DirectPrediction.Value); - } - - if (this.BFrames.Value != "1" && !this.PyramidalBFrames.IsDefault) - { - newOptions.Add("b-pyramid=" + this.PyramidalBFrames.Value); - } - } - - if (!this.WeightedPFrames) - { - newOptions.Add("weightp=0"); - } - - if (!this.MotionEstimationMethod.IsDefault) - { - newOptions.Add("me=" + this.MotionEstimationMethod.Value); - } - - if (!this.SubpixelMotionEstimation.IsDefault) - { - newOptions.Add("subme=" + this.SubpixelMotionEstimation.Value); - } - - if (this.MotionEstimationRange != 16) - { - newOptions.Add("merange=" + this.MotionEstimationRange); - } - - if (!this.Analysis.IsDefault) - { - newOptions.Add("analyse=" + this.Analysis.Value); - } - - if (this.Analysis.Value != "none" && !this.EightByEightDct) - { - newOptions.Add("8x8dct=0"); - } - - if (!this.CabacEntropyCoding) - { - newOptions.Add("cabac=0"); - } - - if (!this.Trellis.IsDefault) - { - newOptions.Add("trellis=" + this.Trellis.Value); - } - - double psTrellis = 0.0; - if (this.CabacEntropyCoding && this.Trellis.Value != "0") - { - psTrellis = this.PsychovisualTrellis; - } - - if (this.AdaptiveQuantizationStrength != 1.0) - { - newOptions.Add( - "aq-strength=" + this.AdaptiveQuantizationStrength.ToString("F1", CultureInfo.InvariantCulture)); - } - - if (this.PsychovisualRateDistortion != 1.0 || psTrellis > 0.0) - { - newOptions.Add( - "psy-rd=" + this.PsychovisualRateDistortion.ToString("F1", CultureInfo.InvariantCulture) + "," + - psTrellis.ToString("F2", CultureInfo.InvariantCulture)); - } - - if (this.NoDctDecimate) - { - newOptions.Add("no-dct-decimate=1"); - } - - if (!this.DeblockingStrength.IsDefault || !this.DeblockingThreshold.IsDefault) - { - newOptions.Add("deblock=" + this.DeblockingStrength.Value + "," + this.DeblockingThreshold.Value); - } - - this.Task.AdvancedEncoderOptions = string.Join(":", newOptions); - this.NotifyOfPropertyChange(() => this.AdvancedOptionsString); - } - - #endregion - } -} \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 368eb0982..8aae5c9b8 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -193,7 +193,6 @@ - diff --git a/win/CS/HandBrakeWPF/Views/X264View.xaml b/win/CS/HandBrakeWPF/Views/X264View.xaml deleted file mode 100644 index 9fecd494b..000000000 --- a/win/CS/HandBrakeWPF/Views/X264View.xaml +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/X264View.xaml.cs b/win/CS/HandBrakeWPF/Views/X264View.xaml.cs deleted file mode 100644 index 42764bf5c..000000000 --- a/win/CS/HandBrakeWPF/Views/X264View.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Interaction logic for X264View.xaml -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Views -{ - /// - /// Interaction logic for AdvancedView.xaml - /// - public partial class X264View - { - /// - /// Initializes a new instance of the class. - /// - public X264View() - { - InitializeComponent(); - } - } -} diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index c677691f8..acdd5de52 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -328,14 +328,6 @@ false - - - ShowAdvancedTab - - - false - - LastPreviewDuration -- 2.40.0