OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 12 Feb 2009 21:42:59 +0000 (21:42 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 12 Feb 2009 21:42:59 +0000 (21:42 +0000)
- PSY Rate Distortion, PSY Trellis, Adaptive B-Frames added to the advanced tab.
- Advanced tag re-arranged to match the macgui. Entire GUI window enlarged to make room for new widgets.

git-svn-id: svn://localhost/HandBrake/trunk@2152 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain/PresetLoader.cs
win/C#/frmMain/x264Panel.cs

index 526f9c4..6e92aa2 100644 (file)
@@ -89,6 +89,7 @@ namespace Handbrake
             this.drop_bFrames = new System.Windows.Forms.ComboBox();\r
             this.drop_refFrames = new System.Windows.Forms.ComboBox();\r
             this.check_mixedReferences = new System.Windows.Forms.CheckBox();\r
+            this.drop_adaptBFrames = new System.Windows.Forms.ComboBox();\r
             this.lbl_src_res = new System.Windows.Forms.Label();\r
             this.lbl_duration = new System.Windows.Forms.Label();\r
             this.label_duration = new System.Windows.Forms.Label();\r
@@ -199,6 +200,11 @@ namespace Handbrake
             this.tab_chapters = new System.Windows.Forms.TabPage();\r
             this.label31 = new System.Windows.Forms.Label();\r
             this.h264Tab = new System.Windows.Forms.TabPage();\r
+            this.slider_psytrellis = new System.Windows.Forms.TrackBar();\r
+            this.lbl_psytrellis = new System.Windows.Forms.Label();\r
+            this.lbl_psyrd = new System.Windows.Forms.Label();\r
+            this.slider_psyrd = new System.Windows.Forms.TrackBar();\r
+            this.lbl_adaptBFrames = new System.Windows.Forms.Label();\r
             this.label43 = new System.Windows.Forms.Label();\r
             this.btn_reset = new System.Windows.Forms.Button();\r
             this.rtf_x264Query = new System.Windows.Forms.RichTextBox();\r
@@ -209,7 +215,7 @@ namespace Handbrake
             this.panel2 = new System.Windows.Forms.Panel();\r
             this.label45 = new System.Windows.Forms.Label();\r
             this.label48 = new System.Windows.Forms.Label();\r
-            this.label49 = new System.Windows.Forms.Label();\r
+            this.lbl_merange = new System.Windows.Forms.Label();\r
             this.label54 = new System.Windows.Forms.Label();\r
             this.lbl_direct_prediction = new System.Windows.Forms.Label();\r
             this.label62 = new System.Windows.Forms.Label();\r
@@ -274,6 +280,8 @@ namespace Handbrake
             this.tab_Filters.SuspendLayout();\r
             this.tab_chapters.SuspendLayout();\r
             this.h264Tab.SuspendLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.slider_psytrellis)).BeginInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.slider_psyrd)).BeginInit();\r
             this.tab_query.SuspendLayout();\r
             this.groupBox_dest.SuspendLayout();\r
             this.groupBox2.SuspendLayout();\r
@@ -489,7 +497,7 @@ namespace Handbrake
             // slider_videoQuality\r
             // \r
             this.slider_videoQuality.Enabled = false;\r
-            this.slider_videoQuality.Location = new System.Drawing.Point(337, 120);\r
+            this.slider_videoQuality.Location = new System.Drawing.Point(347, 120);\r
             this.slider_videoQuality.Maximum = 100;\r
             this.slider_videoQuality.Name = "slider_videoQuality";\r
             this.slider_videoQuality.Size = new System.Drawing.Size(322, 42);\r
@@ -749,7 +757,7 @@ namespace Handbrake
             this.check_Cabac.Checked = true;\r
             this.check_Cabac.CheckState = System.Windows.Forms.CheckState.Checked;\r
             this.check_Cabac.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_Cabac.Location = new System.Drawing.Point(536, 214);\r
+            this.check_Cabac.Location = new System.Drawing.Point(273, 123);\r
             this.check_Cabac.Name = "check_Cabac";\r
             this.check_Cabac.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_Cabac.Size = new System.Drawing.Size(144, 16);\r
@@ -765,7 +773,7 @@ namespace Handbrake
             this.check_noDCTDecimate.AutoSize = true;\r
             this.check_noDCTDecimate.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.check_noDCTDecimate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_noDCTDecimate.Location = new System.Drawing.Point(562, 192);\r
+            this.check_noDCTDecimate.Location = new System.Drawing.Point(593, 35);\r
             this.check_noDCTDecimate.Name = "check_noDCTDecimate";\r
             this.check_noDCTDecimate.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_noDCTDecimate.Size = new System.Drawing.Size(118, 16);\r
@@ -782,7 +790,7 @@ namespace Handbrake
             this.check_noFastPSkip.AutoSize = true;\r
             this.check_noFastPSkip.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.check_noFastPSkip.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_noFastPSkip.Location = new System.Drawing.Point(444, 192);\r
+            this.check_noFastPSkip.Location = new System.Drawing.Point(608, 14);\r
             this.check_noFastPSkip.Name = "check_noFastPSkip";\r
             this.check_noFastPSkip.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_noFastPSkip.Size = new System.Drawing.Size(103, 16);\r
@@ -804,9 +812,9 @@ namespace Handbrake
             "0",\r
             "1",\r
             "2"});\r
-            this.drop_trellis.Location = new System.Drawing.Point(537, 166);\r
+            this.drop_trellis.Location = new System.Drawing.Point(468, 122);\r
             this.drop_trellis.Name = "drop_trellis";\r
-            this.drop_trellis.Size = new System.Drawing.Size(143, 20);\r
+            this.drop_trellis.Size = new System.Drawing.Size(94, 20);\r
             this.drop_trellis.TabIndex = 37;\r
             this.ToolTip.SetToolTip(this.drop_trellis, "Trellis fine-tunes how bitrate is doled out, so it can reduce file size/bitrate o" +\r
                     "r increase quality. \r\nA value of 2 forces it to be used more often than a value " +\r
@@ -833,7 +841,7 @@ namespace Handbrake
             "4",\r
             "5",\r
             "6"});\r
