# Architecture dependant stuff
ifeq ($(SYS),MINGW)
-datadir=.
+datadir="$(HOMEDRIVE)/Documents\ and\ Settings/$(USERNAME)/Application\ Data"
X264GTK_O = x264gtk.o
TEST_OBJECTS+=$(X264GTK_O)
LDFLAGS+=-mwindows
$(TEST_BIN): $(OBJECTS_LIB) $(OBJECTS_TEST)
@echo " B: $(@F)"
#Needs iconv/intl
- @$(CC) -o $(TEST_BIN) $(OBJECTS_LIB) $(OBJECTS_TEST) $(LDFLAGS) $(ICONV_LIB) -lintl
+ @$(CC) -o $(TEST_BIN) $(OBJECTS_LIB) $(OBJECTS_TEST) $(LDFLAGS) $(ICONV_LIB)
# Program : x264_gtk_encode
$(ENCODE_BIN): x264_icon.h libx264gtk.a $(SONAMEGTK) $(OBJECTS_ENCODE) $(EXTERNAL_DEPS) $(X264GTK_O)
# Clean rule
clean:
- @rm -f *.o *.mo x264_gtk.pot $(TEST_BIN) $(ENCODE_BIN) libx264gtk.a x264_icon.h x264gtk.o
+ @rm -f *.o *.mo x264_gtk.pot $(TEST_BIN) $(ENCODE_BIN) libx264gtk.a $(SONAMEGTK) x264_icon.h
# Distclean rule
distclean:
@rm -f config.mak $(X264GTK_PC)
# Install rule
-install: x264_gtk_encode
+install: $(ENCODE_BIN)
+ @echo " D: $(DESTDIR)$(includedir)"
+ @install -d "$(DESTDIR)$(includedir)"
@echo " I: $(DESTDIR)$(includedir)/x264_gtk.h"
@install -m 644 x264_gtk.h "$(DESTDIR)$(includedir)"
@echo " I: $(DESTDIR)$(includedir)/x264_gtk_enum.h"
@install -m 644 x264_gtk_enum.h "$(DESTDIR)$(includedir)"
+ @echo " D: $(DESTDIR)$(libdir)"
+ @install -d "$(DESTDIR)$(libdir)"
@echo " I: $(DESTDIR)$(libdir)/libx264gtk.a"
@install -m 644 libx264gtk.a "$(DESTDIR)$(libdir)"
@echo " I: $(DESTDIR)$(libdir)/libx264gtk.so"
@$(if $(SONAMEGTK), ln -sf $(SONAMEGTK) $(DESTDIR)$(libdir)/libx264gtk.so)
@$(if $(SONAMEGTK), install -m 755 $(SONAMEGTK) $(DESTDIR)$(libdir))
- @echo " I: $(DESTDIR)$(bindir)/x264_gtk_encode"
- @install x264_gtk_encode "$(DESTDIR)$(bindir)"
- @echo " D: ${prefix}/share/x264"
- @install -d "$(DESTDIR)${prefix}/share/x264"
- @echo " I: ${prefix}/share/x264.png"
- @install -m 644 x264.png "$(DESTDIR)${prefix}/share/x264"
+ @echo " D: $(DESTDIR)$(bindir)"
+ @install -d "$(DESTDIR)$(bindir)"
+ @echo " I: $(DESTDIR)$(bindir)/$(ENCODE_BIN)"
+ @install $(ENCODE_BIN) "$(DESTDIR)$(bindir)"
+ @echo " D: $(DESTDIR)${datadir}/x264"
+ @install -d "$(DESTDIR)${datadir}/x264"
+ @echo " I: $(DESTDIR)${datadir}/x264/x264.png"
+ @install -m 644 x264.png "$(DESTDIR)${datadir}/x264"
@for L in $(ALL_LINGUAS); do \
echo " D: $(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES"; \
install -d "$(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES"; \
echo " I: $(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES/x264_gtk.mo"; \
install -m 644 $$L.mo "$(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES/x264_gtk.mo"; \
done
- @echo " I: ${libdir}/pkgconfig/$(X264GTK_PC)"
+ @echo " D: $(DESTDIR)${libdir}/pkgconfig"
+ @install -d "$(DESTDIR)${libdir}/pkgconfig"
+ @echo " I: $(DESTDIR)${libdir}/pkgconfig/$(X264GTK_PC)"
@install -m 644 $(X264GTK_PC) "$(DESTDIR)${libdir}/pkgconfig"
# Uninstall rule
@echo " U: $(DESTDIR)$(libdir)/libx264gtk.so"
@$(if $(SONAMEGTK), rm -f "$(DESTDIR)$(libdir)/$(SONAMEGTK)")
@rm -f "$(DESTDIR)$(libdir)/libx264gtk.so"
- @echo " U: $(DESTDIR)$(bindir)/x264_gtk_encode"
- @rm -f "$(DESTDIR)$(bindir)/x264_gtk_encode"
- @echo " U: $(DESTDIR)${prefix}/share/x264"
- @rm -rf "$(DESTDIR)${prefix}/share/x264"
+ @echo " U: $(DESTDIR)$(bindir)/$(ENCODE_BIN)"
+ @rm -f "$(DESTDIR)$(bindir)/$(ENCODE_BIN)"
+ @echo " U: $(DESTDIR)${datadir}/x264"
+ @rm -rf "$(DESTDIR)${datadir}/x264"
@for L in $(ALL_LINGUAS); do \
echo " U: $(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES/x264_gtk.mo"; \
rm -f "$(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES/x264_gtk.mo"; \
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2006-06-22 16:00+0200\n"
+"POT-Creation-Date: 2006-09-28 10:28+0200\n"
"PO-Revision-Date: 2006-06-14 13:27+0200\n"
"Last-Translator: Kurosu <kurosu@free.fr>\n"
"Language-Team: N/A\n"
msgid "Auto"
msgstr "Automatique"
-#: x264_gtk_bitrate.c:168
+#: x264_gtk_bitrate.c:161
msgid "Average bitrate"
msgstr "Débit moyen"
msgid "Bidirectional ME - description"
msgstr "Estimation de mouvement bidirectionnel"
-#: x264_gtk_rc.c:30 x264_gtk.c:238
+#: x264_gtk_rc.c:30 x264_gtk.c:264
msgid "Bitrate"
msgstr "Débit"
msgid "Debug"
msgstr "Déboguage"
-#: x264_gtk.c:217
+#: x264_gtk.c:243
msgid "Default"
msgstr "Par défaut"
msgid "Encoding status"
msgstr "Situation dans le codage"
-#: x264_gtk_bitrate.c:68
+#: x264_gtk_bitrate.c:61
msgid "Encoding type"
msgstr "Type de codage"
-#: x264_gtk_bitrate.c:62
+#: x264_gtk_bitrate.c:55
#, fuzzy
msgid "Encoding type - description"
msgstr "Type de codage"
msgid "Keyframe boost - description"
msgstr "Bonus image clé (%)"
-#: x264_gtk.c:176
+#: x264_gtk.c:202
#, c-format
msgid "Loading configuration from %s\n"
msgstr "Chargement de la configuration à partir de %s\n"
-#: x264_gtk.c:168
+#: x264_gtk.c:194
msgid "Loading default configuration\n"
msgstr "Chargement de la configuration par défaut\n"
msgid "Log level - description"
msgstr ""
-#: x264_gtk.c:252
+#: x264_gtk.c:278
msgid "MB & Frames"
msgstr "MB et image"
-#: x264_gtk_bitrate.c:48
+#: x264_gtk_bitrate.c:41
msgid "Main settings"
msgstr "Réglages principaux"
msgid "Mixed Refs - description"
msgstr ""
-#: x264_gtk.c:259
+#: x264_gtk.c:285
msgid "More..."
msgstr "Plus..."
msgid "Motion Estimation"
msgstr "Estimation de mouvement"
-#: x264_gtk_bitrate.c:79
+#: x264_gtk_bitrate.c:72
msgid "Multipass - First Pass"
msgstr "Plusieurs passes - première"
-#: x264_gtk_bitrate.c:81
+#: x264_gtk_bitrate.c:74
msgid "Multipass - First Pass (fast)"
msgstr "Plusieurs - première (rapide)"
-#: x264_gtk_bitrate.c:83
+#: x264_gtk_bitrate.c:76
msgid "Multipass - Nth Pass"
msgstr "Plusieurs - passe N"
msgid "Quantization limits"
msgstr "Limite de quantification"
-#: x264_gtk.c:266
+#: x264_gtk.c:292
msgid "Quantization matrices"
msgstr "Matrices"
-#: x264_gtk_bitrate.c:101 x264_gtk_bitrate.c:177
+#: x264_gtk_bitrate.c:94 x264_gtk_bitrate.c:171
msgid "Quantizer"
msgstr "Pas de quantification"
-#: x264_gtk_bitrate.c:95
+#: x264_gtk_bitrate.c:88
msgid "Quantizer - description"
msgstr ""
msgid "Range - description"
msgstr ""
-#: x264_gtk.c:245
+#: x264_gtk.c:271
msgid "Rate Control"
msgstr "Contrôle de débit"
msgid "Select a path"
msgstr "Choisir un répertoire"
-#: x264_gtk_bitrate.c:75
+#: x264_gtk_bitrate.c:68
msgid "Single Pass - Bitrate"
msgstr "Passe unique - débit"
-#: x264_gtk_bitrate.c:77
+#: x264_gtk_bitrate.c:70
msgid "Single Pass - Quantizer"
msgstr "Passe unique - Quantificateur"
msgid "Spatial"
msgstr "Spatiale"
-#: x264_gtk_bitrate.c:120
+#: x264_gtk_bitrate.c:113
msgid "Statistic file"
msgstr "Fichier de statistiques"
-#: x264_gtk_bitrate.c:142
+#: x264_gtk_bitrate.c:135
#, fuzzy
msgid "Statistic file name"
msgstr "Fichier de statistiques"
msgid "Strength - description"
msgstr ""
-#: x264_gtk_bitrate.c:186 x264_gtk_bitrate.c:195
+#: x264_gtk_bitrate.c:182 x264_gtk_bitrate.c:192
msgid "Target bitrate"
msgstr "Débit visé"
msgid "Uneven Multi-Hexagon"
msgstr "Recherche par hexagones inégaux"
-#: x264_gtk_bitrate.c:131
+#: x264_gtk_bitrate.c:124
#, fuzzy
msgid "Update statistic file"
msgstr "Mettre à jour le fichier"
-#: x264_gtk_bitrate.c:133
+#: x264_gtk_bitrate.c:126
#, fuzzy
msgid "Update statistic file - description"
msgstr "Mettre à jour le fichier"
msgid "Width:"
msgstr "Largeur:"
-#: x264_gtk.c:342
+#: x264_gtk.c:368
#, c-format
msgid "Writing configuration to %s\n"
msgstr "Ecriture de la configuration dans %s\n"
-#: x264_gtk.c:212
+#: x264_gtk.c:238
msgid "X264 Configuration"
msgstr "Configuration de X264"
msgid "need to increase buffer size (size=%d)\n"
msgstr "doit accroître la taille de mémoire tampon (taille=%d)\n"
-#: x264_gtk.c:801
+#: x264_gtk.c:842
msgid "problem...\n"
msgstr "Problème...\n"
-#: x264_gtk.c:167
+#: x264_gtk.c:193
#, c-format
msgid "x264.cfg: %s\n"
msgstr ""
#define CHECK_FLAG(a,flag) ((a) & (flag)) == (flag)
#define round(a) ( ((a)<0.0) ? (gint)(floor((a) - 0.5)) : (gint)(floor((a) + 0.5)) )
+#define X264_MAX(a,b) ( (a)>(b) ? (a) : (b) )
+#define X264_MIN(a,b) ( (a)<(b) ? (a) : (b) )
/* Callbacks */
static void _dialog_run (GtkDialog *dialog,
x264_param_default (param);
- /* bitrate */
- if (x264_gtk->pass == X264_PASS_SINGLE_BITRATE)
- param->rc.i_bitrate = x264_gtk->average_bitrate;
- else
- param->rc.i_bitrate = x264_gtk->target_bitrate;
- param->rc.i_qp_constant = x264_gtk->quantizer;
-
- /* FIXME: what to do about psz_stat_out ? */
-
/* rate control */
param->rc.f_ip_factor = 1.0 + (double)x264_gtk->keyframe_boost / 100.0;
param->rc.f_pb_factor = 1.0 + (double)x264_gtk->bframes_reduction / 100.0;
memcpy( param->cqm_8iy, x264_gtk->cqm_8iy, 64 );
memcpy( param->cqm_8py, x264_gtk->cqm_8py, 64 );
+ /* bitrate */
+ switch (x264_gtk->pass) {
+ case X264_PASS_SINGLE_BITRATE:
+ param->rc.i_rc_method = X264_RC_ABR;
+ param->rc.i_bitrate = x264_gtk->average_bitrate;
+ break;
+ case X264_PASS_SINGLE_QUANTIZER:
+ param->rc.i_rc_method = X264_RC_CQP;
+ param->rc.i_qp_constant = x264_gtk->quantizer;
+ break;
+ case X264_PASS_MULTIPASS_1ST_FAST:
+ param->analyse.i_subpel_refine = X264_MAX( X264_MIN( 3, param->analyse.i_subpel_refine - 1 ), 1 );
+ param->i_frame_reference = ( param->i_frame_reference + 1 ) >> 1;
+ param->analyse.inter &= ( ~X264_ANALYSE_PSUB8x8 );
+ param->analyse.inter &= ( ~X264_ANALYSE_BSUB16x16 );
+ case X264_PASS_MULTIPASS_1ST:
+ param->rc.i_rc_method = X264_RC_ABR;
+ param->rc.i_bitrate = x264_gtk->average_bitrate;
+ param->rc.f_rate_tolerance = 4.0;
+ break;
+ case X264_PASS_MULTIPASS_NTH:
+ param->rc.i_rc_method = X264_RC_ABR;
+ param->rc.i_bitrate = x264_gtk->average_bitrate;
+ param->rc.f_rate_tolerance = 1.0;
+ break;
+ }
+
+ param->rc.b_stat_write = x264_gtk->stat_write;
+ param->rc.b_stat_read = x264_gtk->stat_read;
+
+ /* FIXME: potential mem leak... */
+ param->rc.psz_stat_out = x264_gtk_path (x264_gtk->statsfile_name);
+
return param;
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->bitrate.update_statfile), FALSE);
gtk_entry_set_text (GTK_ENTRY (config->bitrate.statsfile_name), "x264.stats");
gtk_widget_set_sensitive (config->bitrate.statsfile_name, FALSE);
+ gtk_widget_set_sensitive (config->bitrate.update_statfile, FALSE);
/* rate control */
g_snprintf (buf, 64, "%d", round((param.rc.f_ip_factor - 1.0) * 100));
_default_set (X264_Gtk *x264_gtk)
{
x264_param_t param;
- gchar *text;
x264_param_default (¶m);
x264_gtk->average_bitrate = param.rc.i_bitrate;
x264_gtk->target_bitrate = param.rc.i_bitrate;
x264_gtk->quantizer = param.rc.i_qp_constant;
+ x264_gtk->stat_write = param.rc.b_stat_write;
+ x264_gtk->stat_read = param.rc.b_stat_read;
x264_gtk->update_statfile = 0;
- text = "x264.stats";
- memcpy (x264_gtk->statsfile_name, text, strlen (text) + 1);
+ x264_gtk->statsfile_length = strlen (param.rc.psz_stat_out);
+ memcpy (x264_gtk->statsfile_name, param.rc.psz_stat_out, x264_gtk->statsfile_length + 1);
/* rate control */
x264_gtk->keyframe_boost = round((param.rc.f_ip_factor - 1.0) * 100);
x264_gtk->threshold = param.i_deblocking_filter_beta;
x264_gtk->debug_method = param.i_log_level + 1;
- text = "H264";
- memcpy (x264_gtk->fourcc, text, strlen (text) + 1);
+ memcpy (x264_gtk->fourcc, "H264", 5);
/* cqm */
x264_gtk->cqm_preset = param.i_cqm_preset;
gtk_range_set_value (GTK_RANGE (config->bitrate.w_quantizer), x264_gtk->quantizer);
g_snprintf (buf, 5, "%d", x264_gtk->target_bitrate);
gtk_entry_set_text (GTK_ENTRY (config->bitrate.w_target_bitrate), buf);
+ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (config->bitrate.pass)))
+ {
+ case 0:
+ case 1:
+ gtk_widget_set_sensitive (config->bitrate.update_statfile, FALSE);
+ gtk_widget_set_sensitive (config->bitrate.statsfile_name, FALSE);
+ break;
+ case 2:
+ case 3:
+ case 4:
+ default:
+ gtk_widget_set_sensitive (config->bitrate.update_statfile, TRUE);
+ break;
+ }
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->bitrate.update_statfile), x264_gtk->update_statfile);
gtk_entry_set_text (GTK_ENTRY (config->bitrate.statsfile_name), x264_gtk->statsfile_name);
if (x264_gtk->update_statfile)
x264_gtk->pass = X264_PASS_SINGLE_BITRATE;
text = gtk_entry_get_text (GTK_ENTRY (gconfig->bitrate.w_average_bitrate));
x264_gtk->average_bitrate = (gint)g_ascii_strtoull (text, NULL, 10);
+ x264_gtk->stat_write = 0;
+ x264_gtk->stat_read = 0;
break;
case 1:
x264_gtk->pass = X264_PASS_SINGLE_QUANTIZER;
x264_gtk->quantizer = (gint)gtk_range_get_value (GTK_RANGE (gconfig->bitrate.w_quantizer));
+ x264_gtk->stat_write = 0;
+ x264_gtk->stat_read = 0;
break;
case 2:
x264_gtk->pass = X264_PASS_MULTIPASS_1ST;
text = gtk_entry_get_text (GTK_ENTRY (gconfig->bitrate.w_target_bitrate));
x264_gtk->target_bitrate = (gint)g_ascii_strtoull (text, NULL, 10);
+ x264_gtk->stat_write = 1;
break;
case 3:
x264_gtk->pass = X264_PASS_MULTIPASS_1ST_FAST;
text = gtk_entry_get_text (GTK_ENTRY (gconfig->bitrate.w_target_bitrate));
x264_gtk->target_bitrate = (gint)g_ascii_strtoull (text, NULL, 10);
+ x264_gtk->stat_write = 1;
break;
case 4:
default:
x264_gtk->pass = X264_PASS_MULTIPASS_NTH;
text = gtk_entry_get_text (GTK_ENTRY (gconfig->bitrate.w_target_bitrate));
x264_gtk->target_bitrate = (gint)g_ascii_strtoull (text, NULL, 10);
+ x264_gtk->stat_read = 1;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile)))
+ x264_gtk->stat_write = 1;
break;
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile)))
x264_gtk->update_statfile = 0;
text = gtk_entry_get_text (GTK_ENTRY (gconfig->bitrate.statsfile_name));
+ x264_gtk->statsfile_length = strlen (text);
memcpy (x264_gtk->statsfile_name,
text,
- strlen(text) + 1);
+ x264_gtk->statsfile_length + 1);
/* rate control */
text = gtk_entry_get_text (GTK_ENTRY (gconfig->rate_control.bitrate.keyframe_boost));
gint target_bitrate;
gint quantizer;
gint desired_size;
- gint statfile_length; /* length of the filename (as returned by strlen) */
+ gint statsfile_length; /* length of the filename (as returned by strlen) */
gchar statsfile_name[4095+1];
/* rc */
guint8 cqm_8py[64];
/* bitrate */
+ guint stat_write : 1;
+ guint stat_read : 1;
guint update_statfile : 1;
/* mb - partitions */
guint transform_8x8 : 1;
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
-#ifdef _WIN32
- gchar *png;
- png = x264_gtk_path("x264.png");
- image = gtk_image_new_from_file (png);
- g_free(png);
-#else
image = gtk_image_new_from_file (X264_DATA_DIR "/x264/x264.png");
-#endif
gtk_box_pack_start (GTK_BOX (vbox), image, FALSE, TRUE, 6);
gtk_widget_show (image);
gtk_widget_show (gconfig->bitrate.w_average_bitrate);
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile), FALSE);
+ gtk_widget_set_sensitive (gconfig->bitrate.update_statfile, FALSE);
break;
case X264_PASS_SINGLE_QUANTIZER:
gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), _("Quantizer"));
gtk_widget_hide (gconfig->bitrate.w_target_bitrate);
gtk_widget_show (gconfig->bitrate.w_quantizer);
}
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile), FALSE);
+ gtk_widget_set_sensitive (gconfig->bitrate.update_statfile, FALSE);
break;
case X264_PASS_MULTIPASS_1ST:
case X264_PASS_MULTIPASS_1ST_FAST:
gtk_widget_hide (gconfig->bitrate.w_average_bitrate);
gtk_widget_show (gconfig->bitrate.w_target_bitrate);
}
+ gtk_widget_set_sensitive (gconfig->bitrate.update_statfile, TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile), TRUE);
break;
case X264_PASS_MULTIPASS_NTH:
gtk_widget_hide (gconfig->bitrate.w_average_bitrate);
gtk_widget_show (gconfig->bitrate.w_target_bitrate);
}
+ gtk_widget_set_sensitive (gconfig->bitrate.update_statfile, TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile), TRUE);
break;
}
}
sizeof (X264_Pipe_Data),
&size, NULL);
if (status != G_IO_STATUS_NORMAL) {
- g_print (_("Error ! %d %d %d\n"), status, sizeof (X264_Pipe_Data), size);
+ g_print (_("Error ! %d %d %d\n"), status, (int)sizeof (X264_Pipe_Data), (int)size);
}
else {
/* we force the GIOChannel to write to the pipeline */
sizeof (X264_Pipe_Data),
&size, NULL);
if (status != G_IO_STATUS_NORMAL) {
- g_print (_("Error ! %d %d %d\n"), status, sizeof (X264_Pipe_Data), size);
+ g_print (_("Error ! %d %d %d\n"), status, (int)sizeof (X264_Pipe_Data), (int)size);
return FALSE;
}