3 #include "x264_gtk_i18n.h"
4 #include "x264_gtk_private.h"
8 static void _mb_bframe_pyramid (GtkToggleButton *button,
10 static void _mb_inter_search_8 (GtkToggleButton *button,
12 static void _mb_transform_8x8 (GtkToggleButton *button,
17 _mb_page (X264_Gui_Config *config)
25 GtkTooltips *tooltips;
27 tooltips = gtk_tooltips_new ();
29 vbox = gtk_vbox_new (FALSE, 0);
30 gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
33 frame = gtk_frame_new (_("Partitions"));
34 gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6);
35 gtk_widget_show (frame);
37 vbox2 = gtk_vbox_new (FALSE, 6);
38 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 6);
39 gtk_container_add (GTK_CONTAINER (frame), vbox2);
40 gtk_widget_show (vbox2);
42 config->mb.partitions.transform_8x8 = gtk_check_button_new_with_label (_("8x8 Transform"));
43 gtk_tooltips_set_tip (tooltips, config->mb.partitions.transform_8x8,
44 _("8x8 Transform - description"),
46 g_signal_connect (G_OBJECT (config->mb.partitions.transform_8x8),
48 G_CALLBACK (_mb_transform_8x8), config);
49 gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.transform_8x8, FALSE, TRUE, 0);
50 gtk_widget_show (config->mb.partitions.transform_8x8);
52 config->mb.partitions.pframe_search_8 = gtk_check_button_new_with_label (_("8x16, 16x8 and 8x8 P-frame search"));
53 gtk_tooltips_set_tip (tooltips, config->mb.partitions.pframe_search_8,
54 _("8x16, 16x8 and 8x8 P-frame search - description"),
56 gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.pframe_search_8, FALSE, TRUE, 0);
57 gtk_widget_show (config->mb.partitions.pframe_search_8);
59 config->mb.partitions.bframe_search_8 = gtk_check_button_new_with_label (_("8x16, 16x8 and 8x8 B-frame search"));
60 gtk_tooltips_set_tip (tooltips, config->mb.partitions.bframe_search_8,
61 _("8x16, 16x8 and 8x8 B-frame search - description"),
63 gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.bframe_search_8, FALSE, TRUE, 0);
64 gtk_widget_show (config->mb.partitions.bframe_search_8);
66 config->mb.partitions.pframe_search_4 = gtk_check_button_new_with_label (_("4x8, 8x4 and 4x4 P-frame search"));
67 gtk_tooltips_set_tip (tooltips, config->mb.partitions.pframe_search_4,
68 _("4x8, 8x4 and 4x4 P-frame search - description"),
70 gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.pframe_search_4, FALSE, TRUE, 0);
71 gtk_widget_show (config->mb.partitions.pframe_search_4);
73 config->mb.partitions.inter_search_8 = gtk_check_button_new_with_label (_("8x8 Intra search"));
74 gtk_tooltips_set_tip (tooltips, config->mb.partitions.inter_search_8,
75 _("8x8 Intra search - description"),
77 g_signal_connect (G_OBJECT (config->mb.partitions.inter_search_8),
79 G_CALLBACK (_mb_inter_search_8), config);
80 gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.inter_search_8, FALSE, TRUE, 0);
81 gtk_widget_show (config->mb.partitions.inter_search_8);
83 config->mb.partitions.inter_search_4 = gtk_check_button_new_with_label (_("4x4 Intra search"));
84 gtk_tooltips_set_tip (tooltips, config->mb.partitions.inter_search_4,
85 _("4x4 Intra search - description"),
87 gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.inter_search_4, FALSE, TRUE, 0);
88 gtk_widget_show (config->mb.partitions.inter_search_4);
91 frame = gtk_frame_new (_("B-Frames"));
92 gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6);
93 gtk_widget_show (frame);
95 table = gtk_table_new (5, 2, TRUE);
96 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
97 gtk_container_set_border_width (GTK_CONTAINER (table), 6);
98 gtk_container_add (GTK_CONTAINER (frame), table);
99 gtk_widget_show (table);
101 eb = gtk_event_box_new ();
102 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
103 gtk_tooltips_set_tip (tooltips, eb,
104 _("Max consecutive - description"),
106 gtk_table_attach_defaults (GTK_TABLE (table), eb,
108 gtk_widget_show (eb);
110 label = gtk_label_new (_("Max consecutive"));
111 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
112 gtk_container_add (GTK_CONTAINER (eb), label);
113 gtk_widget_show (label);
115 config->mb.bframes.bframe = gtk_entry_new_with_max_length (3);
116 gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe,
118 gtk_widget_show (config->mb.bframes.bframe);
120 eb = gtk_event_box_new ();
121 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
122 gtk_tooltips_set_tip (tooltips, eb,
123 _("Bias - description"),
125 gtk_table_attach_defaults (GTK_TABLE (table), eb,
127 gtk_widget_show (eb);
129 label = gtk_label_new (_("Bias"));
130 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
131 gtk_container_add (GTK_CONTAINER (eb), label);
132 gtk_widget_show (label);
134 config->mb.bframes.bframe_bias = gtk_hscale_new_with_range (-100.0, 100.0, 1.0);
135 gtk_scale_set_digits (GTK_SCALE (config->mb.bframes.bframe_bias), 0);
136 gtk_scale_set_value_pos (GTK_SCALE (config->mb.bframes.bframe_bias), GTK_POS_RIGHT);
137 gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe_bias,
139 gtk_widget_show (config->mb.bframes.bframe_bias);
141 config->mb.bframes.bframe_pyramid = gtk_check_button_new_with_label (_("Use as references"));
142 gtk_tooltips_set_tip (tooltips, config->mb.bframes.bframe_pyramid,
143 _("Use as references - description"),
145 g_signal_connect (G_OBJECT (config->mb.bframes.bframe_pyramid),
147 G_CALLBACK (_mb_bframe_pyramid), config);
148 gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe_pyramid,
150 gtk_widget_show (config->mb.bframes.bframe_pyramid);
152 config->mb.bframes.bidir_me = gtk_check_button_new_with_label (_("Bidirectional ME"));
153 gtk_tooltips_set_tip (tooltips, config->mb.bframes.bidir_me,
154 _("Bidirectional ME - description"),
156 gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bidir_me,
158 gtk_widget_show (config->mb.bframes.bidir_me);
160 config->mb.bframes.bframe_adaptive = gtk_check_button_new_with_label (_("Adaptive"));
161 gtk_tooltips_set_tip (tooltips, config->mb.bframes.bframe_adaptive,
162 _("Adaptive - description"),
164 gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe_adaptive,
166 gtk_widget_show (config->mb.bframes.bframe_adaptive);
168 config->mb.bframes.weighted_bipred = gtk_check_button_new_with_label (_("Weighted biprediction"));
169 gtk_tooltips_set_tip (tooltips, config->mb.bframes.weighted_bipred,
170 _("Weighted biprediction - description"),
172 gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.weighted_bipred,
174 gtk_widget_show (config->mb.bframes.weighted_bipred);
176 eb = gtk_event_box_new ();
177 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
178 gtk_tooltips_set_tip (tooltips, eb,
179 _("Direct mode - description"),
181 gtk_table_attach_defaults (GTK_TABLE (table), eb,
183 gtk_widget_show (eb);
185 label = gtk_label_new (_("Direct mode"));
186 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
187 gtk_container_add (GTK_CONTAINER (eb), label);
188 gtk_widget_show (label);
190 config->mb.bframes.direct_mode = gtk_combo_box_new_text ();
191 gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode),
193 gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode),
195 gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode),
197 gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode),
199 gtk_table_attach_defaults (GTK_TABLE (table),
200 config->mb.bframes.direct_mode,
202 gtk_widget_show (config->mb.bframes.direct_mode);
208 _mb_bframe_pyramid (GtkToggleButton *button,
211 X264_Gui_Config *config;
213 config = (X264_Gui_Config *)user_data;
215 if (gtk_toggle_button_get_active (button)) {
219 text = gtk_entry_get_text (GTK_ENTRY (config->mb.bframes.bframe));
220 val = (gint)g_ascii_strtoull (text, NULL, 10);
222 gtk_entry_set_text (GTK_ENTRY (config->mb.bframes.bframe), "2");
227 _mb_inter_search_8 (GtkToggleButton *button,
230 X264_Gui_Config *config;
232 config = (X264_Gui_Config *)user_data;
234 if (gtk_toggle_button_get_active (button)) {
235 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.transform_8x8), TRUE);
240 _mb_transform_8x8 (GtkToggleButton *button,
243 X264_Gui_Config *config;
245 config = (X264_Gui_Config *)user_data;
247 if (!gtk_toggle_button_get_active (button)) {
248 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.inter_search_8), FALSE);