-            this.drop_deblockBeta.Location = new System.Drawing.Point(611, 139);\r
+            this.drop_deblockBeta.Location = new System.Drawing.Point(642, 90);\r
             this.drop_deblockBeta.Name = "drop_deblockBeta";\r
             this.drop_deblockBeta.Size = new System.Drawing.Size(69, 20);\r
             this.drop_deblockBeta.TabIndex = 36;\r
@@ -860,7 +868,7 @@ namespace Handbrake
             "4",\r
             "5",\r
             "6"});\r
-            this.drop_deblockAlpha.Location = new System.Drawing.Point(537, 139);\r
+            this.drop_deblockAlpha.Location = new System.Drawing.Point(643, 64);\r
             this.drop_deblockAlpha.Name = "drop_deblockAlpha";\r
             this.drop_deblockAlpha.Size = new System.Drawing.Size(68, 20);\r
             this.drop_deblockAlpha.TabIndex = 35;\r
@@ -872,7 +880,7 @@ namespace Handbrake
             this.check_8x8DCT.AutoSize = true;\r
             this.check_8x8DCT.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.check_8x8DCT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_8x8DCT.Location = new System.Drawing.Point(608, 106);\r
+            this.check_8x8DCT.Location = new System.Drawing.Point(492, 95);\r
             this.check_8x8DCT.Name = "check_8x8DCT";\r
             this.check_8x8DCT.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_8x8DCT.Size = new System.Drawing.Size(71, 16);\r
@@ -892,7 +900,7 @@ namespace Handbrake
             "Default (some)",\r
             "None",\r
             "All"});\r
-            this.drop_analysis.Location = new System.Drawing.Point(537, 105);\r
+            this.drop_analysis.Location = new System.Drawing.Point(423, 94);\r
             this.drop_analysis.Name = "drop_analysis";\r
             this.drop_analysis.Size = new System.Drawing.Size(63, 20);\r
             this.drop_analysis.TabIndex = 33;\r
@@ -916,7 +924,7 @@ namespace Handbrake
             "7",\r
             "8",\r
             "9"});\r
-            this.drop_subpixelMotionEstimation.Location = new System.Drawing.Point(537, 69);\r
+            this.drop_subpixelMotionEstimation.Location = new System.Drawing.Point(423, 37);\r
             this.drop_subpixelMotionEstimation.Name = "drop_subpixelMotionEstimation";\r
             this.drop_subpixelMotionEstimation.Size = new System.Drawing.Size(139, 20);\r
             this.drop_subpixelMotionEstimation.TabIndex = 32;\r
@@ -991,7 +999,7 @@ namespace Handbrake
             "62",\r
             "63",\r
             "64"});\r
-            this.drop_MotionEstimationRange.Location = new System.Drawing.Point(537, 40);\r
+            this.drop_MotionEstimationRange.Location = new System.Drawing.Point(423, 63);\r
             this.drop_MotionEstimationRange.Name = "drop_MotionEstimationRange";\r
             this.drop_MotionEstimationRange.Size = new System.Drawing.Size(139, 20);\r
             this.drop_MotionEstimationRange.TabIndex = 31;\r
@@ -1009,8 +1017,9 @@ namespace Handbrake
             "Diamond",\r
             "Hexagon",\r
             "Uneven Multi-Hexagon",\r
-            "Exhaustive"});\r
-            this.drop_MotionEstimationMethod.Location = new System.Drawing.Point(537, 11);\r
+            "Exhaustive",\r
+            "Transformed Exhaustive"});\r
+            this.drop_MotionEstimationMethod.Location = new System.Drawing.Point(423, 11);\r
             this.drop_MotionEstimationMethod.Name = "drop_MotionEstimationMethod";\r
             this.drop_MotionEstimationMethod.Size = new System.Drawing.Size(139, 20);\r
             this.drop_MotionEstimationMethod.TabIndex = 30;\r
@@ -1022,7 +1031,7 @@ namespace Handbrake
             this.check_pyrmidalBFrames.AutoSize = true;\r
             this.check_pyrmidalBFrames.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.check_pyrmidalBFrames.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_pyrmidalBFrames.Location = new System.Drawing.Point(46, 165);\r
+            this.check_pyrmidalBFrames.Location = new System.Drawing.Point(18, 189);\r
             this.check_pyrmidalBFrames.Name = "check_pyrmidalBFrames";\r
             this.check_pyrmidalBFrames.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_pyrmidalBFrames.Size = new System.Drawing.Size(121, 16);\r
@@ -1038,7 +1047,7 @@ namespace Handbrake
             this.check_weightedBFrames.AutoSize = true;\r
             this.check_weightedBFrames.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.check_weightedBFrames.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_weightedBFrames.Location = new System.Drawing.Point(44, 144);\r
+            this.check_weightedBFrames.Location = new System.Drawing.Point(16, 168);\r
             this.check_weightedBFrames.Name = "check_weightedBFrames";\r
             this.check_weightedBFrames.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_weightedBFrames.Size = new System.Drawing.Size(123, 16);\r
@@ -1059,7 +1068,7 @@ namespace Handbrake
             "Spatial",\r
             "Temporal",\r
             "Automatic"});\r
-            this.drop_directPrediction.Location = new System.Drawing.Point(157, 118);\r
+            this.drop_directPrediction.Location = new System.Drawing.Point(129, 142);\r
             this.drop_directPrediction.Name = "drop_directPrediction";\r
             this.drop_directPrediction.Size = new System.Drawing.Size(121, 20);\r
             this.drop_directPrediction.TabIndex = 13;\r
@@ -1090,7 +1099,7 @@ namespace Handbrake
             "14",\r
             "15",\r
             "16"});\r
-            this.drop_bFrames.Location = new System.Drawing.Point(157, 91);\r
+            this.drop_bFrames.Location = new System.Drawing.Point(129, 90);\r
             this.drop_bFrames.Name = "drop_bFrames";\r
             this.drop_bFrames.Size = new System.Drawing.Size(121, 20);\r
             this.drop_bFrames.TabIndex = 12;\r
@@ -1123,7 +1132,7 @@ namespace Handbrake
             "14",\r
             "15",\r
             "16"});\r
-            this.drop_refFrames.Location = new System.Drawing.Point(157, 37);\r
+            this.drop_refFrames.Location = new System.Drawing.Point(129, 37);\r
             this.drop_refFrames.Name = "drop_refFrames";\r
             this.drop_refFrames.Size = new System.Drawing.Size(121, 20);\r
             this.drop_refFrames.TabIndex = 10;\r
