diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/ghb.ui | 90 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 4 | ||||
-rw-r--r-- | gtk/src/makedeps.c | 4 | ||||
-rw-r--r-- | gtk/src/resource_data.h | 186 | ||||
-rw-r--r-- | gtk/src/resources.plist | 130 | ||||
-rw-r--r-- | gtk/src/widget_deps | 10 | ||||
-rw-r--r-- | gtk/src/widget_reverse_deps | 30 | ||||
-rw-r--r-- | gtk/src/x264handler.c | 57 |
8 files changed, 500 insertions, 11 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 3046ccb71..fe91aaf04 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -169,6 +169,22 @@ <property name="page_increment">10</property> <property name="page_size">0</property> </object> + <object class="GtkAdjustment" id="adjustment22"> + <property name="upper">1</property> + <property name="lower">0</property> + <property name="page_increment">0.5</property> + <property name="step_increment">0.1</property> + <property name="page_size">0</property> + <property name="value">1</property> + </object> + <object class="GtkAdjustment" id="adjustment23"> + <property name="upper">1</property> + <property name="lower">0</property> + <property name="page_increment">0.5</property> + <property name="step_increment">0.1</property> + <property name="page_size">0</property> + <property name="value">0</property> + </object> <object class="GtkAdjustment" id="preview_progress_adj"> <property name="upper">100</property> <property name="lower">0</property> @@ -2410,9 +2426,9 @@ You can edit these and add additional options. Default values will not be shown. The defaults are: ref=1:mixed-refs=0:bframes=0:direct=spatial:b-pyramid=0: -weightb=0:me=hex:merange=16:subme=5: -analyse=some:8x8dct=0:deblock=0,0:trellis=0: -no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> +weightb=0:me=hex:merange=16:subme=6:analyse=some:8x8dct=0: +deblock=0,0:trellis=0:psy-rd=1,0:no-fast-pskip=0: +no-dct-decimate=0:cabac=1</property> <property name="wrap_mode">GTK_WRAP_CHAR</property> <property name="accepts_tab">False</property> <signal handler="x264_focus_out_cb" name="focus_out_event"/> @@ -2816,6 +2832,74 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> <property name="position">4</property> </packing> </child> + <child> + <object class="GtkTable" id="table9"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="visible">True</property> + <child> + <object class="GtkLabel" id="label82"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Psychovisual Rate Distortion: </property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkHScale" id="x264_psy_rd"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="adjustment">adjustment22</property> + <property name="restrict_to_fill_level">False</property> + <property name="value_pos">GTK_POS_RIGHT</property> + <signal handler="x264_widget_changed_cb" name="value_changed"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label83"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Psychovisual Trellis: </property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkHScale" id="x264_psy_trell"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="adjustment">adjustment23</property> + <property name="restrict_to_fill_level">False</property> + <property name="value_pos">GTK_POS_RIGHT</property> + <signal handler="x264_widget_changed_cb" name="value_changed"/> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">5</property> + </packing> + </child> </object> </child> </object> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index fe6b7c41c..523a495d0 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -229,8 +229,8 @@ combo_opts_t analyse_opts = static options_map_t d_trellis_opts[] = { - {"Disabled", "0", 0, "0"}, - {"Final Macro Block", "1", 1, "1"}, + {"Disabled", "0", 0, "0"}, + {"Final Macro Block", "1", 1, "1"}, {"Always", "2", 2, "2"}, }; combo_opts_t trellis_opts = diff --git a/gtk/src/makedeps.c b/gtk/src/makedeps.c index 0c28c5abc..c39e3d577 100644 --- a/gtk/src/makedeps.c +++ b/gtk/src/makedeps.c @@ -67,6 +67,10 @@ static dependency_t dep_map[] = {"x264_bframes", "x264_direct", "0", TRUE, FALSE}, {"x264_refs", "x264_mixed_refs", "<2", TRUE, FALSE}, {"x264_cabac", "x264_trellis", "TRUE", FALSE, FALSE}, + {"x264_subme", "x264_psy_rd", "<6", TRUE, FALSE}, + {"x264_subme", "x264_psy_trell", "<6", TRUE, FALSE}, + {"x264_cabac", "x264_psy_trell", "TRUE", FALSE, FALSE}, + {"x264_trellis", "x264_psy_trell", "0", TRUE, FALSE}, {"ChapterMarkers", "chapters_list", "TRUE", FALSE, FALSE}, {"use_source_name", "chapters_in_destination", "TRUE", FALSE, FALSE}, {"use_source_name", "title_no_in_destination", "TRUE", FALSE, FALSE}, diff --git a/gtk/src/resource_data.h b/gtk/src/resource_data.h index 689c141eb..3de99671b 100644 --- a/gtk/src/resource_data.h +++ b/gtk/src/resource_data.h @@ -216,6 +216,28 @@ "\n" " <property name="page_size">0</property>\n" " </object>\n" +" <object class="GtkAdjustment" id="adjustment22"" +";>\n" +" <property name="upper">1</property>\n" +" <property name="lower">0</property>\n" +" <property name="page_increment">0.5</property>" +";\n" +" <property name="step_increment">0.1</property>" +";\n" +" <property name="page_size">0</property>\n" +" <property name="value">1</property>\n" +" </object>\n" +" <object class="GtkAdjustment" id="adjustment23"" +";>\n" +" <property name="upper">1</property>\n" +" <property name="lower">0</property>\n" +" <property name="page_increment">0.5</property>" +";\n" +" <property name="step_increment">0.1</property>" +";\n" +" <property name="page_size">0</property>\n" +" <property name="value">0</property>\n" +" </object>\n" " <object class="GtkAdjustment" id="preview_progress_" "adj">\n" " <property name="upper">100</property>\n" @@ -3903,9 +3925,9 @@ "\n" "Default values will not be shown. The defaults are:\n" "ref=1:mixed-refs=0:bframes=0:direct=spatial:b-pyramid=0:\n" -"weightb=0:me=hex:merange=16:subme=5:\n" -"analyse=some:8x8dct=0:deblock=0,0:trellis=0:\n" -"no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>\n" +"weightb=0:me=hex:merange=16:subme=6:analyse=some:8x8dct=0:\n" +"deblock=0,0:trellis=0:psy-rd=1,0:no-fast-pskip=0:\n" +"no-dct-decimate=0:cabac=1</property>\n" " <property name="wrap_mode&q" "uot;>GTK_WRAP_CHAR</property>\n" " <property name="accepts_tab" @@ -4613,6 +4635,124 @@ "n">4</property>\n" " </packing>\n" " </child>\n" +" <child>\n" +" <object class="GtkTable&q" +"uot; id="table9">\n" +" <property name="visible" +"">True</property>\n" +" <property name="events&" +"quot;>GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_B" +"UTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>\n" +" <property name="n_rows&" +"quot;>2</property>\n" +" <property name="n_colum" +"ns">2</property>\n" +" <property name="visible" +"">True</property>\n" +" <child>\n" +" <object class="GtkLab" +"el" id="label82">\n" +" <property name="vis" +"ible">True</property>\n" +" <property name="eve" +"nts">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | G" +"DK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>\n" +" <property name="xal" +"ign">1</property>\n" +" <property name="lab" +"el" translatable="yes">Psychovisual Rate Distortion: " +"</property>\n" +" </object>\n" +" <packing>\n" +" <property name="x_o" +"ptions">GTK_FILL</property>\n" +" </packing>\n" +" </child>\n" +" <child>\n" +" <object class="GtkHSc" +"ale" id="x264_psy_rd">\n" +" <property name="vis" +"ible">True</property>\n" +" <property name="can" +"_focus">True</property>\n" +" <property name="eve" +"nts">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | G" +"DK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>\n" +" <property name="adj" +"ustment">adjustment22</property>\n" +" <property name="res" +"trict_to_fill_level">False</property>\n" +" <property name="val" +"ue_pos">GTK_POS_RIGHT</property>\n" +" <signal handler="x2" +"64_widget_changed_cb" name="value_changed"/>\n" +" </object>\n" +" <packing>\n" +" <property name="lef" +"t_attach">1</property>\n" +" <property name="rig" +"ht_attach">2</property>\n" +" </packing>\n" +" </child>\n" +" <child>\n" +" <object class="GtkLab" +"el" id="label83">\n" +" <property name="vis" +"ible">True</property>\n" +" <property name="eve" +"nts">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | G" +"DK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>\n" +" <property name="xal" +"ign">1</property>\n" +" <property name="lab" +"el" translatable="yes">Psychovisual Trellis: </pro" +"perty>\n" +" </object>\n" +" <packing>\n" +" <property name="top" +"_attach">1</property>\n" +" <property name="bot" +"tom_attach">2</property>\n" +" <property name="x_o" +"ptions">GTK_FILL</property>\n" +" </packing>\n" +" </child>\n" +" <child>\n" +" <object class="GtkHSc" +"ale" id="x264_psy_trell">\n" +" <property name="vis" +"ible">True</property>\n" +" <property name="can" +"_focus">True</property>\n" +" <property name="eve" +"nts">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | G" +"DK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>\n" +" <property name="adj" +"ustment">adjustment23</property>\n" +" <property name="res" +"trict_to_fill_level">False</property>\n" +" <property name="val" +"ue_pos">GTK_POS_RIGHT</property>\n" +" <signal handler="x2" +"64_widget_changed_cb" name="value_changed"/>\n" +" </object>\n" +" <packing>\n" +" <property name="top" +"_attach">1</property>\n" +" <property name="bot" +"tom_attach">2</property>\n" +" <property name="lef" +"t_attach">1</property>\n" +" <property name="rig" +"ht_attach">2</property>\n" +" </packing>\n" +" </child>\n" +" </object>\n" +" <packing>\n" +" <property name="positio" +"n">5</property>\n" +" </packing>\n" +" </child>\n" " </object>\n" " </child>\n" " </object>\n" @@ -12839,11 +12979,21 @@ " <key>x264_cabac</key>\n" " <array>\n" " <string>x264_trellis</string>\n" +" <string>x264_psy_trell</string>\n" " </array>\n" " <key>x264_refs</key>\n" " <array>\n" " <string>x264_mixed_refs</string>\n" " </array>\n" +" <key>x264_subme</key>\n" +" <array>\n" +" <string>x264_psy_rd</string>\n" +" <string>x264_psy_trell</string>\n" +" </array>\n" +" <key>x264_trellis</key>\n" +" <array>\n" +" <string>x264_psy_trell</string>\n" +" </array>\n" " </dict>\n" " <key>widget-reverse-deps</key>\n" " <dict>\n" @@ -13264,6 +13414,36 @@ " <false />\n" " </array>\n" " </array>\n" +" <key>x264_psy_rd</key>\n" +" <array>\n" +" <array>\n" +" <string>x264_subme</string>\n" +" <string><6</string>\n" +" <true />\n" +" <false />\n" +" </array>\n" +" </array>\n" +" <key>x264_psy_trell</key>\n" +" <array>\n" +" <array>\n" +" <string>x264_subme</string>\n" +" <string><6</string>\n" +" <true />\n" +" <false />\n" +" </array>\n" +" <array>\n" +" <string>x264_cabac</string>\n" +" <string>TRUE</string>\n" +" <false />\n" +" <false />\n" +" </array>\n" +" <array>\n" +" <string>x264_trellis</string>\n" +" <string>0</string>\n" +" <true />\n" +" <false />\n" +" </array>\n" +" </array>\n" " <key>x264_tab</key>\n" " <array>\n" " <array>\n" diff --git a/gtk/src/resources.plist b/gtk/src/resources.plist index ad2f33944..08b1f3dda 100644 --- a/gtk/src/resources.plist +++ b/gtk/src/resources.plist @@ -174,6 +174,22 @@ <property name="page_increment">10</property> <property name="page_size">0</property> </object> + <object class="GtkAdjustment" id="adjustment22"> + <property name="upper">1</property> + <property name="lower">0</property> + <property name="page_increment">0.5</property> + <property name="step_increment">0.1</property> + <property name="page_size">0</property> + <property name="value">1</property> + </object> + <object class="GtkAdjustment" id="adjustment23"> + <property name="upper">1</property> + <property name="lower">0</property> + <property name="page_increment">0.5</property> + <property name="step_increment">0.1</property> + <property name="page_size">0</property> + <property name="value">0</property> + </object> <object class="GtkAdjustment" id="preview_progress_adj"> <property name="upper">100</property> <property name="lower">0</property> @@ -2415,9 +2431,9 @@ You can edit these and add additional options. Default values will not be shown. The defaults are: ref=1:mixed-refs=0:bframes=0:direct=spatial:b-pyramid=0: -weightb=0:me=hex:merange=16:subme=5: -analyse=some:8x8dct=0:deblock=0,0:trellis=0: -no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> +weightb=0:me=hex:merange=16:subme=6:analyse=some:8x8dct=0: +deblock=0,0:trellis=0:psy-rd=1,0:no-fast-pskip=0: +no-dct-decimate=0:cabac=1</property> <property name="wrap_mode">GTK_WRAP_CHAR</property> <property name="accepts_tab">False</property> <signal handler="x264_focus_out_cb" name="focus_out_event"/> @@ -2821,6 +2837,74 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> <property name="position">4</property> </packing> </child> + <child> + <object class="GtkTable" id="table9"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="visible">True</property> + <child> + <object class="GtkLabel" id="label82"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Psychovisual Rate Distortion: </property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkHScale" id="x264_psy_rd"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="adjustment">adjustment22</property> + <property name="restrict_to_fill_level">False</property> + <property name="value_pos">GTK_POS_RIGHT</property> + <signal handler="x264_widget_changed_cb" name="value_changed"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label83"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Psychovisual Trellis: </property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkHScale" id="x264_psy_trell"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="adjustment">adjustment23</property> + <property name="restrict_to_fill_level">False</property> + <property name="value_pos">GTK_POS_RIGHT</property> + <signal handler="x264_widget_changed_cb" name="value_changed"/> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">5</property> + </packing> + </child> </object> </child> </object> @@ -7287,11 +7371,21 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A <key>x264_cabac</key> <array> <string>x264_trellis</string> + <string>x264_psy_trell</string> </array> <key>x264_refs</key> <array> <string>x264_mixed_refs</string> </array> + <key>x264_subme</key> + <array> + <string>x264_psy_rd</string> + <string>x264_psy_trell</string> + </array> + <key>x264_trellis</key> + <array> + <string>x264_psy_trell</string> + </array> </dict> <key>widget-reverse-deps</key> <dict> @@ -7712,6 +7806,36 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A <false /> </array> </array> + <key>x264_psy_rd</key> + <array> + <array> + <string>x264_subme</string> + <string><6</string> + <true /> + <false /> + </array> + </array> + <key>x264_psy_trell</key> + <array> + <array> + <string>x264_subme</string> + <string><6</string> + <true /> + <false /> + </array> + <array> + <string>x264_cabac</string> + <string>TRUE</string> + <false /> + <false /> + </array> + <array> + <string>x264_trellis</string> + <string>0</string> + <true /> + <false /> + </array> + </array> <key>x264_tab</key> <array> <array> diff --git a/gtk/src/widget_deps b/gtk/src/widget_deps index 31d3e5917..1a1cbb178 100644 --- a/gtk/src/widget_deps +++ b/gtk/src/widget_deps @@ -112,10 +112,20 @@ <key>x264_cabac</key> <array> <string>x264_trellis</string> + <string>x264_psy_trell</string> </array> <key>x264_refs</key> <array> <string>x264_mixed_refs</string> </array> + <key>x264_subme</key> + <array> + <string>x264_psy_rd</string> + <string>x264_psy_trell</string> + </array> + <key>x264_trellis</key> + <array> + <string>x264_psy_trell</string> + </array> </dict> </plist> diff --git a/gtk/src/widget_reverse_deps b/gtk/src/widget_reverse_deps index c573d6069..586d40043 100644 --- a/gtk/src/widget_reverse_deps +++ b/gtk/src/widget_reverse_deps @@ -419,6 +419,36 @@ <false /> </array> </array> + <key>x264_psy_rd</key> + <array> + <array> + <string>x264_subme</string> + <string><6</string> + <true /> + <false /> + </array> + </array> + <key>x264_psy_trell</key> + <array> + <array> + <string>x264_subme</string> + <string><6</string> + <true /> + <false /> + </array> + <array> + <string>x264_cabac</string> + <string>TRUE</string> + <false /> + <false /> + </array> + <array> + <string>x264_trellis</string> + <string>0</string> + <true /> + <false /> + </array> + </array> <key>x264_tab</key> <array> <array> diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c index 36bed7721..26c5c359b 100644 --- a/gtk/src/x264handler.c +++ b/gtk/src/x264handler.c @@ -122,6 +122,7 @@ x264_focus_out_cb(GtkWidget *widget, GdkEventFocus *event, enum { X264_OPT_DEBLOCK, + X264_OPT_PSY, X264_OPT_INT, X264_OPT_COMBO, X264_OPT_BOOL, @@ -151,6 +152,7 @@ static gchar *x264_8x8dct_syns[] = {"8x8dct", NULL}; static gchar *x264_deblock_syns[] = {"deblock", "filter", NULL}; static gchar *x264_trellis_syns[] = {"trellis", NULL}; static gchar *x264_pskip_syns[] = {"no-fast-pskip", "no_fast_pskip", NULL}; +static gchar *x264_psy_syns[] = {"psy-rd", NULL}; static gchar *x264_decimate_syns[] = {"no-dct-decimate", "no_dct_decimate", NULL}; static gchar *x264_cabac_syns[] = {"cabac", NULL}; @@ -186,6 +188,8 @@ struct x264_opt_map_s x264_opt_map[] = {x264_pskip_syns, "x264_no_fast_pskip", "0", X264_OPT_BOOL}, {x264_decimate_syns, "x264_no_dct_decimate", "0", X264_OPT_BOOL}, {x264_cabac_syns, "x264_cabac", "1", X264_OPT_BOOL}, + {x264_psy_syns, "x264_psy_rd", "1,0", X264_OPT_PSY}, + {x264_psy_syns, "x264_psy_trell", "1,0", X264_OPT_PSY}, }; #define X264_OPT_MAP_SIZE (sizeof(x264_opt_map)/sizeof(struct x264_opt_map_s)) @@ -329,6 +333,36 @@ x264_update_deblock(signal_user_data_t *ud, const gchar *xval) ghb_ui_update(ud, "x264_deblock_beta", ghb_int64_value(bvalue)); } +static void +x264_update_psy(signal_user_data_t *ud, const gchar *xval) +{ + gdouble rd_value, trell_value; + gchar *end; + gchar *val; + gchar *trell_val = NULL; + + if (xval == NULL) return; + val = g_strdup(xval); + rd_value = trell_value = 0; + if (val != NULL) + { + gchar *pos = strchr(val, ','); + if (pos != NULL) + { + trell_val = pos + 1; + *pos = 0; + } + rd_value = g_strtod (val, &end); + if (trell_val != NULL) + { + trell_value = g_strtod (trell_val, &end); + } + } + g_free(val); + ghb_ui_update(ud, "x264_psy_rd", ghb_double_value(rd_value)); + ghb_ui_update(ud, "x264_psy_trell", ghb_double_value(trell_value)); +} + void ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options) { @@ -371,6 +405,11 @@ ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options) x264_opt_map[jj+1].found = TRUE; x264_update_deblock(ud, val); break; + case X264_OPT_PSY: + // dirty little hack. mark psy_trell found as well + x264_opt_map[jj+1].found = TRUE; + x264_update_psy(ud, val); + break; } break; } @@ -397,6 +436,9 @@ ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options) case X264_OPT_DEBLOCK: x264_update_deblock(ud, val); break; + case X264_OPT_PSY: + x264_update_psy(ud, val); + break; } x264_opt_map[jj].found = TRUE; g_free(val); @@ -418,6 +460,17 @@ get_deblock_val(signal_user_data_t *ud) return result; } +gchar* +get_psy_val(signal_user_data_t *ud) +{ + gdouble rd, trell; + gchar *result; + rd = ghb_settings_get_double(ud->settings, "x264_psy_rd"); + trell = ghb_settings_get_double(ud->settings, "x264_psy_trell"); + result = g_strdup_printf("%g,%g", rd, trell); + return result; +} + static void x264_opt_update(signal_user_data_t *ud, GtkWidget *widget) { @@ -469,6 +522,8 @@ x264_opt_update(signal_user_data_t *ud, GtkWidget *widget) foundit = TRUE; if (type == X264_OPT_DEBLOCK) val = get_deblock_val(ud); + else if (type == X264_OPT_PSY) + val = get_psy_val(ud); else { GValue *gval; @@ -504,6 +559,8 @@ x264_opt_update(signal_user_data_t *ud, GtkWidget *widget) gchar *val; if (type == X264_OPT_DEBLOCK) val = get_deblock_val(ud); + else if (type == X264_OPT_PSY) + val = get_psy_val(ud); else { GValue *gval; |