3 #include "x264_gtk_i18n.h"
4 #include "x264_gtk_private.h"
8 static void _more_deblocking_filter (GtkToggleButton *button,
10 static void _more_cabac (GtkToggleButton *button,
12 static void _more_mixed_ref (GtkToggleButton *button,
17 _more_page (X264_Gui_Config *config)
31 GtkTooltips *tooltips;
33 tooltips = gtk_tooltips_new ();
35 label = gtk_entry_new_with_max_length (3);
36 gtk_widget_size_request (label, &size);
37 gtk_widget_destroy (GTK_WIDGET (label));
39 label = gtk_check_button_new_with_label (_("Deblocking Filter"));
40 gtk_widget_size_request (label, &size2);
41 gtk_widget_destroy (GTK_WIDGET (label));
43 label = gtk_label_new (_("Partition decision"));
44 gtk_widget_size_request (label, &size3);
45 gtk_widget_destroy (GTK_WIDGET (label));
47 label = gtk_label_new (_("Threshold"));
48 gtk_widget_size_request (label, &size5);
49 gtk_widget_destroy (GTK_WIDGET (label));
51 vbox = gtk_vbox_new (FALSE, 0);
52 gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
54 /* Motion Estimation */
55 frame = gtk_frame_new (_("Motion Estimation"));
56 gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6);
57 gtk_widget_show (frame);
59 table = gtk_table_new (5, 3, TRUE);
60 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
61 gtk_table_set_col_spacings (GTK_TABLE (table), 6);
62 gtk_container_set_border_width (GTK_CONTAINER (table), 6);
63 gtk_container_add (GTK_CONTAINER (frame), table);
64 gtk_widget_show (table);
66 eb = gtk_event_box_new ();
67 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
68 gtk_tooltips_set_tip (tooltips, eb,
69 _("Partition decision - description"),
71 gtk_table_attach_defaults (GTK_TABLE (table), eb,
75 label = gtk_label_new (_("Partition decision"));
76 gtk_widget_set_size_request (label, size2.width, size3.height);
77 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
78 gtk_container_add (GTK_CONTAINER (eb), label);
79 gtk_widget_show (label);
81 config->more.motion_estimation.partition_decision = gtk_combo_box_new_text ();
82 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
84 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
86 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
88 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
90 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
91 _("5 (High quality)"));
92 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
94 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision),
95 _("6b (RDO on B frames)"));
96 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.partition_decision,
98 gtk_widget_show (config->more.motion_estimation.partition_decision);
100 eb = gtk_event_box_new ();
101 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
102 gtk_tooltips_set_tip (tooltips, eb,
103 _("Method - description"),
105 gtk_table_attach_defaults (GTK_TABLE (table), eb,
107 gtk_widget_show (eb);
109 label = gtk_label_new (_("Method"));
110 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
111 gtk_container_add (GTK_CONTAINER (eb), label);
112 gtk_widget_show (label);
114 config->more.motion_estimation.method = gtk_combo_box_new_text ();
115 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method),
116 _("Diamond Search"));
117 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method),
118 _("Hexagonal Search"));
119 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method),
120 _("Uneven Multi-Hexagon"));
121 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method),
122 _("Exhaustive search"));
123 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.method,
125 gtk_widget_show (config->more.motion_estimation.method);
127 eb = gtk_event_box_new ();
128 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
129 gtk_tooltips_set_tip (tooltips, eb,
130 _("Range - description"),
132 gtk_table_attach_defaults (GTK_TABLE (table), eb,
134 gtk_widget_show (eb);
136 label = gtk_label_new (_("Range"));
137 gtk_widget_size_request (label, &size4);
138 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
139 gtk_container_add (GTK_CONTAINER (eb), label);
140 gtk_widget_show (label);
142 config->more.motion_estimation.range = gtk_entry_new_with_max_length (3);
143 gtk_widget_set_size_request (config->more.motion_estimation.range,
145 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.range,
147 gtk_widget_show (config->more.motion_estimation.range);
149 config->more.motion_estimation.chroma_me = gtk_check_button_new_with_label (_("Chroma ME"));
150 gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.chroma_me,
151 _("Chroma ME - description"),
153 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.chroma_me,
155 gtk_widget_show (config->more.motion_estimation.chroma_me);
157 eb = gtk_event_box_new ();
158 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
159 gtk_tooltips_set_tip (tooltips, eb,
160 _("Max Ref. frames - description"),
162 gtk_table_attach_defaults (GTK_TABLE (table), eb,
164 gtk_widget_show (eb);
166 label = gtk_label_new (_("Max Ref. frames"));
167 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
168 gtk_container_add (GTK_CONTAINER (eb), label);
169 gtk_widget_show (label);
171 config->more.motion_estimation.max_ref_frames = gtk_entry_new_with_max_length (3);
172 gtk_widget_set_size_request (config->more.motion_estimation.max_ref_frames,
174 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.max_ref_frames,
176 gtk_widget_show (config->more.motion_estimation.max_ref_frames);
178 config->more.motion_estimation.mixed_refs = gtk_check_button_new_with_label (_("Mixed Refs"));
179 gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.mixed_refs,
180 _("Mixed Refs - description"),
182 g_signal_connect (G_OBJECT (config->more.motion_estimation.mixed_refs),
184 G_CALLBACK (_more_mixed_ref), config);
185 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.mixed_refs,
187 gtk_widget_show (config->more.motion_estimation.mixed_refs);
189 config->more.motion_estimation.fast_pskip = gtk_check_button_new_with_label (_("Fast P skip"));
190 gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.fast_pskip,
191 _("Fast P skip - description"),
193 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.fast_pskip,
195 gtk_widget_show (config->more.motion_estimation.fast_pskip);
197 config->more.motion_estimation.dct_decimate = gtk_check_button_new_with_label (_("DCT decimate"));
198 gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.dct_decimate,
199 _("DCT decimate - description"),
201 gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.dct_decimate,
203 gtk_widget_show (config->more.motion_estimation.dct_decimate);
206 frame = gtk_frame_new (_("Misc. Options"));
207 gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6);
208 gtk_widget_show (frame);
210 table = gtk_table_new (5, 4, FALSE);
211 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
212 gtk_table_set_col_spacings (GTK_TABLE (table), 6);
213 gtk_container_set_border_width (GTK_CONTAINER (table), 6);
214 gtk_container_add (GTK_CONTAINER (frame), table);
215 gtk_widget_show (table);
217 eb = gtk_event_box_new ();
218 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
219 gtk_tooltips_set_tip (tooltips, eb,
220 _("Sample Aspect Ratio - description"),
222 gtk_table_attach_defaults (GTK_TABLE (table), eb,
224 gtk_widget_show (eb);
226 label = gtk_label_new (_("Sample Aspect Ratio"));
227 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
228 gtk_container_add (GTK_CONTAINER (eb), label);
229 gtk_widget_show (label);
231 hbox = gtk_hbox_new (TRUE, 6);
232 gtk_table_attach_defaults (GTK_TABLE (table), hbox,
234 gtk_widget_show (hbox);
236 config->more.misc.sample_ar_x = gtk_entry_new_with_max_length (3);
237 gtk_widget_set_size_request (config->more.misc.sample_ar_x, 25, size.height);
238 gtk_box_pack_start (GTK_BOX (hbox), config->more.misc.sample_ar_x, FALSE, TRUE, 0);
239 gtk_widget_show (config->more.misc.sample_ar_x);
241 config->more.misc.sample_ar_y = gtk_entry_new_with_max_length (3);
242 gtk_widget_set_size_request (config->more.misc.sample_ar_y, 25, size.height);
243 gtk_box_pack_start (GTK_BOX (hbox), config->more.misc.sample_ar_y, FALSE, TRUE, 0);
244 gtk_widget_show (config->more.misc.sample_ar_y);
246 eb = gtk_event_box_new ();
247 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
248 gtk_tooltips_set_tip (tooltips, eb,
249 _("Threads - description"),
251 gtk_table_attach_defaults (GTK_TABLE (table), eb,
253 gtk_widget_show (eb);
255 label = gtk_label_new (_("Threads"));
256 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
257 gtk_container_add (GTK_CONTAINER (eb), label);
258 gtk_widget_show (label);
260 adj = gtk_adjustment_new (1.0, 1.0, 4.0, 1.0, 1.0, 1.0);
261 config->more.misc.threads = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1.0, 0);
263 gtk_widget_set_size_request (config->more.misc.threads, size5.width, size.height);
264 gtk_table_attach_defaults (GTK_TABLE (table),
265 config->more.misc.threads,
267 gtk_widget_show (config->more.misc.threads);
269 config->more.misc.cabac = gtk_check_button_new_with_label (_("CABAC"));
270 gtk_widget_set_size_request (config->more.misc.cabac, size5.width, size.height);
271 gtk_tooltips_set_tip (tooltips, config->more.misc.cabac,
272 _("CABAC - description"),
274 g_signal_connect (G_OBJECT (config->more.misc.cabac),
276 G_CALLBACK (_more_cabac), config);
277 gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.cabac,
279 gtk_widget_show (config->more.misc.cabac);
281 eb = gtk_event_box_new ();
282 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
283 gtk_tooltips_set_tip (tooltips, eb,
284 _("Trellis - description"),
286 gtk_table_attach_defaults (GTK_TABLE (table), eb,
288 gtk_widget_show (eb);
290 label = gtk_label_new (_("Trellis"));
291 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
292 gtk_container_add (GTK_CONTAINER (eb), label);
293 gtk_widget_show (label);
295 config->more.misc.trellis = gtk_combo_box_new_text ();
296 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.misc.trellis),
298 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.misc.trellis),
299 _("Enabled (once)"));
300 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.misc.trellis),
301 _("Enabled (mode decision)"));
302 gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.trellis,
304 gtk_widget_show (config->more.misc.trellis);
306 eb = gtk_event_box_new ();
307 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
308 gtk_tooltips_set_tip (tooltips, eb,
309 _("Noise reduction - description"),
311 gtk_table_attach_defaults (GTK_TABLE (table), eb,
313 gtk_widget_show (eb);
315 label = gtk_label_new (_("Noise reduction"));
316 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
317 gtk_container_add (GTK_CONTAINER (eb), label);
318 gtk_widget_show (label);
320 config->more.misc.noise_reduction = gtk_entry_new_with_max_length (3);
321 gtk_widget_set_size_request (config->more.misc.noise_reduction, size5.width, size.height);
322 gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.noise_reduction,
324 gtk_widget_show (config->more.misc.noise_reduction);
326 config->more.misc.df.deblocking_filter = gtk_check_button_new_with_label (_("Deblocking Filter"));
327 gtk_tooltips_set_tip (tooltips, config->more.misc.df.deblocking_filter,
328 _("Deblocking Filter - description"),
330 g_signal_connect (G_OBJECT (config->more.misc.df.deblocking_filter),
332 G_CALLBACK (_more_deblocking_filter), config);
333 gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.df.deblocking_filter,
335 gtk_widget_show (config->more.misc.df.deblocking_filter);
337 eb = gtk_event_box_new ();
338 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
339 gtk_tooltips_set_tip (tooltips, eb,
340 _("Strength - description"),
342 gtk_table_attach_defaults (GTK_TABLE (table), eb,
344 gtk_widget_show (eb);
346 label = gtk_label_new (_("Strength"));
347 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
348 gtk_widget_set_size_request (label, size5.width, size4.height);
349 gtk_container_add (GTK_CONTAINER (eb), label);
350 gtk_widget_show (label);
352 config->more.misc.df.strength = gtk_hscale_new_with_range (-6.0, 6.0, 1.0);
353 gtk_widget_size_request (config->more.misc.df.strength, &size4);
354 gtk_scale_set_digits (GTK_SCALE (config->more.misc.df.strength), 0);
355 gtk_scale_set_value_pos (GTK_SCALE (config->more.misc.df.strength), GTK_POS_RIGHT);
356 // gtk_widget_set_size_request (config->more.misc.df.strength, size5.width, size4.height);
357 gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.df.strength,
359 gtk_widget_show (config->more.misc.df.strength);
361 eb = gtk_event_box_new ();
362 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
363 gtk_tooltips_set_tip (tooltips, eb,
364 _("Threshold - description"),
366 gtk_table_attach_defaults (GTK_TABLE (table), eb,
368 gtk_widget_show (eb);
370 label = gtk_label_new (_("Threshold"));
371 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
372 gtk_widget_set_size_request (label, size5.width, size4.height);
373 gtk_container_add (GTK_CONTAINER (eb), label);
374 gtk_widget_show (label);
376 config->more.misc.df.threshold = gtk_hscale_new_with_range (-6.0, 6.0, 1.0);
377 gtk_scale_set_digits (GTK_SCALE (config->more.misc.df.threshold), 0);
378 gtk_scale_set_value_pos (GTK_SCALE (config->more.misc.df.threshold), GTK_POS_RIGHT);
379 gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.df.threshold,
381 gtk_widget_show (config->more.misc.df.threshold);
384 frame = gtk_frame_new (_("Debug"));
385 gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6);
386 gtk_widget_show (frame);
388 table = gtk_table_new (2, 2, TRUE);
389 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
390 gtk_container_set_border_width (GTK_CONTAINER (table), 6);
391 gtk_container_add (GTK_CONTAINER (frame), table);
392 gtk_widget_show (table);
394 eb = gtk_event_box_new ();
395 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
396 gtk_tooltips_set_tip (tooltips, eb,
397 _("Log level - description"),
399 gtk_table_attach_defaults (GTK_TABLE (table), eb,
401 gtk_widget_show (eb);
403 label = gtk_label_new (_("Log level"));
404 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
405 gtk_container_add (GTK_CONTAINER (eb), label);
406 gtk_widget_show (label);
408 config->more.debug.log_level = gtk_combo_box_new_text ();
409 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level),
411 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level),
413 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level),
415 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level),
417 gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level),
419 gtk_table_attach_defaults (GTK_TABLE (table), config->more.debug.log_level,
421 gtk_widget_show (config->more.debug.log_level);
423 eb = gtk_event_box_new ();
424 gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE);
425 gtk_tooltips_set_tip (tooltips, eb,
426 _("FourCC - description"),
428 gtk_table_attach_defaults (GTK_TABLE (table), eb,
430 gtk_widget_show (eb);
432 label = gtk_label_new ("FourCC");
433 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
434 gtk_container_add (GTK_CONTAINER (eb), label);
435 gtk_widget_show (label);
437 config->more.debug.fourcc = gtk_entry_new_with_max_length (4);
438 gtk_table_attach_defaults (GTK_TABLE (table),
439 config->more.debug.fourcc,
441 gtk_widget_set_sensitive (config->more.debug.fourcc, FALSE);
442 gtk_widget_show (config->more.debug.fourcc);
451 _more_deblocking_filter (GtkToggleButton *button,
454 X264_Gui_Config *config;
456 config = (X264_Gui_Config *)user_data;
458 if (gtk_toggle_button_get_active (button)) {
459 gtk_widget_set_sensitive (config->more.misc.df.strength, TRUE);
460 gtk_widget_set_sensitive (config->more.misc.df.threshold, TRUE);
463 gtk_widget_set_sensitive (config->more.misc.df.strength, FALSE);
464 gtk_widget_set_sensitive (config->more.misc.df.threshold, FALSE);
469 _more_cabac (GtkToggleButton *button,
472 X264_Gui_Config *config;
474 config = (X264_Gui_Config *)user_data;
476 if (gtk_toggle_button_get_active (button))
477 gtk_widget_set_sensitive (config->more.misc.trellis, TRUE);
479 gtk_widget_set_sensitive (config->more.misc.trellis, FALSE);
483 _more_mixed_ref (GtkToggleButton *button,
486 X264_Gui_Config *config;
488 config = (X264_Gui_Config *)user_data;
490 if (gtk_toggle_button_get_active (button)) {
494 text = gtk_entry_get_text (GTK_ENTRY (config->more.motion_estimation.max_ref_frames));
495 val = (gint)g_ascii_strtoull (text, NULL, 10);
497 gtk_entry_set_text (GTK_ENTRY (config->more.motion_estimation.max_ref_frames), "2");