@@ -1136,7 +1145,7 @@ namespace Handbrake
             this.check_mixedReferences.AutoSize = true;\r
             this.check_mixedReferences.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.check_mixedReferences.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.check_mixedReferences.Location = new System.Drawing.Point(54, 63);\r
+            this.check_mixedReferences.Location = new System.Drawing.Point(25, 63);\r
             this.check_mixedReferences.Name = "check_mixedReferences";\r
             this.check_mixedReferences.RightToLeft = System.Windows.Forms.RightToLeft.No;\r
             this.check_mixedReferences.Size = new System.Drawing.Size(114, 16);\r
@@ -1148,6 +1157,22 @@ namespace Handbrake
             this.check_mixedReferences.UseVisualStyleBackColor = true;\r
             this.check_mixedReferences.CheckStateChanged += new System.EventHandler(this.check_mixedReferences_CheckedChanged);\r
             // \r
+            // drop_adaptBFrames\r
+            // \r
+            this.drop_adaptBFrames.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.drop_adaptBFrames.FlatStyle = System.Windows.Forms.FlatStyle.Popup;\r
+            this.drop_adaptBFrames.FormattingEnabled = true;\r
+            this.drop_adaptBFrames.Items.AddRange(new object[] {\r
+            "Default (1)",\r
+            "0",\r
+            "1",\r
+            "2"});\r
+            this.drop_adaptBFrames.Location = new System.Drawing.Point(129, 116);\r
+            this.drop_adaptBFrames.Name = "drop_adaptBFrames";\r
+            this.drop_adaptBFrames.Size = new System.Drawing.Size(121, 20);\r
+            this.drop_adaptBFrames.TabIndex = 44;\r
+            this.drop_adaptBFrames.SelectedIndexChanged += new System.EventHandler(this.drop_adaptBFrames_SelectedIndexChanged);\r
+            // \r
             // lbl_src_res\r
             // \r
             this.lbl_src_res.AutoSize = true;\r
@@ -1399,7 +1424,7 @@ namespace Handbrake
             this.frmMainMenu.Location = new System.Drawing.Point(0, 0);\r
             this.frmMainMenu.Name = "frmMainMenu";\r
             this.frmMainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
-            this.frmMainMenu.Size = new System.Drawing.Size(995, 24);\r
+            this.frmMainMenu.Size = new System.Drawing.Size(1004, 24);\r
             this.frmMainMenu.TabIndex = 0;\r
             this.frmMainMenu.Text = "MenuStrip";\r
             // \r
@@ -1434,7 +1459,7 @@ namespace Handbrake
             this.gb_source.ForeColor = System.Drawing.Color.Black;\r
             this.gb_source.Location = new System.Drawing.Point(9, 70);\r
             this.gb_source.Name = "gb_source";\r
-            this.gb_source.Size = new System.Drawing.Size(721, 87);\r
+            this.gb_source.Size = new System.Drawing.Size(732, 87);\r
             this.gb_source.TabIndex = 2;\r
             this.gb_source.TabStop = false;\r
             this.gb_source.Text = "Source";\r
@@ -1493,7 +1518,7 @@ namespace Handbrake
             this.groupBox_output.ForeColor = System.Drawing.Color.Black;\r
             this.groupBox_output.Location = new System.Drawing.Point(9, 214);\r
             this.groupBox_output.Name = "groupBox_output";\r
-            this.groupBox_output.Size = new System.Drawing.Size(721, 50);\r
+            this.groupBox_output.Size = new System.Drawing.Size(732, 50);\r
             this.groupBox_output.TabIndex = 4;\r
             this.groupBox_output.TabStop = false;\r
             this.groupBox_output.Text = "Output Settings (Preset: None)";\r
@@ -1560,7 +1585,7 @@ namespace Handbrake
             this.TabPage2.Location = new System.Drawing.Point(4, 22);\r
             this.TabPage2.Name = "TabPage2";\r
             this.TabPage2.Padding = new System.Windows.Forms.Padding(3);\r
-            this.TabPage2.Size = new System.Drawing.Size(713, 316);\r
+            this.TabPage2.Size = new System.Drawing.Size(724, 316);\r
             this.TabPage2.TabIndex = 3;\r
             this.TabPage2.Text = "Audio && Subtitles";\r
             this.TabPage2.UseVisualStyleBackColor = true;\r
@@ -1871,7 +1896,7 @@ namespace Handbrake
             this.TabPage3.Location = new System.Drawing.Point(4, 22);\r
             this.TabPage3.Name = "TabPage3";\r
             this.TabPage3.Padding = new System.Windows.Forms.Padding(3);\r
-            this.TabPage3.Size = new System.Drawing.Size(713, 316);\r
+            this.TabPage3.Size = new System.Drawing.Size(724, 316);\r
             this.TabPage3.TabIndex = 2;\r
             this.TabPage3.Text = "Video";\r
             this.TabPage3.UseVisualStyleBackColor = true;\r
@@ -2008,7 +2033,7 @@ namespace Handbrake
             this.TabPage1.Location = new System.Drawing.Point(4, 22);\r
             this.TabPage1.Name = "TabPage1";\r
             this.TabPage1.Padding = new System.Windows.Forms.Padding(3);\r
-            this.TabPage1.Size = new System.Drawing.Size(713, 316);\r
+            this.TabPage1.Size = new System.Drawing.Size(724, 316);\r
             this.TabPage1.TabIndex = 0;\r
             this.TabPage1.Text = "Picture Settings";\r
             this.TabPage1.UseVisualStyleBackColor = true;\r
@@ -2273,7 +2298,7 @@ namespace Handbrake
             this.tabs_panel.Location = new System.Drawing.Point(9, 274);\r
             this.tabs_panel.Name = "tabs_panel";\r
             this.tabs_panel.SelectedIndex = 0;\r
-            this.tabs_panel.Size = new System.Drawing.Size(721, 342);\r
+            this.tabs_panel.Size = new System.Drawing.Size(732, 342);\r
             this.tabs_panel.TabIndex = 5;\r
             this.tabs_panel.TabStop = false;\r
             // \r
@@ -2290,7 +2315,7 @@ namespace Handbrake
             this.tab_Filters.Controls.Add(this.lbl_deblockVal);\r
             this.tab_Filters.Location = new System.Drawing.Point(4, 22);\r
             this.tab_Filters.Name = "tab_Filters";\r
