summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-09-25 18:34:36 +0000
committerjstebbins <[email protected]>2009-09-25 18:34:36 +0000
commit5a30aed7d252c467635729f25a7d3288b202d51f (patch)
tree3a30907ff253c62a63b61a00ad413ac7e6ea596b
parenta374242fe6973db162a5d9809fd54d4e0b861c03 (diff)
LinGui: ok, I relent. mbtree widget is not needed so it's gone
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2840 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--gtk/src/ghb.ui23
-rw-r--r--gtk/src/widgetdeps.c1
-rw-r--r--gtk/src/x264handler.c41
3 files changed, 29 insertions, 36 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 6899521ff..00d004ceb 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -3176,21 +3176,6 @@ no-dct-decimate=0:cabac=1</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="x264_mbtree">
- <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="tooltip-text" translatable="yes">Using macroblock tree ratecontrol overall improves compression.</property>
- <property name="label" translatable="yes">Macroblock Tree Rate Control</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <signal handler="x264_widget_changed_cb" name="toggled"/>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
<object class="GtkCheckButton" id="x264_no_fast_pskip">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -3202,7 +3187,7 @@ no-dct-decimate=0:cabac=1</property>
<signal handler="x264_widget_changed_cb" name="toggled"/>
</object>
<packing>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -3217,7 +3202,7 @@ no-dct-decimate=0:cabac=1</property>
<signal handler="x264_widget_changed_cb" name="toggled"/>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -3232,7 +3217,7 @@ no-dct-decimate=0:cabac=1</property>
<signal handler="x264_widget_changed_cb" name="toggled"/>
</object>
<packing>
- <property name="position">5</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -3300,7 +3285,7 @@ no-dct-decimate=0:cabac=1</property>
</child>
</object>
<packing>
- <property name="position">6</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
diff --git a/gtk/src/widgetdeps.c b/gtk/src/widgetdeps.c
index ef58b769c..4747f69de 100644
--- a/gtk/src/widgetdeps.c
+++ b/gtk/src/widgetdeps.c
@@ -72,7 +72,6 @@ static dependency_t dep_map[] =
{"x264_subme", "x264_psy_trell", "<6", TRUE, FALSE},
{"x264_cabac", "x264_psy_trell", "TRUE", FALSE, FALSE},
{"x264_trellis", "x264_psy_trell", "0", TRUE, FALSE},
- {"x264_mbtree", "x264_bpyramid", "FALSE", FALSE, 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/x264handler.c b/gtk/src/x264handler.c
index 6ad1cfe93..60a05b56c 100644
--- a/gtk/src/x264handler.c
+++ b/gtk/src/x264handler.c
@@ -194,7 +194,7 @@ struct x264_opt_map_s x264_opt_map[] =
{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_mbtree_syns, "x264_mbtree", "1", X264_OPT_BOOL},
+ {x264_mbtree_syns, "x264_mbtree", "1", X264_OPT_NONE},
{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))
@@ -433,20 +433,7 @@ ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options)
{
if (!x264_opt_map[jj].found)
{
- gchar *val;
-
- if (x264_opt_map[jj].opt_syns == x264_mbtree_syns)
- {
- int bframes = ghb_lookup_bframes(options);
- if (bframes > 0)
- val = strdup("1");
- else
- val = strdup("0");
- }
- else
- {
- val = strdup(x264_opt_map[jj].def_val);
- }
+ gchar *val = strdup(x264_opt_map[jj].def_val);
switch(x264_opt_map[jj].type)
{
case X264_OPT_INT:
@@ -764,6 +751,28 @@ ghb_lookup_bframes(const gchar *options)
return ret;
}
+gint
+ghb_lookup_mbtree(const gchar *options)
+{
+ gint ret = ghb_lookup_bframes(options) != 0;
+ gchar *result;
+ gchar **split;
+
+ if (options == NULL)
+ options = "";
+
+ split = g_strsplit(options, ":", -1);
+
+ result = x264_lookup_value(split, x264_mbtree_syns);
+ g_strfreev(split);
+ if (result != NULL)
+ {
+ ret = g_strtod(result, NULL);
+ g_free(result);
+ }
+ return ret;
+}
+
// Construct the x264 options string
// The result is allocated, so someone must free it at some point.
static gchar*
@@ -774,7 +783,7 @@ sanitize_x264opts(signal_user_data_t *ud, const gchar *options)
gint ii;
// Fix up option dependencies
- gboolean mbtree = ghb_settings_get_boolean(ud->settings, "x264_mbtree");
+ gboolean mbtree = ghb_lookup_mbtree(options);
if (mbtree)
{
x264_remove_opt(split, x264_bpyramid_syns);