From 47ff6e2232577b743d59ed23fc348002297058f1 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 28 Mar 2014 22:26:26 +0000 Subject: WinGui: Fix QuickSync and x265 quality slider. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6136 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 38 +++++++++++------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'win/CS/HandBrakeWPF/ViewModels') diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 0d3dc5ce0..8479874d0 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -398,24 +398,26 @@ namespace HandBrakeWPF.ViewModels { this.rf = value; - double cqStep = userSettingService.GetUserSetting(UserSettingConstants.X264Step); this.SetQualitySliderBounds(); switch (this.SelectedVideoEncoder) { case VideoEncoder.FFMpeg: case VideoEncoder.FFMpeg2: this.Task.Quality = (32 - value); - break; - case VideoEncoder.QuickSync: + break; case VideoEncoder.X264: + case VideoEncoder.X265: + double cqStep = userSettingService.GetUserSetting(UserSettingConstants.X264Step); double rfValue = 51.0 - value * cqStep; rfValue = Math.Round(rfValue, 2); this.Task.Quality = rfValue; + break; + case VideoEncoder.QuickSync: + rfValue = 51.0 - value; + rfValue = Math.Round(rfValue, 0); + this.Task.Quality = rfValue; break; - case VideoEncoder.Theora: - Task.Quality = value; - break; - case VideoEncoder.X265: + case VideoEncoder.Theora: Task.Quality = value; break; } @@ -1090,7 +1092,7 @@ namespace HandBrakeWPF.ViewModels this.RF = 32 - cq; } break; - case VideoEncoder.QuickSync: + case VideoEncoder.X265: case VideoEncoder.X264: double multiplier = 1.0 / cqStep; @@ -1103,14 +1105,8 @@ namespace HandBrakeWPF.ViewModels break; - case VideoEncoder.Theora: - if (preset.Task.Quality.HasValue) - { - this.RF = (int)preset.Task.Quality.Value; - } - break; - - case VideoEncoder.X265: + case VideoEncoder.Theora: + case VideoEncoder.QuickSync: if (preset.Task.Quality.HasValue) { this.RF = (int)preset.Task.Quality.Value; @@ -1295,8 +1291,12 @@ namespace HandBrakeWPF.ViewModels this.QualityMin = 1; this.QualityMax = 31; break; - case VideoEncoder.X264: case VideoEncoder.QuickSync: + this.QualityMin = 0; + this.QualityMax = 51; + break; + case VideoEncoder.X264: + case VideoEncoder.X265: this.QualityMin = 0; this.QualityMax = (int)(51 / userSettingService.GetUserSetting(UserSettingConstants.X264Step)); break; @@ -1304,10 +1304,6 @@ namespace HandBrakeWPF.ViewModels this.QualityMin = 0; this.QualityMax = 63; break; - case VideoEncoder.X265: - this.QualityMin = 0; - this.QualityMax = 50; - break; } } -- cgit v1.2.3