-            this.tab_Filters.Size = new System.Drawing.Size(713, 316);\r
+            this.tab_Filters.Size = new System.Drawing.Size(724, 316);\r
             this.tab_Filters.TabIndex = 9;\r
             this.tab_Filters.Text = "Video Filters";\r
             this.tab_Filters.UseVisualStyleBackColor = true;\r
@@ -2303,7 +2328,7 @@ namespace Handbrake
             this.tab_chapters.Controls.Add(this.Check_ChapterMarkers);\r
             this.tab_chapters.Location = new System.Drawing.Point(4, 22);\r
             this.tab_chapters.Name = "tab_chapters";\r
-            this.tab_chapters.Size = new System.Drawing.Size(713, 316);\r
+            this.tab_chapters.Size = new System.Drawing.Size(724, 316);\r
             this.tab_chapters.TabIndex = 6;\r
             this.tab_chapters.Text = "Chapters";\r
             this.tab_chapters.UseVisualStyleBackColor = true;\r
@@ -2322,6 +2347,12 @@ namespace Handbrake
             // h264Tab\r
             // \r
             this.h264Tab.BackColor = System.Drawing.Color.Transparent;\r
+            this.h264Tab.Controls.Add(this.slider_psytrellis);\r
+            this.h264Tab.Controls.Add(this.lbl_psytrellis);\r
+            this.h264Tab.Controls.Add(this.lbl_psyrd);\r
+            this.h264Tab.Controls.Add(this.slider_psyrd);\r
+            this.h264Tab.Controls.Add(this.lbl_adaptBFrames);\r
+            this.h264Tab.Controls.Add(this.drop_adaptBFrames);\r
             this.h264Tab.Controls.Add(this.label43);\r
             this.h264Tab.Controls.Add(this.btn_reset);\r
             this.h264Tab.Controls.Add(this.rtf_x264Query);\r
@@ -2341,7 +2372,7 @@ namespace Handbrake
             this.h264Tab.Controls.Add(this.drop_analysis);\r
             this.h264Tab.Controls.Add(this.label48);\r
             this.h264Tab.Controls.Add(this.drop_subpixelMotionEstimation);\r
-            this.h264Tab.Controls.Add(this.label49);\r
+            this.h264Tab.Controls.Add(this.lbl_merange);\r
             this.h264Tab.Controls.Add(this.drop_MotionEstimationRange);\r
             this.h264Tab.Controls.Add(this.label54);\r
             this.h264Tab.Controls.Add(this.drop_MotionEstimationMethod);\r
@@ -2358,11 +2389,57 @@ namespace Handbrake
             this.h264Tab.Location = new System.Drawing.Point(4, 22);\r
             this.h264Tab.Name = "h264Tab";\r
             this.h264Tab.Padding = new System.Windows.Forms.Padding(3);\r
-            this.h264Tab.Size = new System.Drawing.Size(713, 316);\r
+            this.h264Tab.Size = new System.Drawing.Size(724, 316);\r
             this.h264Tab.TabIndex = 8;\r
             this.h264Tab.Text = "Advanced";\r
             this.h264Tab.UseVisualStyleBackColor = true;\r
             // \r
+            // slider_psytrellis\r
+            // \r
+            this.slider_psytrellis.Location = new System.Drawing.Point(436, 189);\r
+            this.slider_psytrellis.Name = "slider_psytrellis";\r
+            this.slider_psytrellis.Size = new System.Drawing.Size(131, 42);\r
+            this.slider_psytrellis.TabIndex = 48;\r
+            this.slider_psytrellis.ValueChanged += new System.EventHandler(this.slider_psytrellis_Scroll);\r
+            // \r
+            // lbl_psytrellis\r
+            // \r
+            this.lbl_psytrellis.AutoSize = true;\r
+            this.lbl_psytrellis.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_psytrellis.Location = new System.Drawing.Point(319, 193);\r
+            this.lbl_psytrellis.Name = "lbl_psytrellis";\r
+            this.lbl_psytrellis.Size = new System.Drawing.Size(111, 12);\r
+            this.lbl_psytrellis.TabIndex = 47;\r
+            this.lbl_psytrellis.Text = "Psychovisual Trellis:";\r
+            // \r
+            // lbl_psyrd\r
+            // \r
+            this.lbl_psyrd.AutoSize = true;\r
+            this.lbl_psyrd.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_psyrd.Location = new System.Drawing.Point(275, 159);\r
+            this.lbl_psyrd.Name = "lbl_psyrd";\r
+            this.lbl_psyrd.Size = new System.Drawing.Size(155, 12);\r
+            this.lbl_psyrd.TabIndex = 46;\r
+            this.lbl_psyrd.Text = "Psychovisual Rate Distortion:";\r
+            // \r
+            // slider_psyrd\r
+            // \r
+            this.slider_psyrd.Location = new System.Drawing.Point(436, 148);\r
+            this.slider_psyrd.Name = "slider_psyrd";\r
+            this.slider_psyrd.Size = new System.Drawing.Size(131, 42);\r
+            this.slider_psyrd.TabIndex = 45;\r
+            this.slider_psyrd.ValueChanged += new System.EventHandler(this.slider_psyrd_Scroll);\r
+            // \r
+            // lbl_adaptBFrames\r
+            // \r
+            this.lbl_adaptBFrames.AutoSize = true;\r
+            this.lbl_adaptBFrames.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_adaptBFrames.Location = new System.Drawing.Point(17, 119);\r
+            this.lbl_adaptBFrames.Name = "lbl_adaptBFrames";\r
+            this.lbl_adaptBFrames.Size = new System.Drawing.Size(106, 12);\r
+            this.lbl_adaptBFrames.TabIndex = 43;\r
+            this.lbl_adaptBFrames.Text = "Adaptive B-Frames:";\r
+            // \r
             // label43\r
             // \r
             this.label43.AutoSize = true;\r
@@ -2389,7 +2466,7 @@ namespace Handbrake
             this.rtf_x264Query.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
             this.rtf_x264Query.Location = new System.Drawing.Point(13, 253);\r
             this.rtf_x264Query.Name = "rtf_x264Query";\r
-            this.rtf_x264Query.Size = new System.Drawing.Size(667, 43);\r
+            this.rtf_x264Query.Size = new System.Drawing.Size(698, 43);\r
             this.rtf_x264Query.TabIndex = 42;\r
             this.rtf_x264Query.Text = "";\r
             this.rtf_x264Query.LostFocus += new System.EventHandler(this.rtf_x264Query_TextChanged);\r
@@ -2399,7 +2476,7 @@ namespace Handbrake
             // \r
             this.lbl_trellis.AutoSize = true;\r
             this.lbl_trellis.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_trellis.Location = new System.Drawing.Point(490, 169);\r
+            this.lbl_trellis.Location = new System.Drawing.Point(421, 125);\r
             this.lbl_trellis.Name = "lbl_trellis";\r
             this.lbl_trellis.Size = new System.Drawing.Size(41, 12);\r
             this.lbl_trellis.TabIndex = 26;\r
@@ -2409,7 +2486,7 @@ namespace Handbrake
             // \r
             this.label41.AutoSize = true;\r
             this.label41.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label41.Location = new System.Drawing.Point(466, 147);\r
+            this.label41.Location = new System.Drawing.Point(575, 67);\r
             this.label41.Name = "label41";\r
             this.label41.Size = new System.Drawing.Size(65, 12);\r
             this.label41.TabIndex = 25;\r
@@ -2418,10 +2495,10 @@ namespace Handbrake
             // panel3\r
             // \r
             this.panel3.BackColor = System.Drawing.Color.Black;\r
-            this.panel3.Location = new System.Drawing.Point(396, 131);\r
+            this.panel3.Location = new System.Drawing.Point(277, 118);\r
             this.panel3.Margin = new System.Windows.Forms.Padding(0);\r
             this.panel3.Name = "panel3";\r
-            this.panel3.Size = new System.Drawing.Size(284, 1);\r
+            this.panel3.Size = new System.Drawing.Size(290, 1);\r
             this.panel3.TabIndex = 24;\r
             // \r
             // panel1\r
@@ -2430,23 +2507,23 @@ namespace Handbrake
             this.panel1.Location = new System.Drawing.Point(13, 84);\r
             this.panel1.Margin = new System.Windows.Forms.Padding(0);\r
             this.panel1.Name = "panel1";\r
-            this.panel1.Size = new System.Drawing.Size(284, 1);\r
+            this.panel1.Size = new System.Drawing.Size(247, 1);\r
             this.panel1.TabIndex = 3;\r
             // \r
             // panel2\r
             // \r
             this.panel2.BackColor = System.Drawing.Color.Black;\r
-            this.panel2.Location = new System.Drawing.Point(396, 95);\r
+            this.panel2.Location = new System.Drawing.Point(277, 90);\r
             this.panel2.Margin = new System.Windows.Forms.Padding(0);\r
             this.panel2.Name = "panel2";\r
-            this.panel2.Size = new System.Drawing.Size(284, 1);\r
+            this.panel2.Size = new System.Drawing.Size(290, 1);\r
             this.panel2.TabIndex = 21;\r
             // \r
             // label45\r
             // \r
             this.label45.AutoSize = true;\r
             this.label45.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label45.Location = new System.Drawing.Point(478, 108);\r
+            this.label45.Location = new System.Drawing.Point(364, 97);\r
             this.label45.Name = "label45";\r
             this.label45.Size = new System.Drawing.Size(53, 12);\r
             this.label45.TabIndex = 22;\r
@@ -2456,27 +2533,27 @@ namespace Handbrake
             // \r
             this.label48.AutoSize = true;\r
             this.label48.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label48.Location = new System.Drawing.Point(385, 72);\r
+            this.label48.Location = new System.Drawing.Point(271, 40);\r
             this.label48.Name = "label48";\r
             this.label48.Size = new System.Drawing.Size(146, 12);\r
             this.label48.TabIndex = 20;\r
             this.label48.Text = "Subpixel Motion Estimation:";\r
             // \r
-            // label49\r
+            // lbl_merange\r
             // \r
-            this.label49.AutoSize = true;\r
-            this.label49.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label49.Location = new System.Drawing.Point(397, 43);\r
-            this.label49.Name = "label49";\r
-            this.label49.Size = new System.Drawing.Size(134, 12);\r
-            this.label49.TabIndex = 19;\r
-            this.label49.Text = "Motion Estimation Range:";\r
+            this.lbl_merange.AutoSize = true;\r
+            this.lbl_merange.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_merange.Location = new System.Drawing.Point(283, 66);\r
+            this.lbl_merange.Name = "lbl_merange";\r
+            this.lbl_merange.Size = new System.Drawing.Size(134, 12);\r
+            this.lbl_merange.TabIndex = 19;\r
+            this.lbl_merange.Text = "Motion Estimation Range:";\r
             // \r
             // label54\r
             // \r
             this.label54.AutoSize = true;\r
             this.label54.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label54.Location = new System.Drawing.Point(391, 14);\r
+            this.label54.Location = new System.Drawing.Point(277, 14);\r
             this.label54.Name = "label54";\r
             this.label54.Size = new System.Drawing.Size(140, 12);\r
             this.label54.TabIndex = 18;\r
@@ -2486,7 +2563,7 @@ namespace Handbrake
             // \r
             this.lbl_direct_prediction.AutoSize = true;\r
             this.lbl_direct_prediction.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_direct_prediction.Location = new System.Drawing.Point(52, 121);\r
+            this.lbl_direct_prediction.Location = new System.Drawing.Point(29, 145);\r
             this.lbl_direct_prediction.Name = "lbl_direct_prediction";\r
             this.lbl_direct_prediction.Size = new System.Drawing.Size(94, 12);\r
             this.lbl_direct_prediction.TabIndex = 5;\r
@@ -2496,7 +2573,7 @@ namespace Handbrake
             // \r
             this.label62.AutoSize = true;\r
             this.label62.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label62.Location = new System.Drawing.Point(88, 94);\r
+            this.label62.Location = new System.Drawing.Point(65, 93);\r
             this.label62.Name = "label62";\r
             this.label62.Size = new System.Drawing.Size(58, 12);\r
             this.label62.TabIndex = 4;\r
@@ -2506,7 +2583,7 @@ namespace Handbrake
             // \r
             this.label64.AutoSize = true;\r
             this.label64.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label64.Location = new System.Drawing.Point(47, 40);\r
+            this.label64.Location = new System.Drawing.Point(24, 40);\r
             this.label64.Name = "label64";\r
             this.label64.Size = new System.Drawing.Size(99, 12);\r
             this.label64.TabIndex = 1;\r
@@ -2521,7 +2598,7 @@ namespace Handbrake
             this.tab_query.Controls.Add(this.rtf_query);\r
             this.tab_query.Location = new System.Drawing.Point(4, 22);\r
             this.tab_query.Name = "tab_query";\r
-            this.tab_query.Size = new System.Drawing.Size(713, 316);\r
+            this.tab_query.Size = new System.Drawing.Size(724, 316);\r
             this.tab_query.TabIndex = 7;\r
             this.tab_query.Text = "Query Editor";\r
             this.tab_query.UseVisualStyleBackColor = true;\r
@@ -2591,7 +2668,7 @@ namespace Handbrake
             this.groupBox_dest.ForeColor = System.Drawing.Color.Black;\r
             this.groupBox_dest.Location = new System.Drawing.Point(9, 160);\r
             this.groupBox_dest.Name = "groupBox_dest";\r
-            this.groupBox_dest.Size = new System.Drawing.Size(721, 50);\r
+            this.groupBox_dest.Size = new System.Drawing.Size(732, 50);\r
             this.groupBox_dest.TabIndex = 3;\r
             this.groupBox_dest.TabStop = false;\r
             this.groupBox_dest.Text = "Destination";\r
@@ -2612,7 +2689,7 @@ namespace Handbrake
             this.groupBox2.Controls.Add(this.splitContainer1);\r
             this.groupBox2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.groupBox2.ForeColor = System.Drawing.Color.Black;\r
-            this.groupBox2.Location = new System.Drawing.Point(739, 70);\r
+            this.groupBox2.Location = new System.Drawing.Point(751, 70);\r
             this.groupBox2.Name = "groupBox2";\r
             this.groupBox2.Size = new System.Drawing.Size(245, 546);\r
             this.groupBox2.TabIndex = 6;\r
@@ -2717,7 +2794,7 @@ namespace Handbrake
             this.toolStrip1.Location = new System.Drawing.Point(0, 24);\r
             this.toolStrip1.Name = "toolStrip1";\r
             this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;\r
-            this.toolStrip1.Size = new System.Drawing.Size(995, 39);\r
+            this.toolStrip1.Size = new System.Drawing.Size(1004, 39);\r
             this.toolStrip1.TabIndex = 1;\r
             this.toolStrip1.Text = "toolStrip1";\r
             // \r
@@ -2865,7 +2942,7 @@ namespace Handbrake
             this.lbl_encode});\r
             this.StatusStrip.Location = new System.Drawing.Point(0, 627);\r
             this.StatusStrip.Name = "StatusStrip";\r
-            this.StatusStrip.Size = new System.Drawing.Size(995, 22);\r
+            this.StatusStrip.Size = new System.Drawing.Size(1004, 22);\r
             this.StatusStrip.TabIndex = 7;\r
             this.StatusStrip.Text = "statusStrip1";\r
             // \r
@@ -2923,7 +3000,7 @@ namespace Handbrake
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.AutoScroll = true;\r
-            this.ClientSize = new System.Drawing.Size(995, 649);\r
+            this.ClientSize = new System.Drawing.Size(1004, 649);\r
             this.Controls.Add(this.gb_source);\r
             this.Controls.Add(this.groupBox_dest);\r
             this.Controls.Add(this.groupBox_output);\r
@@ -2966,6 +3043,8 @@ namespace Handbrake
             this.tab_chapters.PerformLayout();\r
             this.h264Tab.ResumeLayout(false);\r
             this.h264Tab.PerformLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.slider_psytrellis)).EndInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.slider_psyrd)).EndInit();\r
             this.tab_query.ResumeLayout(false);\r
             this.tab_query.PerformLayout();\r
             this.groupBox_dest.ResumeLayout(false);\r
@@ -3108,7 +3187,7 @@ namespace Handbrake
         internal System.Windows.Forms.ComboBox drop_analysis;\r
         internal System.Windows.Forms.Label label48;\r
         internal System.Windows.Forms.ComboBox drop_subpixelMotionEstimation;\r
-        internal System.Windows.Forms.Label label49;\r
+        internal System.Windows.Forms.Label lbl_merange;\r
         internal System.Windows.Forms.ComboBox drop_MotionEstimationRange;\r
         internal System.Windows.Forms.Label label54;\r
         internal System.Windows.Forms.ComboBox drop_MotionEstimationMethod;\r
@@ -3201,6 +3280,12 @@ namespace Handbrake
         internal System.Windows.Forms.RadioButton radio_cq;\r
         internal System.Windows.Forms.RadioButton radio_avgBitrate;\r
         internal System.Windows.Forms.RadioButton radio_targetFilesize;\r
+        internal System.Windows.Forms.Label lbl_adaptBFrames;\r
+        internal System.Windows.Forms.ComboBox drop_adaptBFrames;\r
+        internal System.Windows.Forms.TrackBar slider_psyrd;\r
+        internal System.Windows.Forms.TrackBar slider_psytrellis;\r
+        internal System.Windows.Forms.Label lbl_psytrellis;\r
+        internal System.Windows.Forms.Label lbl_psyrd;\r
 \r
     }\r
 }
\ No newline at end of file
index eb2ced5..6fef28e 100644 (file)
@@ -1590,9 +1590,20 @@ namespace Handbrake
         }\r
         private void check_Cabac_CheckedChanged(object sender, EventArgs e)\r
         {\r
-\r
             x264PanelFunctions.on_x264_WidgetChange("cabac", this);\r
         }\r
+        private void slider_psyrd_Scroll(object sender, EventArgs e)\r
+        {\r
+            x264PanelFunctions.on_x264_WidgetChange("psy-rd", this);\r
+        }\r
+        private void slider_psytrellis_Scroll(object sender, EventArgs e)\r
+        {\r
+            x264PanelFunctions.on_x264_WidgetChange("psy-rd", this);\r
+        }\r
+        private void drop_adaptBFrames_SelectedIndexChanged(object sender, EventArgs e)\r
+        {\r
+            x264PanelFunctions.on_x264_WidgetChange("b-adapt", this);\r
+        }\r
 \r
         private void rtf_x264Query_TextChanged(object sender, EventArgs e)\r
         {\r
@@ -2186,7 +2197,6 @@ namespace Handbrake
 \r
         #endregion\r
 \r
-        \r
 \r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
index 7064b0c..ed5dccd 100644 (file)
@@ -191,10 +191,10 @@ namespace Handbrake
                     calculated = presetValue / x264step;\r
                     calculated = x - calculated;\r
 \r
-                    //TODO: Handle cases where it can't parse a value due to the float being too lage.\r
-                    // when used with .33 and .2 and 1.0 for example.\r
                     int.TryParse(calculated.ToString(), out value);\r
 \r
+                    // This will sometimes occur when the preset was generated \r
+                    // with a different granularity, so, round and try again.\r
                     if (value == 0)\r
                     {\r
                         double val =  Math.Round(calculated, 0);\r
index 550c116..be47041 100644 (file)
@@ -5,7 +5,6 @@ namespace Handbrake
 {\r
     class x264Panel\r
     {\r
-\r
         /// <summary>\r
         /// Reset all components to defaults and clears the x264 rtf box\r
         /// </summary>\r
@@ -28,6 +27,9 @@ namespace Handbrake
             mainWindow.drop_refFrames.SelectedIndex = 0;\r
             mainWindow.drop_subpixelMotionEstimation.SelectedIndex = 0;\r
             mainWindow.drop_trellis.SelectedIndex = 0;\r
+            mainWindow.slider_psyrd.Value = 0;\r
+            mainWindow.slider_psytrellis.Value = 0;\r
+            mainWindow.drop_adaptBFrames.SelectedIndex = 0;\r
 \r
             mainWindow.rtf_x264Query.Text = "";\r
         }\r
@@ -111,12 +113,17 @@ namespace Handbrake
                                 mainWindow.drop_MotionEstimationMethod.SelectedItem = "Uneven Multi-Hexagon";\r
                             else if (optValue.Equals("esa"))\r
                                 mainWindow.drop_MotionEstimationMethod.SelectedItem = "Exhaustive";\r
+                            else if (optValue.Equals("tesa"))\r
+                                mainWindow.drop_MotionEstimationMethod.SelectedItem = "Transformed Exhaustive";\r
 \r
                         }\r
                         /*ME Range NSPopUpButton*/\r
                         else if (optName.Equals("merange"))\r
                             mainWindow.drop_MotionEstimationRange.SelectedItem = optValue;\r
 \r
+                        else if (optName.Equals("b-adapt"))\r
+                            mainWindow.drop_adaptBFrames.SelectedItem = optValue; \r
+\r
                         /*Weighted B-Frames NSPopUpButton*/\r
                         else if (optName.Equals("weightb"))\r
                             mainWindow.check_weightedBFrames.CheckState = CheckState.Checked;\r
@@ -184,6 +191,26 @@ namespace Handbrake
                         /* CABAC NSButton */\r
                         else if (optName.Equals("cabac"))\r
                             mainWindow.check_Cabac.CheckState = CheckState.Unchecked;\r
+\r
+                        /* Psy-RD and Psy-Trellis NSSliders */\r
+                        else if (optName.Equals("psy-rd"))\r
+                        {\r
+                            string[] x = optValue.Split(',');\r
+\r
+                            double psyrd = 0, psytrellis = 0;\r
+                            int val, val2;\r
+                            double.TryParse(x[0], out psyrd);\r
+                            double.TryParse(x[1], out psytrellis);\r
+\r
+                            psyrd = psyrd * 10;\r
+                            psytrellis = psytrellis * 10;\r
+\r
+                            int.TryParse(psyrd.ToString(), out val);\r
+                            int.TryParse(psytrellis.ToString(), out val2);\r
+\r
+                            mainWindow.slider_psyrd.Value = val;\r
+                            mainWindow.slider_psytrellis.Value = val2;\r
+                        }\r
                     }\r
                 }\r
             }\r
@@ -392,7 +419,28 @@ namespace Handbrake
                             else if ((!da.Contains("Default")) && (!db.Contains("Default")))\r
                                 thisOpt = "deblock=" + da + "," + db;\r
                         }\r
+                        else if (optNameToChange.Equals("psy-rd"))\r
+                        {\r
+                            if (mainWindow.slider_psyrd.Value == 10 && mainWindow.slider_psytrellis.Value == 0)\r
+                                thisOpt = "";\r
+                            else\r
+                            {\r
+                                double psyrd = mainWindow.slider_psyrd.Value * 0.1;\r
+                                double psytre = mainWindow.slider_psytrellis.Value * 0.1;\r
+                                string rd, rt;\r
+                                if (psyrd == 1)\r
+                                    rd = "1.0";\r
+                                else\r
+                                    rd = psyrd.ToString();\r
+\r
+                                if (psytre == 1)\r
+                                    rt = "1.0";\r
+                                else\r
+                                    rt = psytre.ToString();\r
 \r
+                                thisOpt = "psy-rd=" + rd + "," + rt;\r
+                            }\r
+                        }\r
                         else if (optNameToChange.Equals("mixed-refs"))\r
                         {\r
                             if (mainWindow.check_mixedReferences.CheckState == CheckState.Checked)\r
@@ -462,6 +510,10 @@ namespace Handbrake
                                     thisOpt = "me=esa";\r
                                     break;\r
 \r
+                                case 5:\r
+                                    thisOpt = "me=tesa";\r
+                                    break;\r
+\r
                                 default:\r
                                     thisOpt = "";\r
                                     break;\r
@@ -516,6 +568,13 @@ namespace Handbrake
                             else\r
                                 thisOpt = "";\r
                         }\r
+                        else if (optNameToChange.Equals("b-adapt"))\r
+                        {\r
+                            if (!mainWindow.drop_adaptBFrames.SelectedItem.ToString().Contains("Default"))\r
+                                thisOpt = "b-adapt=" + (mainWindow.drop_adaptBFrames.SelectedIndex - 1);\r
+                            else\r
+                                thisOpt = "";\r
+                        }\r
                         else if (optNameToChange.Equals("ref"))\r
                         {\r
                             if (!mainWindow.drop_refFrames.SelectedItem.ToString().Contains("Default"))\r
@@ -590,6 +649,10 @@ namespace Handbrake
                         query = query + colon + "me=esa";\r
                         break;\r
 \r
+                    case 5:\r
+                        query = query + colon + "me=tesa";\r
+                        break;\r
+\r
                     default:\r
                         break;\r
                 }\r
@@ -639,6 +702,12 @@ namespace Handbrake
                 int value = mainWindow.drop_MotionEstimationRange.SelectedIndex + 3;\r
                 query = query + colon + "merange=" + value;\r
             }\r
+            else if (optNameToChange.Equals("b-adapt"))\r
+            {\r
+                int value = mainWindow.drop_adaptBFrames.SelectedIndex -1;\r
+                query = query + colon + "b-adapt=" + value;\r
+            }\r
+\r
             else if (optNameToChange.Equals("deblock"))\r
             {\r
                 String da = mainWindow.drop_deblockAlpha.SelectedItem.ToString();\r
@@ -660,6 +729,28 @@ namespace Handbrake
                     query = query + colon + "deblock=" + da + "," + db;\r
                 }\r
             }\r
+            else if (optNameToChange.Equals("psy-rd"))\r
+            {\r
+                if (mainWindow.slider_psyrd.Value == 10 && mainWindow.slider_psytrellis.Value == 0)\r
+                    query += "";\r
+                else\r
+                {\r
+                    double psyrd = mainWindow.slider_psyrd.Value * 0.1;\r
+                    double psytre = mainWindow.slider_psytrellis.Value * 0.1;\r
+                    string rd, rt;\r
+                    if (psyrd == 1)\r
+                        rd = "1.0";\r
+                    else\r
+                        rd = psyrd.ToString();\r
+\r
+                    if (psytre == 1)\r
+                        rt = "1.0";\r
+                    else\r
+                        rt = psytre.ToString();\r
+\r
+                    query += colon + "psy-rd=" + rd + "," + rt;\r
+                }\r
+            }\r
             else if (optNameToChange.Equals("mixed-refs"))\r
             {\r
                 if (mainWindow.check_mixedReferences.CheckState == CheckState.Checked)\r
@@ -741,6 +832,10 @@ namespace Handbrake
                 mainWindow.check_weightedBFrames.CheckState = CheckState.Unchecked;\r
                 mainWindow.check_pyrmidalBFrames.CheckState = CheckState.Unchecked;\r
                 mainWindow.drop_directPrediction.SelectedIndex = 0;\r
+\r
+                mainWindow.drop_adaptBFrames.Visible = false;\r
+                mainWindow.lbl_adaptBFrames.Visible = false;\r
+                mainWindow.drop_adaptBFrames.SelectedIndex = 0;\r
             }\r
             else if (mainWindow.drop_bFrames.SelectedIndex == 2)\r
             {\r
@@ -751,6 +846,9 @@ namespace Handbrake
                 mainWindow.check_weightedBFrames.Visible = true;\r
                 mainWindow.drop_directPrediction.Visible = true;\r
                 mainWindow.lbl_direct_prediction.Visible = true;\r
+\r
+                mainWindow.drop_adaptBFrames.Visible = true;\r
+                mainWindow.lbl_adaptBFrames.Visible = true;\r
             }\r
             else\r
             {\r
@@ -758,6 +856,9 @@ namespace Handbrake
                 mainWindow.check_pyrmidalBFrames.Visible = true;\r
                 mainWindow.drop_directPrediction.Visible = true;\r
                 mainWindow.lbl_direct_prediction.Visible = true;\r
+\r
+                mainWindow.drop_adaptBFrames.Visible = true;\r
+                mainWindow.lbl_adaptBFrames.Visible = true;\r
             }\r
 \r
             if (mainWindow.check_Cabac.Checked == false)\r
@@ -791,6 +892,57 @@ namespace Handbrake
             }\r
             else\r
                 mainWindow.check_mixedReferences.Visible = true;\r
+\r
+            if (mainWindow.drop_MotionEstimationMethod.SelectedIndex < 3)\r
+            {\r
+                mainWindow.drop_MotionEstimationRange.Visible = false;\r
+                mainWindow.lbl_merange.Visible = false;\r
+                mainWindow.drop_MotionEstimationRange.SelectedIndex = 0;\r
+            }\r
+            else\r
+            {\r
+                mainWindow.drop_MotionEstimationRange.Visible = true;\r
+                mainWindow.lbl_merange.Visible = true;\r
+            }\r
+\r
+            if (mainWindow.drop_subpixelMotionEstimation.SelectedIndex != 0 && mainWindow.drop_subpixelMotionEstimation.SelectedIndex < 7)\r
+            {\r
+                mainWindow.slider_psyrd.Visible = false;\r
+                mainWindow.slider_psyrd.Value = 10;\r
+                mainWindow.lbl_psyrd.Visible = false;\r
+\r
+\r
+                mainWindow.slider_psytrellis.Visible = false;\r
+                mainWindow.slider_psytrellis.Value = 0;\r
+                mainWindow.lbl_psytrellis.Visible = false;\r
+            }\r
+            else\r
+            {\r
+                mainWindow.slider_psyrd.Visible = true;\r
+                mainWindow.lbl_psyrd.Visible = true;\r
+\r
+                if (mainWindow.drop_trellis.SelectedIndex >= 2 && mainWindow.check_Cabac.Checked && mainWindow.slider_psytrellis.Visible == false)\r
+                {\r
+                    mainWindow.slider_psytrellis.Visible = true;\r
+                    mainWindow.lbl_psytrellis.Visible = true;\r
+                }\r
+            }\r
+\r
+            if (mainWindow.drop_trellis.SelectedIndex < 2)\r
+            {\r
+                mainWindow.slider_psytrellis.Visible = false;\r
+                mainWindow.slider_psytrellis.Value = 0;\r
+                mainWindow.lbl_psytrellis.Visible = false;\r
+            }\r
+            else\r
+            {\r
+                if ((mainWindow.drop_subpixelMotionEstimation.SelectedIndex == 0 || mainWindow.drop_subpixelMotionEstimation.SelectedIndex >= 7) && mainWindow.check_Cabac.Checked && mainWindow.slider_psytrellis.Visible == false)\r
+                {\r
+                    mainWindow.slider_psytrellis.Visible = true;\r
+                    mainWindow.lbl_psytrellis.Visible = true;\r
+                }\r
+            }\r
+\r
         }\r
 \r
     }\r