From 360853117fccdd082a6654c34c2c7dc2577f10cd Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Mon, 12 Jun 2006 08:22:09 +0000 Subject: [PATCH] GTK update. patch by Vincent Torri. added: direct=auto no-fast-pskip vbv cqm tooltips (without descriptions yet) translations `make clean` for .exe when file exists, ask for override fixes: debug level bug bitrate slider bug mixed-refs can be set only if ref>1 i8x8 can be set only if 8x8 transform is enabled # of threads capped at 4 fourcc can't be removed cosmetics git-svn-id: svn://svn.videolan.org/x264/trunk@532 df754926-b1dd-0310-bc7b-ec298dee348c --- gtk/Makefile | 152 +++-- gtk/fr.po | 895 ++++++++++++++++++++++++++++ gtk/test.c | 17 +- gtk/x264_gtk.c | 425 +++++++++---- gtk/x264_gtk.h | 29 +- gtk/x264_gtk_bitrate.c | 81 ++- gtk/x264_gtk_cqm.c | 471 +++++++++++++++ gtk/x264_gtk_cqm.h | 8 + gtk/x264_gtk_encode.c | 11 + gtk/x264_gtk_encode_encode.c | 31 +- gtk/x264_gtk_encode_main_window.c | 142 +++-- gtk/x264_gtk_encode_status_window.c | 41 +- gtk/x264_gtk_enum.h | 31 +- gtk/x264_gtk_i18n.h | 24 + gtk/x264_gtk_mb.c | 208 +++++-- gtk/x264_gtk_more.c | 276 +++++++-- gtk/x264_gtk_private.h | 37 +- gtk/x264_gtk_rc.c | 215 +++++-- 18 files changed, 2658 insertions(+), 436 deletions(-) create mode 100644 gtk/fr.po create mode 100644 gtk/x264_gtk_cqm.c create mode 100644 gtk/x264_gtk_cqm.h create mode 100644 gtk/x264_gtk_i18n.h diff --git a/gtk/Makefile b/gtk/Makefile index bb405f31..e064af5f 100644 --- a/gtk/Makefile +++ b/gtk/Makefile @@ -1,89 +1,159 @@ include config.mak -OBJECTS = x264_gtk_bitrate.o x264_gtk_rc.o x264_gtk_mb.o x264_gtk_more.o x264_gtk.o -EXTERNAL_DEPS= ../muxers.o ../matroska.o ../libx264.a - -TEST_OBJECT = test.o -ENCODE_OBJECT = x264_gtk_encode_encode.o x264_gtk_encode_status_window.o x264_gtk_encode_main_window.o x264_gtk_encode.o +# Architecture dependant stuff ifeq ($(SYS),MINGW) datadir=. -OBJECTS+=x264gtk.o +TEST_OBJECTS+=x264gtk.o LDFLAGS+=-mwindows +XGETTEXT=xgettext.exe +X264GTK_O = x264gtk.o +ICONV_LIB = -liconv +TEST_BIN = test.exe +ENCODE_BIN = x264_gtk_encode.exe else -datadir=${prefix}/share/x264 +datadir=${prefix}/share +XGETTEXT=xgettext +X264GTK_O = +ICONV_LIB = +TEST_BIN = test +ENCODE_BIN = x264_gtk_encode endif -all: x264_gtk_encode test -CPPFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0 x264` -DX264_DATA_DIR=\"${datadir}\" +# PO / MO files +PO_FILES = $(shell ls *.po) +MO_FILES = $(PO_FILES:%.po=%.mo) +ALL_LINGUAS = $(PO_FILES:%.po=%) + +# Object files +OBJECTS_LIB = \ +x264_gtk_bitrate.o \ +x264_gtk_cqm.o \ +x264_gtk_mb.o \ +x264_gtk_more.o \ +x264_gtk_rc.o \ +x264_gtk.o + +OBJECTS_TEST = test.o + +OBJECTS_ENCODE = \ +x264_gtk_encode_encode.o \ +x264_gtk_encode_main_window.o \ +x264_gtk_encode_status_window.o \ +x264_gtk_encode.o + +OBJECTS_ALL = $(OBJECTS_LIB) $(OBJECTS_TEST) $(OBJECTS_ENCODE) +SOURCES_ALL = $(OBJECTS_ALL:%.o=%.c) + +EXTERNAL_DEPS= ../muxers.o ../matroska.o ../libx264.a + + +all: $(ENCODE_BIN) $(TEST_BIN) $(MO_FILES) + +# Already provides iconv/intl +CPPFLAGS = -g `pkg-config --cflags gtk+-2.0 gthread-2.0` -I.. -DX264_DATA_DIR=\"${datadir}\" LDFLAGS += `pkg-config --libs gtk+-2.0 gthread-2.0 x264` + +# gettext rules +x264_gtk.pot: $(SOURCES_ALL) + @echo " T: x264_gtk.pot" + @$(XGETTEXT) -o x264_gtk.pot -k'_' -s --from-code iso-8859-1 \ + --default-domain=x264_gtk $(SOURCES_ALL) + +%.mo: %.po x264_gtk.pot + @echo " T: $@" + @msgmerge --update $< x264_gtk.pot + @msgfmt -o $@ $< + + # Compilation rule %.o : %.c @echo " C: $(@D)/$( x264_icon.h + # Linking rule -libx264gtk.a: $(OBJECTS) +libx264gtk.a: $(OBJECTS_LIB) @echo " L: $(@F)" - @ar rc libx264gtk.a $(OBJECTS) + @ar rc libx264gtk.a $(OBJECTS_LIB) @ranlib libx264gtk.a -test: $(OBJECTS) $(TEST_OBJECT) +# Program : test +$(TEST_BIN): $(OBJECTS_LIB) $(OBJECTS_TEST) @echo " B: $(@F)" - @$(CC) -o test $(OBJECTS) $(TEST_OBJECT) $(LDFLAGS) +#Needs iconv/intl + @$(CC) -o $(TEST_BIN) $(OBJECTS_LIB) $(OBJECTS_TEST) $(LDFLAGS) $(ICONV_LIB) -lintl -x264_gtk_encode: $(OBJECTS) x264_icon.h libx264gtk.a $(ENCODE_OBJECT) $(EXTERNAL_DEPS) +# Program : x264_gtk_encode +$(ENCODE_BIN): $(OBJECTS_LIB) x264_icon.h libx264gtk.a $(OBJECTS_ENCODE) $(EXTERNAL_DEPS) $(X264GTK_O) @echo " B: $(@F)" - @$(CC) -o x264_gtk_encode $(OBJECTS) $(ENCODE_OBJECT) $(EXTERNAL_DEPS) $(LDFLAGS) + @$(CC) -o $(ENCODE_BIN) $(OBJECTS_LIB) $(OBJECTS_ENCODE) $(EXTERNAL_DEPS) $(LDFLAGS) $(X264GTK_O) # Clean rule clean: - @rm -f *.o test x264_gtk_encode libx264gtk.a x264_icon.h + @rm -f *.o *.mo x264_gtk.pot $(TEST_BIN) $(ENCODE_BIN) libx264gtk.a x264_icon.h x264gtk.o # Install rule install: x264_gtk_encode @echo " I: $(DESTDIR)$(includedir)/x264_gtk.h" - @install -m 644 x264_gtk.h $(DESTDIR)$(includedir) + @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) + @install -m 644 x264_gtk_enum.h "$(DESTDIR)$(includedir)" @echo " I: $(DESTDIR)$(libdir)/libx264gtk.a" - @install -m 644 libx264gtk.a $(DESTDIR)$(libdir) + @install -m 644 libx264gtk.a "$(DESTDIR)$(libdir)" @echo " I: $(DESTDIR)$(bindir)/x264_gtk_encode" - @install x264_gtk_encode $(DESTDIR)$(bindir) - @echo " D: $(DESTDIR)$(datadir)" - @install -d $(DESTDIR)$(datadir) - @echo " I: $(DESTDIR)$(datadir)/x264.png" - @install -m 644 x264.png $(DESTDIR)$(datadir) + @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" + @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 # Uninstall rule uninstall: @echo " U: $(DESTDIR)$(includedir)/x264_gtk.h" - @rm -f $(DESTDIR)$(includedir)/x264_gtk.h + @rm -f "$(DESTDIR)$(includedir)/x264_gtk.h" @echo " U: $(DESTDIR)$(includedir)/x264_gtk_enum.h" - @rm -f $(DESTDIR)$(includedir)/x264_gtk_enum.h + @rm -f "$(DESTDIR)$(includedir)/x264_gtk_enum.h" @echo " U: $(DESTDIR)$(libdir)/libx264gtk.a" - @rm -f $(DESTDIR)$(libdir)/libx264gtk.a + @rm -f "$(DESTDIR)$(libdir)/libx264gtk.a" @echo " U: $(DESTDIR)$(bindir)/x264_gtk_encode" - @rm -f $(DESTDIR)$(bindir)/x264_gtk_encode - @echo " U: $(DESTDIR)$(datadir)" - @rm -rf $(DESTDIR)$(datadir) - -x264gtk.o: x264_gtk.h x264gtk.rc x264.ico x264_gtk_bitrate.h x264_gtk_bitrate.o x264_gtk_rc.h x264_gtk_rc.o x264_gtk_mb.h x264_gtk_mb.o x264_gtk_more.h x264_gtk_more.o -x264_gtk_bitrate.o: x264_gtk_private.h x264_gtk_enum.h x264_gtk_bitrate.c -x264_gtk_rc.o: x264_gtk_private.h x264_gtk_rc.c -x264_gtk_mb.o: x264_gtk_private.h x264_gtk_mb.c -x264_gtk_more.o: x264_gtk_private.h x264_gtk_more.c -x264_gtk_encode_encode.o: x264_gtk_encode_private.h x264_gtk_encode_encode.c -x264_gtk_encode_status_window.o: x264_gtk_encode_private.h x264_gtk_encode_status_window.c -x264_gtk_encode_main_window.o: x264_gtk_encode_private.h x264_gtk_encode_encode.o x264_gtk_encode_status_window.o x264_gtk.o x264_gtk_encode_main_window.c -x264_gtk_encode.o: x264_gtk_encode_main_window.o x264_gtk_encode.c -test.o: x264_gtk.o test.c + @rm -f "$(DESTDIR)$(bindir)/x264_gtk_encode" + @echo " U: $(DESTDIR)${prefix}/share/x264" + @rm -rf "$(DESTDIR)${prefix}/share/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"; \ + done + + +x264_gtk.o: x264_gtk.h x264gtk.rc x264.ico x264_gtk_bitrate.h x264_gtk_bitrate.o x264_gtk_rc.h x264_gtk_rc.o x264_gtk_mb.h x264_gtk_mb.o x264_gtk_more.h x264_gtk_more.o x264_gtk_cqm.h x264_gtk_cqm.o x264_gtk_i18n.h +x264_gtk_bitrate.o: x264_gtk_private.h x264_gtk_enum.h x264_gtk_bitrate.c x264_gtk_i18n.h +x264_gtk_rc.o: x264_gtk_private.h x264_gtk_rc.c x264_gtk_i18n.h +x264_gtk_mb.o: x264_gtk_private.h x264_gtk_mb.c x264_gtk_i18n.h +x264_gtk_more.o: x264_gtk_private.h x264_gtk_more.c x264_gtk_i18n.h +x264_gtk_cqm.o: x264_gtk_private.h x264_gtk_cqm.c x264_gtk_i18n.h +x264_gtk_encode_encode.o: x264_gtk_encode_private.h x264_gtk_encode_encode.c x264_gtk_i18n.h +x264_gtk_encode_status_window.o: x264_gtk_encode_private.h x264_gtk_encode_status_window.c x264_gtk_demuxers.h x264_gtk_i18n.h +x264_gtk_encode_main_window.o: x264_gtk_encode_private.h x264_gtk_encode_encode.o x264_gtk_encode_status_window.o x264_gtk.o x264_gtk_encode_main_window.c x264_gtk_demuxers.h x264_gtk_i18n.h +x264_gtk_encode.o: x264_gtk_encode_main_window.o x264_gtk_encode.c x264_gtk_i18n.h +test.o: x264_gtk.o test.c x264_gtk_i18n.h diff --git a/gtk/fr.po b/gtk/fr.po new file mode 100644 index 00000000..e86218eb --- /dev/null +++ b/gtk/fr.po @@ -0,0 +1,895 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-06-12 01:09-0700\n" +"PO-Revision-Date: 2006-03-30 00:37+0200\n" +"Last-Translator: Kurosu \n" +"Language-Team: N/A\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: test.c:47 +#, c-format +msgid "" +"\n" +"Different from default values\n" +msgstr "" +"\n" +"Diffère des valeurs par défaut\n" + +#: test.c:45 +#, c-format +msgid "" +"\n" +"Same result !\n" +msgstr "" +"\n" +"Même résultat!\n" + +#: x264_gtk_encode_main_window.c:729 +#, c-format +msgid "%.2fKB/s (%.2f fps)" +msgstr "%.2fKo/s (%.2f fps)" + +#: x264_gtk_encode_main_window.c:723 +#, c-format +msgid "%dKB" +msgstr "%dKo" + +#: x264_gtk_encode_status_window.c:73 +msgid "0KB" +msgstr "0Ko" + +#: x264_gtk_more.c:83 +msgid "1 (Fastest)" +msgstr "1 (la plus rapide)" + +#: x264_gtk_cqm.c:166 +#, fuzzy +msgid "4x4 I chroma quant. matrices" +msgstr "Matrices" + +#: x264_gtk_cqm.c:146 +#, fuzzy +msgid "4x4 I luma quant. matrices" +msgstr "Matrices" + +#: x264_gtk_mb.c:83 +msgid "4x4 Intra search" +msgstr "Recherche 4x4 Intra" + +#: x264_gtk_mb.c:85 +#, fuzzy +msgid "4x4 Intra search - description" +msgstr "Recherche 4x4 Intra" + +#: x264_gtk_cqm.c:206 +#, fuzzy +msgid "4x4 P chroma quant. matrix" +msgstr "Matrices" + +#: x264_gtk_cqm.c:186 +#, fuzzy +msgid "4x4 P luma quant. matrix" +msgstr "Matrices" + +#: x264_gtk_cqm.c:104 +#, fuzzy +msgid "4x4 quant. matrices" +msgstr "Matrices" + +#: x264_gtk_mb.c:66 +msgid "4x8, 8x4 and 4x4 P-frame search" +msgstr "Recherche 4x8, 8x4 and 4x4 dans les images P" + +#: x264_gtk_mb.c:68 +#, fuzzy +msgid "4x8, 8x4 and 4x4 P-frame search - description" +msgstr "Recherche 4x8, 8x4 and 4x4 dans les images P" + +#: x264_gtk_more.c:91 +msgid "5 (High quality)" +msgstr "5 (Haute qualité)" + +#: x264_gtk_more.c:93 +msgid "6 (RDO)" +msgstr "6 (optimisation R/D)" + +#: x264_gtk_more.c:95 +msgid "6b (RDO on B frames)" +msgstr "6b (optimisation R/D sur les images B)" + +#: x264_gtk_mb.c:59 +msgid "8x16, 16x8 and 8x8 B-frame search" +msgstr "Recherche 8x16, 16x8 et 8x8 dans les images B" + +#: x264_gtk_mb.c:61 +#, fuzzy +msgid "8x16, 16x8 and 8x8 B-frame search - description" +msgstr "Recherche 8x16, 16x8 et 8x8 dans les images B" + +#: x264_gtk_mb.c:52 +msgid "8x16, 16x8 and 8x8 P-frame search" +msgstr "Recherche 8x16, 16x8 et 8x8 dans les images P" + +#: x264_gtk_mb.c:54 +#, fuzzy +msgid "8x16, 16x8 and 8x8 P-frame search - description" +msgstr "Recherche 8x16, 16x8 et 8x8 dans les images P" + +#: x264_gtk_cqm.c:111 +#, fuzzy +msgid "8x8 I luma quant. matrices" +msgstr "Matrices" + +#: x264_gtk_mb.c:73 +msgid "8x8 Intra search" +msgstr "Recherche 8x8 Intra" + +#: x264_gtk_mb.c:75 +#, fuzzy +msgid "8x8 Intra search - description" +msgstr "Recherche 8x8 Intra" + +#: x264_gtk_cqm.c:118 +#, fuzzy +msgid "8x8 P luma quant. matrices" +msgstr "Matrices" + +#: x264_gtk_mb.c:42 +msgid "8x8 Transform" +msgstr "Transformée 8x8" + +#: x264_gtk_mb.c:44 +#, fuzzy +msgid "8x8 Transform - description" +msgstr "Transformée 8x8" + +#: x264_gtk_mb.c:160 +msgid "Adaptive" +msgstr "Adaptatif" + +#: x264_gtk_mb.c:162 +msgid "Adaptive - description" +msgstr "" + +#: x264_gtk_encode_main_window.c:155 +msgid "All supported" +msgstr "Tous supportés" + +#: x264_gtk_mb.c:198 +msgid "Auto" +msgstr "Automatique" + +#: x264_gtk_bitrate.c:168 +msgid "Average bitrate" +msgstr "Débit moyen" + +#: x264_gtk_encode_main_window.c:197 +msgid "Avisynth Script" +msgstr "Script Avisynth" + +#: x264_gtk_mb.c:91 +msgid "B-Frames" +msgstr "Images B" + +#: x264_gtk_rc.c:73 +msgid "B-frames reduction (%)" +msgstr "Malus B-frames" + +#: x264_gtk_rc.c:67 +#, fuzzy +msgid "B-frames reduction - description" +msgstr "Malus B-frames" + +#: x264_gtk_mb.c:129 +msgid "Bias" +msgstr "Biais" + +#: x264_gtk_mb.c:123 +msgid "Bias - description" +msgstr "" + +#: x264_gtk_mb.c:152 +msgid "Bidirectional ME" +msgstr "EM bidirectionnel" + +#: x264_gtk_mb.c:154 +#, fuzzy +msgid "Bidirectional ME - description" +msgstr "Estimation de mouvement bidirectionnel" + +#: x264_gtk_rc.c:30 x264_gtk.c:236 +msgid "Bitrate" +msgstr "Débit" + +#: x264_gtk_rc.c:93 +msgid "Bitrate variability (%)" +msgstr "Variabilié du débit (%)" + +#: x264_gtk_rc.c:87 +#, fuzzy +msgid "Bitrate variability - description" +msgstr "Variabilié du débit (%)" + +#: x264_gtk_more.c:261 +msgid "CABAC" +msgstr "CABAC" + +#: x264_gtk_more.c:264 +msgid "CABAC - description" +msgstr "" + +#: x264_gtk_encode_main_window.c:78 +#, c-format +msgid "Can't stat file\n" +msgstr "Ne peut accéder au fichier\n" + +#: x264_gtk_more.c:149 +msgid "Chroma ME" +msgstr "EM sur la chroma" + +#: x264_gtk_more.c:151 +msgid "Chroma ME - description" +msgstr "" + +#: x264_gtk_encode_main_window.c:115 +msgid "Configure" +msgstr "Configurer" + +#: x264_gtk_encode_main_window.c:297 +msgid "Container:" +msgstr "Conteneur:" + +#: x264_gtk_encode_status_window.c:56 +msgid "Current video frame:" +msgstr "Image actuelle:" + +#: x264_gtk_cqm.c:74 +msgid "Custom matrix" +msgstr "Matrice personnalisée" + +#: x264_gtk_cqm.c:76 +#, fuzzy +msgid "Custom matrix - description" +msgstr "Matrice personnalisée" + +#: x264_gtk_more.c:39 x264_gtk_more.c:318 +msgid "Deblocking Filter" +msgstr "Filtre de lissage" + +#: x264_gtk_more.c:320 +#, fuzzy +msgid "Deblocking Filter - description" +msgstr "Filtre de lissage" + +#: x264_gtk_more.c:376 x264_gtk_more.c:410 +msgid "Debug" +msgstr "Déboguage" + +#: x264_gtk.c:215 +msgid "Default" +msgstr "Par défaut" + +#: x264_gtk_more.c:116 +msgid "Diamond Search" +msgstr "Recherche en diamant" + +#: x264_gtk_mb.c:185 +msgid "Direct mode" +msgstr "Mode direct" + +#: x264_gtk_mb.c:179 +#, fuzzy +msgid "Direct mode - description" +msgstr "Mode direct" + +#: x264_gtk_more.c:289 +msgid "Disabled" +msgstr "Désactivé" + +#: x264_gtk_encode_main_window.c:614 +msgid "Do you want to overwrite file\n" +msgstr "" + +#: x264_gtk_more.c:293 +msgid "Enabled (mode decision)" +msgstr "Activé (décision de mode)" + +#: x264_gtk_more.c:291 +msgid "Enabled (once)" +msgstr "Activé" + +#: x264_gtk_encode_status_window.c:32 +msgid "Encoding status" +msgstr "Situation dans le codage" + +#: x264_gtk_bitrate.c:68 +msgid "Encoding type" +msgstr "Type de codage" + +#: x264_gtk_bitrate.c:62 +#, fuzzy +msgid "Encoding type - description" +msgstr "Type de codage" + +#: x264_gtk_more.c:404 +msgid "Error" +msgstr "Erreurs" + +#: x264_gtk_encode_encode.c:150 +#, c-format +msgid "Error ! %d\n" +msgstr "Erreur ! %d\n" + +#: x264_gtk_encode_encode.c:143 x264_gtk_encode_main_window.c:715 +#, c-format +msgid "Error ! %d %d %d\n" +msgstr "Erreur ! %d %d %d\n" + +#: x264_gtk_encode_main_window.c:550 +msgid "Error: input file name is not set" +msgstr "Erreur: pas de nom pour le fichier d'entrée" + +#: x264_gtk_encode_main_window.c:564 +msgid "Error: output file name is not set" +msgstr "Erreur: pas de nom pour le fichier de sortie" + +#: x264_gtk_encode_encode.c:68 +msgid "Error: unknown input file type" +msgstr "Erreur: type inconnu de fichier en entrée" + +#: x264_gtk_encode_encode.c:67 +msgid "Error: unknown output file type" +msgstr "Erreur: type inconnu de fichier en sortie" + +#: x264_gtk_more.c:122 +msgid "Exhaustive search" +msgstr "Recherche exhaustive" + +#: x264_gtk_encode_main_window.c:600 +#, fuzzy +msgid "Existing file" +msgstr "Fichier de statistiques" + +#: x264_gtk_more.c:189 +msgid "Fast P skip" +msgstr "Skip pour P rapide" + +#: x264_gtk_more.c:191 +#, fuzzy +msgid "Fast P skip - description" +msgstr "Skip pour P rapide" + +#: x264_gtk_cqm.c:54 +msgid "Flat matrix" +msgstr "Matrice plate" + +#: x264_gtk_cqm.c:56 +#, fuzzy +msgid "Flat matrix - description" +msgstr "Matrice plate" + +#: x264_gtk_more.c:418 +msgid "FourCC - description" +msgstr "" + +#: x264_gtk_encode_main_window.c:254 +msgid "Frame count:" +msgstr "Nombre d'images:" + +#: x264_gtk_encode_main_window.c:244 +msgid "Frame rate den:" +msgstr "Dénominateur du FPS" + +#: x264_gtk_encode_main_window.c:234 +msgid "Frame rate num:" +msgstr "Numérateur du FPS" + +#: x264_gtk_encode_main_window.c:221 +msgid "Height:" +msgstr "Hauteur:" + +#: x264_gtk_more.c:118 +msgid "Hexagonal Search" +msgstr "Recherche en hexagone" + +#: x264_gtk_more.c:408 +msgid "Info" +msgstr "Information" + +#: x264_gtk_rc.c:306 +msgid "Initial VBV buffer occupancy" +msgstr "" + +#: x264_gtk_rc.c:300 +#, fuzzy +msgid "Initial VBV buffer occupancy - description" +msgstr "Recherche 4x4 Intra" + +#: x264_gtk_encode_main_window.c:129 +msgid "Input file" +msgstr "Fichier d'entrée" + +#: x264_gtk_encode_main_window.c:140 +msgid "Input file:" +msgstr "Fichier d'entrée:" + +#: x264_gtk_cqm.c:64 +msgid "JVT matrix" +msgstr "Matrice JVT" + +#: x264_gtk_cqm.c:66 +msgid "JVT matrix - description" +msgstr "" + +#: x264_gtk_rc.c:49 +msgid "Keyframe boost (%)" +msgstr "Bonus image clé (%)" + +#: x264_gtk_rc.c:43 +#, fuzzy +msgid "Keyframe boost - description" +msgstr "Bonus image clé (%)" + +#: x264_gtk.c:174 +#, c-format +msgid "Loading configuration from %s\n" +msgstr "Chargement de la configuration à partir de %s\n" + +#: x264_gtk.c:166 +msgid "Loading default configuration\n" +msgstr "Chargement de la configuration par défaut\n" + +#: x264_gtk_more.c:395 +msgid "Log level" +msgstr "Niveau de trace" + +#: x264_gtk_more.c:389 +msgid "Log level - description" +msgstr "" + +#: x264_gtk.c:250 +msgid "MB & Frames" +msgstr "MB et image" + +#: x264_gtk_bitrate.c:48 +msgid "Main settings" +msgstr "Réglages principaux" + +#: x264_gtk_rc.c:235 +msgid "Max IDR-frame interval" +msgstr "Distance max entre images IDR" + +#: x264_gtk_rc.c:229 +#, fuzzy +msgid "Max IDR-frame interval - description" +msgstr "Distance max entre images IDR" + +#: x264_gtk_rc.c:144 +msgid "Max QP" +msgstr "QP max" + +#: x264_gtk_rc.c:138 +msgid "Max QP - description" +msgstr "" + +#: x264_gtk_rc.c:164 +msgid "Max QP Step" +msgstr "Pas max pour QP" + +#: x264_gtk_rc.c:158 +#, fuzzy +msgid "Max QP Step - description" +msgstr "Pas max pour QP" + +#: x264_gtk_more.c:166 +msgid "Max Ref. frames" +msgstr "Max images de Ref." + +#: x264_gtk_more.c:160 +#, fuzzy +msgid "Max Ref. frames - description" +msgstr "Max images de Ref." + +#: x264_gtk_mb.c:110 +msgid "Max consecutive" +msgstr "Consécutives maximal" + +#: x264_gtk_mb.c:104 +#, fuzzy +msgid "Max consecutive - description" +msgstr "Consécutives maximal" + +#: x264_gtk_rc.c:266 +msgid "Max local bitrate" +msgstr "" + +#: x264_gtk_rc.c:260 +#, fuzzy +msgid "Max local bitrate - description" +msgstr "Pas max pour QP" + +#: x264_gtk_more.c:109 +msgid "Method" +msgstr "Méthode" + +#: x264_gtk_more.c:103 +msgid "Method - description" +msgstr "" + +#: x264_gtk_rc.c:215 +msgid "Min IDR-frame interval" +msgstr "Distance min entre images IDR" + +#: x264_gtk_rc.c:209 +#, fuzzy +msgid "Min IDR-frame interval - description" +msgstr "Distance min entre images IDR" + +#: x264_gtk_rc.c:124 +msgid "Min QP" +msgstr "QP min" + +#: x264_gtk_rc.c:118 +msgid "Min QP - description" +msgstr "" + +#: x264_gtk_more.c:198 +msgid "Misc. Options" +msgstr "Options diverses" + +#: x264_gtk_more.c:178 +msgid "Mixed Refs" +msgstr "Réf. mélangées" + +#: x264_gtk_more.c:180 +msgid "Mixed Refs - description" +msgstr "" + +#: x264_gtk.c:257 +msgid "More..." +msgstr "Plus..." + +#: x264_gtk_more.c:55 +msgid "Motion Estimation" +msgstr "Estimation de mouvement" + +#: x264_gtk_bitrate.c:79 +msgid "Multipass - First Pass" +msgstr "Plusieurs passes - première" + +#: x264_gtk_bitrate.c:81 +msgid "Multipass - First Pass (fast)" +msgstr "Plusieurs - première (rapide)" + +#: x264_gtk_bitrate.c:83 +msgid "Multipass - Nth Pass" +msgstr "Plusieurs - passe N" + +#: x264_gtk_more.c:307 +msgid "Noise reduction" +msgstr "Débruitage" + +#: x264_gtk_more.c:301 +#, fuzzy +msgid "Noise reduction - description" +msgstr "Débruitage" + +#: x264_gtk_mb.c:192 x264_gtk_more.c:402 +msgid "None" +msgstr "Aucune" + +#: x264_gtk_encode_main_window.c:265 +msgid "Output file" +msgstr "Fichier de sortie" + +#: x264_gtk_encode_main_window.c:288 +msgid "Output file (without ext.):" +msgstr "Fichier de sortie (sans ext.)" + +#: x264_gtk_encode_main_window.c:276 +msgid "Output path:" +msgstr "Répertoire de sortie" + +#: x264_gtk_more.c:43 x264_gtk_more.c:75 +msgid "Partition decision" +msgstr "Decision de la partition" + +#: x264_gtk_more.c:69 +#, fuzzy +msgid "Partition decision - description" +msgstr "Decision de la partition" + +#: x264_gtk_mb.c:33 +msgid "Partitions" +msgstr "Partitions" + +#: x264_gtk_encode_status_window.c:117 +msgid "Progress:" +msgstr "Progression:" + +#: x264_gtk_rc.c:105 +msgid "Quantization limits" +msgstr "Limite de quantification" + +#: x264_gtk.c:264 +msgid "Quantization matrices" +msgstr "Matrices" + +#: x264_gtk_bitrate.c:101 x264_gtk_bitrate.c:177 +msgid "Quantizer" +msgstr "Pas de quantification" + +#: x264_gtk_bitrate.c:95 +msgid "Quantizer - description" +msgstr "" + +#: x264_gtk_more.c:136 +msgid "Range" +msgstr "Portée" + +#: x264_gtk_more.c:130 +msgid "Range - description" +msgstr "" + +#: x264_gtk.c:243 +msgid "Rate Control" +msgstr "Contrôle de débit" + +#: x264_gtk_more.c:218 +msgid "Sample Aspect Ratio" +msgstr "Ratio d'aspect de pixel" + +#: x264_gtk_more.c:212 +#, fuzzy +msgid "Sample Aspect Ratio - description" +msgstr "Ratio d'aspect de pixel" + +#: x264_gtk_rc.c:195 +msgid "Scene Cut Threshold" +msgstr "Seuil de changement" + +#: x264_gtk_rc.c:189 +#, fuzzy +msgid "Scene Cut Threshold - description" +msgstr "Seuil de changement" + +#: x264_gtk_rc.c:176 +msgid "Scene Cuts" +msgstr "Changements de scène" + +#: x264_gtk_cqm.c:84 x264_gtk_encode_main_window.c:146 +msgid "Select a file" +msgstr "Choisir un fichier" + +#: x264_gtk_encode_main_window.c:281 +msgid "Select a path" +msgstr "Choisir un répertoire" + +#: x264_gtk_bitrate.c:75 +msgid "Single Pass - Bitrate" +msgstr "Passe unique - débit" + +#: x264_gtk_bitrate.c:77 +msgid "Single Pass - Quantizer" +msgstr "Passe unique - Quantificateur" + +#: x264_gtk_mb.c:194 +msgid "Spatial" +msgstr "Spatiale" + +#: x264_gtk_bitrate.c:120 +msgid "Statistic file" +msgstr "Fichier de statistiques" + +#: x264_gtk_bitrate.c:142 +#, fuzzy +msgid "Statistic file name" +msgstr "Fichier de statistiques" + +#: x264_gtk_more.c:338 +msgid "Strength" +msgstr "Force" + +#: x264_gtk_more.c:332 +msgid "Strength - description" +msgstr "" + +#: x264_gtk_bitrate.c:186 x264_gtk_bitrate.c:195 +msgid "Target bitrate" +msgstr "Débit visé" + +#: x264_gtk_mb.c:196 +msgid "Temporal" +msgstr "Temporelle" + +#: x264_gtk_more.c:247 +msgid "Threads" +msgstr "Tâches" + +#: x264_gtk_more.c:241 +msgid "Threads - description" +msgstr "" + +#: x264_gtk_more.c:47 x264_gtk_more.c:362 +msgid "Threshold" +msgstr "Seuil" + +#: x264_gtk_more.c:356 +msgid "Threshold - description" +msgstr "" + +#: x264_gtk_encode_status_window.c:89 +msgid "Time elapsed:" +msgstr "Temps écoulé:" + +#: x264_gtk_encode_status_window.c:99 +msgid "Total time (estimated):" +msgstr "Temps total (estimé):" + +#: x264_gtk_more.c:282 +msgid "Trellis" +msgstr "Treillis" + +#: x264_gtk_more.c:276 +msgid "Trellis - description" +msgstr "" + +#: x264_gtk_more.c:120 +msgid "Uneven Multi-Hexagon" +msgstr "Recherche par hexagones inégaux" + +#: x264_gtk_bitrate.c:131 +#, fuzzy +msgid "Update statistic file" +msgstr "Mettre à jour le fichier" + +#: x264_gtk_bitrate.c:133 +#, fuzzy +msgid "Update statistic file - description" +msgstr "Mettre à jour le fichier" + +#: x264_gtk_mb.c:141 +msgid "Use as references" +msgstr "Utiliser comme références" + +#: x264_gtk_mb.c:143 +#, fuzzy +msgid "Use as references - description" +msgstr "Utiliser comme références" + +#: x264_gtk_rc.c:286 +msgid "VBV buffer size" +msgstr "" + +#: x264_gtk_rc.c:280 +#, fuzzy +msgid "VBV buffer size - description" +msgstr "Skip pour P rapide" + +#: x264_gtk_rc.c:247 +msgid "Video buffer verifier" +msgstr "" + +#: x264_gtk_encode_status_window.c:67 +msgid "Video data:" +msgstr "Données vidéo:" + +#: x264_gtk_encode_status_window.c:78 +msgid "Video rendering rate:" +msgstr "Vitesse de codage vidéo:" + +#: x264_gtk_more.c:406 +msgid "Warning" +msgstr "Avertissements" + +#: x264_gtk_mb.c:168 +msgid "Weighted biprediction" +msgstr "Bi-Prédiction à poids normalisés" + +#: x264_gtk_mb.c:170 +#, fuzzy +msgid "Weighted biprediction - description" +msgstr "Bi-Prédiction à poids normalisés" + +#: x264_gtk_encode_main_window.c:208 +msgid "Width:" +msgstr "Largeur:" + +#: x264_gtk.c:340 +#, c-format +msgid "Writing configuration to %s\n" +msgstr "Ecriture de la configuration dans %s\n" + +#: x264_gtk.c:210 +msgid "X264 Configuration" +msgstr "Configuration de X264" + +#: x264_gtk_encode_main_window.c:99 +msgid "X264 Gtk Encoder" +msgstr "Interface GTK+ pour X264" + +#: x264_gtk_encode_main_window.c:173 +msgid "YUV CIF sequence" +msgstr "Séquence YUV de dimensions CIF" + +#: x264_gtk_encode_main_window.c:179 +msgid "YUV QCIF sequence" +msgstr "Séquence YUV de dimensions QCIF" + +#: x264_gtk_encode_main_window.c:167 +msgid "YUV sequence" +msgstr "Séquence YUV" + +#: x264_gtk_encode_main_window.c:185 +msgid "YUV4MPEG2 sequence" +msgstr "Séquence YUV4MPEG2" + +#: x264_gtk_encode_encode.c:99 +#, c-format +msgid "can't set outfile param\n" +msgstr "ne peut le paramètre du fichier de sortie\n" + +#: x264_gtk_encode_encode.c:75 +#, c-format +msgid "could not open input file '%s'\n" +msgstr "Erreur lors de l'ouverture du fichier d'entrée '%s'\n" + +#: x264_gtk_encode_encode.c:173 +#, c-format +msgid "encoded %d frames, %.2f fps, %.2f kb/s\n" +msgstr "%d images codées, %.2f fps, %.2f kb/s\n" + +#: x264_gtk_encode_encode.c:58 +msgid "encoding...\n" +msgstr "codage...\n" + +#: x264_gtk_encode_main_window.c:587 +#, c-format +msgid "file output : %s\n" +msgstr "fichier de sortie : %s\n" + +#: x264_gtk_encode_encode.c:281 +#, c-format +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:793 +msgid "problem...\n" +msgstr "Problème...\n" + +#: x264_gtk.c:165 +#, c-format +msgid "x264.cfg: %s\n" +msgstr "" + +#: x264_gtk_encode_encode.c:266 +#, c-format +msgid "x264_encoder_encode failed\n" +msgstr "x264_encoder_encode a échoué\n" + +#: x264_gtk_encode_encode.c:89 +#, c-format +msgid "x264_encoder_open failed\n" +msgstr "x264_encoder_open a échoué\n" + +#~ msgid "Statsfile name" +#~ msgstr "Nom du fichier" + +#~ msgid "bitrate %d\n" +#~ msgstr "Débit %d\n" + +#~ msgid "flat\n" +#~ msgstr "plate\n" + +#~ msgid "log level %d\n" +#~ msgstr "Niveau de trace %d\n" diff --git a/gtk/test.c b/gtk/test.c index 1e9da7ca..c0bf6e6d 100644 --- a/gtk/test.c +++ b/gtk/test.c @@ -4,9 +4,12 @@ #include # define DECLARE_ALIGNED( type, var, n ) type var __attribute__((aligned(n))) -#include "../common/common.h" #include "../x264.h" +#include "../common/common.h" + #include "x264_gtk.h" +#include "x264_gtk_private.h" +#include "x264_gtk_i18n.h" int @@ -19,8 +22,10 @@ main (int argc, char *argv[]) char *res; char *res_default; + BIND_X264_TEXTDOMAIN(); + gtk_init (&argc, &argv); - + window = x264_gtk_window_create (NULL); x264_gtk_shutdown (window); @@ -37,17 +42,15 @@ main (int argc, char *argv[]) printf ("\n%s\n", res_default); if (strcmp (res, res_default) == 0) - printf ("\nSame result !\n"); + printf (_("\nSame result !\n")); else - printf ("\nDifferent from default values\n"); + printf (_("\nDifferent from default values\n")); x264_free (res); x264_free (res_default); - g_free (x264_gtk); + x264_gtk_free (x264_gtk); g_free (param); - gtk_main_quit (); - return 1; } diff --git a/gtk/x264_gtk.c b/gtk/x264_gtk.c index 49b94f0e..6e19538c 100644 --- a/gtk/x264_gtk.c +++ b/gtk/x264_gtk.c @@ -9,20 +9,24 @@ # include #endif #ifdef _WIN32 -# include /* for mkdir */ +# define _WIN32_IE 0x400 +# include /* for mkdir */ +# include /* for SHGetSpecialFolderPath */ #endif -#include +#include "../x264.h" #include #include "x264_gtk.h" +#include "x264_gtk_i18n.h" #include "x264_gtk_private.h" #include "x264_gtk_enum.h" #include "x264_gtk_bitrate.h" #include "x264_gtk_rc.h" #include "x264_gtk_mb.h" #include "x264_gtk_more.h" +#include "x264_gtk_cqm.h" #define CHECK_FLAG(a,flag) ((a) & (flag)) == (flag) @@ -78,6 +82,10 @@ x264_param_t *x264_gtk_param_get (X264_Gtk *x264_gtk) param->i_keyint_min = x264_gtk->min_idr_frame_interval; param->i_keyint_max = x264_gtk->max_idr_frame_interval; + param->rc.i_vbv_max_bitrate = x264_gtk->vbv_max_bitrate; + param->rc.i_vbv_buffer_size = x264_gtk->vbv_buffer_size; + param->rc.f_vbv_buffer_init = x264_gtk->vbv_buffer_init; + /* mb */ param->analyse.b_transform_8x8 = x264_gtk->transform_8x8; param->analyse.inter = 0; @@ -92,18 +100,16 @@ x264_param_t *x264_gtk_param_get (X264_Gtk *x264_gtk) if (x264_gtk->inter_search_4) param->analyse.inter |= X264_ANALYSE_I4x4; - param->i_bframe = x264_gtk->use_as_reference; + param->b_bframe_pyramid = x264_gtk->bframe_pyramid && x264_gtk->bframe; param->analyse.b_bidir_me = x264_gtk->bidir_me; - param->b_bframe_adaptive = x264_gtk->adaptive; - if ((x264_gtk->use_as_reference > 1) && x264_gtk->weighted_biprediction) - param->analyse.b_weighted_bipred = 1; - else - param->analyse.b_weighted_bipred = 0; - /* not used: */ - /* x264_gtk->max_consecutive; */ - param->i_bframe_bias = x264_gtk->bias; + param->b_bframe_adaptive = x264_gtk->bframe_adaptive; + param->analyse.b_weighted_bipred = x264_gtk->weighted_bipred; + param->i_bframe = x264_gtk->bframe; + param->i_bframe_bias = x264_gtk->bframe_bias; param->analyse.i_direct_mv_pred = x264_gtk->direct_mode; +/* param->b_bframe_pyramid = param->b_bframe_pyramid && (param->i_bframe > 1); */ + /* more */ param->analyse.i_subpel_refine = x264_gtk->partition_decision + 1; param->analyse.b_bframe_rdo = x264_gtk->bframe_rdo; @@ -114,6 +120,7 @@ x264_param_t *x264_gtk_param_get (X264_Gtk *x264_gtk) param->analyse.i_noise_reduction = x264_gtk->noise_reduction; param->i_frame_reference = x264_gtk->max_ref_frames; param->analyse.b_mixed_references = x264_gtk->mixed_refs; + param->analyse.b_fast_pskip = x264_gtk->fast_pskip; param->vui.i_sar_width = x264_gtk->sample_ar_x; param->vui.i_sar_height = x264_gtk->sample_ar_y; @@ -125,6 +132,17 @@ x264_param_t *x264_gtk_param_get (X264_Gtk *x264_gtk) param->i_log_level = x264_gtk->debug_method - 1; + /* cqm */ + param->i_cqm_preset = x264_gtk->cqm_preset; + if (x264_gtk->cqm_file && (x264_gtk->cqm_file[0] != '\0')) + param->psz_cqm_file = x264_gtk->cqm_file; + memcpy( param->cqm_4iy, x264_gtk->cqm_4iy, 16 ); + memcpy( param->cqm_4ic, x264_gtk->cqm_4ic, 16 ); + memcpy( param->cqm_4py, x264_gtk->cqm_4py, 16 ); + memcpy( param->cqm_4pc, x264_gtk->cqm_4pc, 16 ); + memcpy( param->cqm_8iy, x264_gtk->cqm_8iy, 64 ); + memcpy( param->cqm_8py, x264_gtk->cqm_8py, 64 ); + return param; } @@ -141,34 +159,28 @@ x264_gtk_load (void) if (!x264_gtk) return NULL; - filename = g_build_filename (g_get_home_dir (), - ".x264", - "/x264.cfg", - NULL); + filename = x264_gtk_path ("x264.cfg"); file = g_io_channel_new_file (filename, "r", &error); - if (error) - { - g_print ("x264.cfg: %s\n", error->message); - g_print ("Loading default configuration\n"); - _default_set (x264_gtk); - } - else - { - GIOStatus status; - gchar *data = NULL; - gsize length; - - g_print ("Loading configuration from %s\n", filename); - g_io_channel_set_encoding (file, NULL, NULL); - status = g_io_channel_read_to_end (file, &data, &length, &error); - if ((status == G_IO_STATUS_NORMAL) && - (length == sizeof (X264_Gtk))) - { - memcpy (x264_gtk, data, length); - } - g_io_channel_shutdown (file, TRUE, NULL); - g_io_channel_unref (file); + if (error) { + g_print (_("x264.cfg: %s\n"), error->message); + g_print (_("Loading default configuration\n")); + _default_set (x264_gtk); + } + else { + GIOStatus status; + gchar *data = NULL; + gsize length; + + g_print (_("Loading configuration from %s\n"), filename); + g_io_channel_set_encoding (file, NULL, NULL); + status = g_io_channel_read_to_end (file, &data, &length, &error); + if ((status == G_IO_STATUS_NORMAL) && + (length == sizeof (X264_Gtk))) { + memcpy (x264_gtk, data, length); } + g_io_channel_shutdown (file, TRUE, NULL); + g_io_channel_unref (file); + } g_free (filename); return x264_gtk; @@ -195,12 +207,12 @@ x264_gtk_window_create (GtkWidget *parent) if (parent) flags = GTK_DIALOG_MODAL |GTK_DIALOG_DESTROY_WITH_PARENT; - win_x264_gtk = gtk_dialog_new_with_buttons ("X264 Configuration", + win_x264_gtk = gtk_dialog_new_with_buttons (_("X264 Configuration"), GTK_WINDOW (parent), flags, NULL); - button = gtk_button_new_with_label ("Default"); + button = gtk_button_new_with_label (_("Default")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (win_x264_gtk)->action_area), button, FALSE, TRUE, 6); g_signal_connect (G_OBJECT (button), "clicked", @@ -221,34 +233,41 @@ x264_gtk_window_create (GtkWidget *parent) gtk_container_add (GTK_CONTAINER (GTK_DIALOG (win_x264_gtk)->vbox), notebook); gtk_widget_show (notebook); - label = gtk_label_new ("Bitrate"); + label = gtk_label_new (_("Bitrate")); gtk_widget_show (label); page = _bitrate_page (gconfig); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); - label = gtk_label_new ("Rate Control"); + label = gtk_label_new (_("Rate Control")); gtk_widget_show (label); page = _rate_control_page (gconfig); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); - label = gtk_label_new ("MB & Frames"); + label = gtk_label_new (_("MB & Frames")); gtk_widget_show (label); page = _mb_page (gconfig); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); - label = gtk_label_new ("More..."); + label = gtk_label_new (_("More...")); gtk_widget_show (label); page = _more_page (gconfig); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); + label = gtk_label_new (_("Quantization matrices")); + gtk_widget_show (label); + + page = _cqm_page (gconfig); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + gtk_widget_show (page); + _current_set (gconfig, x264_gtk); result = gtk_dialog_run (GTK_DIALOG (win_x264_gtk)); @@ -268,6 +287,15 @@ x264_gtk_shutdown (GtkWidget *dialog) g_free (gconfig); } +void +x264_gtk_free (X264_Gtk *x264_gtk) +{ + if (!x264_gtk) + return; + + g_free (x264_gtk); +} + /* Notebook pages */ @@ -290,9 +318,8 @@ _dialog_run (GtkDialog *dialog __UNUSED__, mode_t mode; #endif - dir = g_build_filename (g_get_home_dir (), - ".x264", - NULL); + dir = x264_gtk_path (NULL); + #ifdef _WIN32 res = mkdir (dir); #else @@ -308,13 +335,10 @@ _dialog_run (GtkDialog *dialog __UNUSED__, return; } - filename = g_build_filename (g_get_home_dir (), - ".x264", - "x264.cfg", - NULL); - g_print ("Writing configuration to %s\n", filename); - file = g_io_channel_new_file (filename, - "w+", NULL); + + filename = x264_gtk_path ("x264.cfg"); + g_print (_("Writing configuration to %s\n"), filename); + file = g_io_channel_new_file (filename, "w+", NULL); if (file) { _current_get (gconfig, x264_gtk); @@ -332,9 +356,10 @@ _dialog_run (GtkDialog *dialog __UNUSED__, static void _default_load (GtkButton *button __UNUSED__, gpointer user_data) { + gchar buf[64]; X264_Gui_Config *config; x264_param_t param; - gchar buf[64]; + gint i; if (!user_data) return; @@ -345,13 +370,12 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) /* bitrate */ gtk_combo_box_set_active (GTK_COMBO_BOX (config->bitrate.pass), 1); - g_print ("bitrate %d\n", param.rc.i_bitrate); g_snprintf (buf, 64, "%d", param.rc.i_bitrate); gtk_entry_set_text (GTK_ENTRY (config->bitrate.w_average_bitrate), buf); gtk_entry_set_text (GTK_ENTRY (config->bitrate.w_target_bitrate), buf); gtk_range_set_range (GTK_RANGE (config->bitrate.w_quantizer), - (gdouble)param.rc.i_qp_min, - (gdouble)param.rc.i_qp_max); + 0.0, + 51.0); gtk_range_set_value (GTK_RANGE (config->bitrate.w_quantizer), (gdouble)param.rc.i_qp_constant); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->bitrate.update_statfile), FALSE); @@ -380,6 +404,13 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) g_snprintf (buf, 64, "%d", param.i_keyint_max); gtk_entry_set_text (GTK_ENTRY (config->rate_control.scene_cuts.max_idr_frame_interval), buf); + g_snprintf (buf, 64, "%d", param.rc.i_vbv_max_bitrate); + gtk_entry_set_text (GTK_ENTRY (config->rate_control.vbv.vbv_max_bitrate), buf); + g_snprintf (buf, 64, "%d", param.rc.i_vbv_buffer_size); + gtk_entry_set_text (GTK_ENTRY (config->rate_control.vbv.vbv_buffer_size), buf); + g_snprintf (buf, 64, "%.1f", param.rc.f_vbv_buffer_init); + gtk_entry_set_text (GTK_ENTRY (config->rate_control.vbv.vbv_buffer_init), buf); + /* mb */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.transform_8x8), param.analyse.b_transform_8x8); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.pframe_search_8), CHECK_FLAG(param.analyse.inter, X264_ANALYSE_PSUB16x16)); @@ -388,12 +419,13 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.inter_search_8), CHECK_FLAG(param.analyse.inter, X264_ANALYSE_I8x8)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.inter_search_4), CHECK_FLAG(param.analyse.inter, X264_ANALYSE_I4x4)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.use_as_reference), param.i_bframe); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.adaptive), param.b_bframe_adaptive); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.weighted_biprediction), param.analyse.b_weighted_bipred); - g_snprintf (buf, 64, "%d", param.b_bframe_adaptive); - gtk_entry_set_text (GTK_ENTRY (config->mb.bframes.max_consecutive), buf); - gtk_range_set_value (GTK_RANGE (config->mb.bframes.bias), (gdouble)param.i_bframe_bias); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bframe_pyramid), param.b_bframe_pyramid); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bidir_me), param.analyse.b_bidir_me); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bframe_adaptive), param.b_bframe_adaptive); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.weighted_bipred), param.analyse.b_weighted_bipred); + g_snprintf (buf, 64, "%d", param.i_bframe); + gtk_entry_set_text (GTK_ENTRY (config->mb.bframes.bframe), buf); + gtk_range_set_value (GTK_RANGE (config->mb.bframes.bframe_bias), (gdouble)param.i_bframe_bias); gtk_combo_box_set_active (GTK_COMBO_BOX (config->mb.bframes.direct_mode), param.analyse.i_direct_mv_pred); /* more */ @@ -408,13 +440,13 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.mixed_refs), param.analyse.b_mixed_references); g_snprintf (buf, 64, "%d", param.i_frame_reference); gtk_entry_set_text (GTK_ENTRY (config->more.motion_estimation.max_ref_frames), buf); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.fast_pskip), param.analyse.b_fast_pskip); g_snprintf (buf, 64, "%d", param.vui.i_sar_width); gtk_entry_set_text (GTK_ENTRY (config->more.misc.sample_ar_x), buf); g_snprintf (buf, 64, "%d", param.vui.i_sar_height); gtk_entry_set_text (GTK_ENTRY (config->more.misc.sample_ar_y), buf); - g_snprintf (buf, 64, "%d", param.i_threads); - gtk_entry_set_text (GTK_ENTRY (config->more.misc.threads), buf); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (config->more.misc.threads), param.i_threads); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.misc.cabac), param.b_cabac); gtk_combo_box_set_active (GTK_COMBO_BOX (config->more.misc.trellis), param.analyse.i_trellis); g_snprintf (buf, 64, "%d", param.analyse.i_noise_reduction); @@ -423,8 +455,46 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) gtk_range_set_value (GTK_RANGE (config->more.misc.df.strength), (gdouble)param.i_deblocking_filter_alphac0); gtk_range_set_value (GTK_RANGE (config->more.misc.df.threshold), (gdouble)param.i_deblocking_filter_beta); - gtk_combo_box_set_active (GTK_COMBO_BOX (config->more.debug.log_level), 1); + gtk_combo_box_set_active (GTK_COMBO_BOX (config->more.debug.log_level), param.i_log_level + 1); gtk_entry_set_text (GTK_ENTRY (config->more.debug.fourcc), "H264"); + + /* cqm */ + switch (param.i_cqm_preset) { + case X264_CQM_FLAT: + // workaround: gtk fails to update the matrix entries if we activate the button + // that was already active. + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_jvt), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_flat), TRUE); + break; + case X264_CQM_JVT: + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_jvt), TRUE); + break; + case X264_CQM_CUSTOM: + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_custom), TRUE); + break; + } + if (param.psz_cqm_file && (param.psz_cqm_file[0] != '\0')) + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (config->cqm.cqm_file), param.psz_cqm_file); + for (i = 0; i < 16; i++) { + gchar buf[4]; + + g_snprintf (buf, 4, "%d", param.cqm_4iy[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4iy[i]), buf); + g_snprintf (buf, 4, "%d", param.cqm_4ic[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4ic[i]), buf); + g_snprintf (buf, 4, "%d", param.cqm_4py[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4py[i]), buf); + g_snprintf (buf, 4, "%d", param.cqm_4pc[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4pc[i]), buf); + } + for (i = 0; i < 64; i++) { + gchar buf[4]; + + g_snprintf (buf, 4, "%d", param.cqm_8iy[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_8iy[i]), buf); + g_snprintf (buf, 4, "%d", param.cqm_8py[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_8py[i]), buf); + } } static void @@ -456,12 +526,13 @@ _default_set (X264_Gtk *x264_gtk) x264_gtk->scene_cut_threshold = param.i_scenecut_threshold; x264_gtk->min_idr_frame_interval = param.i_keyint_min; x264_gtk->max_idr_frame_interval = param.i_keyint_max; - x264_gtk->direct_mode = param.analyse.i_direct_mv_pred; + + x264_gtk->vbv_max_bitrate = param.rc.i_vbv_max_bitrate; + x264_gtk->vbv_buffer_size = param.rc.i_vbv_buffer_size; + x264_gtk->vbv_buffer_init = param.rc.f_vbv_buffer_init; /* mb */ x264_gtk->transform_8x8 = param.analyse.b_transform_8x8; - x264_gtk->max_ref_frames = param.i_frame_reference; - x264_gtk->mixed_refs = param.analyse.b_mixed_references; if (CHECK_FLAG(param.analyse.inter, X264_ANALYSE_PSUB16x16)) x264_gtk->pframe_search_8 = 1; @@ -478,11 +549,13 @@ _default_set (X264_Gtk *x264_gtk) x264_gtk->inter_search_8 = CHECK_FLAG(param.analyse.inter, X264_ANALYSE_I8x8); x264_gtk->inter_search_4 = CHECK_FLAG(param.analyse.inter, X264_ANALYSE_I4x4); - x264_gtk->use_as_reference = param.i_bframe; - x264_gtk->adaptive = param.b_bframe_adaptive; - x264_gtk->weighted_biprediction = param.analyse.b_weighted_bipred; - x264_gtk->max_consecutive = 0; /* not used */ - x264_gtk->bias = param.i_bframe_bias; + x264_gtk->bframe_pyramid = param.b_bframe_pyramid; + x264_gtk->bidir_me = param.analyse.b_bidir_me; + x264_gtk->bframe_adaptive = param.b_bframe_adaptive; + x264_gtk->weighted_bipred = param.analyse.b_weighted_bipred; + x264_gtk->bframe = param.i_bframe; + x264_gtk->bframe_bias = param.i_bframe_bias; + x264_gtk->direct_mode = param.analyse.i_direct_mv_pred; /* more */ x264_gtk->bframe_rdo = param.analyse.b_bframe_rdo; @@ -490,6 +563,9 @@ _default_set (X264_Gtk *x264_gtk) x264_gtk->me_method = param.analyse.i_me_method; x264_gtk->range = param.analyse.i_me_range; x264_gtk->chroma_me = param.analyse.b_chroma_me; + x264_gtk->max_ref_frames = param.i_frame_reference; + x264_gtk->mixed_refs = param.analyse.b_mixed_references; + x264_gtk->fast_pskip = param.analyse.b_fast_pskip; x264_gtk->sample_ar_x = param.vui.i_sar_width; x264_gtk->sample_ar_y = param.vui.i_sar_height; @@ -501,15 +577,27 @@ _default_set (X264_Gtk *x264_gtk) x264_gtk->strength = param.i_deblocking_filter_alphac0; x264_gtk->threshold = param.i_deblocking_filter_beta; - x264_gtk->debug_method = X264_DEBUG_METHOD_ERROR; + x264_gtk->debug_method = param.i_log_level + 1; text = "H264"; memcpy (x264_gtk->fourcc, text, strlen (text) + 1); + + /* cqm */ + x264_gtk->cqm_preset = param.i_cqm_preset; + if (param.psz_cqm_file && (param.psz_cqm_file[0] != '\0')) + memcpy (x264_gtk->cqm_file, param.psz_cqm_file, strlen (param.psz_cqm_file) + 1); + memcpy (x264_gtk->cqm_4iy, param.cqm_4iy, 16); + memcpy (x264_gtk->cqm_4ic, param.cqm_4ic, 16); + memcpy (x264_gtk->cqm_4py, param.cqm_4py, 16); + memcpy (x264_gtk->cqm_4pc, param.cqm_4pc, 16); + memcpy (x264_gtk->cqm_8iy, param.cqm_8iy, 64); + memcpy (x264_gtk->cqm_8py, param.cqm_8py, 64); } static void _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) { gchar buf[4096]; + gint i; if (!config) return; @@ -518,6 +606,9 @@ _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) gtk_combo_box_set_active (GTK_COMBO_BOX (config->bitrate.pass), x264_gtk->pass); g_snprintf (buf, 5, "%d", x264_gtk->average_bitrate); gtk_entry_set_text (GTK_ENTRY (config->bitrate.w_average_bitrate), buf); + gtk_range_set_range (GTK_RANGE (config->bitrate.w_quantizer), + 0.0, + 51.0); 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); @@ -550,6 +641,13 @@ _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) g_snprintf (buf, 5, "%d", x264_gtk->max_idr_frame_interval); gtk_entry_set_text (GTK_ENTRY (config->rate_control.scene_cuts.max_idr_frame_interval), buf); + g_snprintf (buf, 5, "%d", x264_gtk->vbv_max_bitrate); + gtk_entry_set_text (GTK_ENTRY (config->rate_control.vbv.vbv_max_bitrate), buf); + g_snprintf (buf, 5, "%d", x264_gtk->vbv_buffer_size); + gtk_entry_set_text (GTK_ENTRY (config->rate_control.vbv.vbv_buffer_size), buf); + g_snprintf (buf, 5, "%.1f", x264_gtk->vbv_buffer_init); + gtk_entry_set_text (GTK_ENTRY (config->rate_control.vbv.vbv_buffer_init), buf); + /* mb */ if (x264_gtk->transform_8x8) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.transform_8x8), TRUE); @@ -576,25 +674,26 @@ _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.inter_search_4), FALSE); - if (x264_gtk->use_as_reference) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.use_as_reference), TRUE); + /* mb - bframes */ + if (x264_gtk->bframe_pyramid) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bframe_pyramid), TRUE); else - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.use_as_reference), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bframe_pyramid), FALSE); if (x264_gtk->bidir_me) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bidir_me), TRUE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bidir_me), FALSE); - if (x264_gtk->adaptive) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.adaptive), TRUE); + if (x264_gtk->bframe_adaptive) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bframe_adaptive), TRUE); else - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.adaptive), FALSE); - if (x264_gtk->weighted_biprediction) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.weighted_biprediction), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.bframe_adaptive), FALSE); + if (x264_gtk->weighted_bipred) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.weighted_bipred), TRUE); else - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.weighted_biprediction), FALSE); - g_snprintf (buf, 5, "%d", x264_gtk->max_consecutive); - gtk_entry_set_text (GTK_ENTRY (config->mb.bframes.max_consecutive), buf); - gtk_range_set_value (GTK_RANGE (config->mb.bframes.bias), (gdouble)x264_gtk->bias); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.bframes.weighted_bipred), FALSE); + g_snprintf (buf, 5, "%d", x264_gtk->bframe); + gtk_entry_set_text (GTK_ENTRY (config->mb.bframes.bframe), buf); + gtk_range_set_value (GTK_RANGE (config->mb.bframes.bframe_bias), (gdouble)x264_gtk->bframe_bias); gtk_combo_box_set_active (GTK_COMBO_BOX (config->mb.bframes.direct_mode), x264_gtk->direct_mode); /* more */ @@ -611,17 +710,20 @@ _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.chroma_me), FALSE); g_snprintf (buf, 5, "%d", x264_gtk->max_ref_frames); gtk_entry_set_text (GTK_ENTRY (config->more.motion_estimation.max_ref_frames), buf); - if (x264_gtk->mixed_refs) + if (x264_gtk->mixed_refs && (x264_gtk->max_ref_frames >= 2)) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.mixed_refs), TRUE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.mixed_refs), FALSE); + if (x264_gtk->fast_pskip) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.fast_pskip), TRUE); + else + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.fast_pskip), FALSE); g_snprintf (buf, 5, "%d", x264_gtk->sample_ar_x); gtk_entry_set_text (GTK_ENTRY (config->more.misc.sample_ar_x), buf); g_snprintf (buf, 5, "%d", x264_gtk->sample_ar_y); gtk_entry_set_text (GTK_ENTRY (config->more.misc.sample_ar_y), buf); - g_snprintf (buf, 5, "%d", x264_gtk->threads); - gtk_entry_set_text (GTK_ENTRY (config->more.misc.threads), buf); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (config->more.misc.threads), x264_gtk->threads); if (x264_gtk->cabac) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.misc.cabac), TRUE); else @@ -637,20 +739,58 @@ _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) gtk_range_set_value (GTK_RANGE (config->more.misc.df.threshold), (gdouble)x264_gtk->threshold); gtk_combo_box_set_active (GTK_COMBO_BOX (config->more.debug.log_level), x264_gtk->debug_method); - gtk_entry_set_text (GTK_ENTRY (config->more.debug.fourcc), - x264_gtk->fourcc); + gtk_entry_set_text (GTK_ENTRY (config->more.debug.fourcc), x264_gtk->fourcc); + + /* cqm */ + switch (x264_gtk->cqm_preset) { + case X264_CQM_PRESET_FLAT: + // workaround: gtk fails to update the matrix entries if we activate the button + // that was already active. + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_jvt), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_flat), TRUE); + break; + case X264_CQM_PRESET_JVT: + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_jvt), TRUE); + break; + case X264_CQM_PRESET_CUSTOM: + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->cqm.radio_custom), TRUE); + break; + } + if (x264_gtk->cqm_file && (x264_gtk->cqm_file[0] != '\0')) + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (config->cqm.cqm_file), x264_gtk->cqm_file); + for (i = 0; i < 16; i++) { + gchar buf[4]; + + g_snprintf (buf, 4, "%d", x264_gtk->cqm_4iy[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4iy[i]), buf); + g_snprintf (buf, 4, "%d", x264_gtk->cqm_4ic[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4ic[i]), buf); + g_snprintf (buf, 4, "%d", x264_gtk->cqm_4py[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4py[i]), buf); + g_snprintf (buf, 4, "%d", x264_gtk->cqm_4pc[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_4pc[i]), buf); + } + for (i = 0; i < 64; i++) { + gchar buf[4]; + + g_snprintf (buf, 4, "%d", x264_gtk->cqm_8iy[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_8iy[i]), buf); + g_snprintf (buf, 4, "%d", x264_gtk->cqm_8py[i]); + gtk_entry_set_text (GTK_ENTRY (config->cqm.cqm_8py[i]), buf); + } } static void _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) { const gchar *text; + gint i; if (!gconfig) return; if (!x264_gtk) - g_print ("problem...\n"); + g_print (_("problem...\n")); /* bitrate */ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (gconfig->bitrate.pass))) @@ -714,6 +854,13 @@ _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) text = gtk_entry_get_text (GTK_ENTRY (gconfig->rate_control.scene_cuts.max_idr_frame_interval)); x264_gtk->max_idr_frame_interval = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->rate_control.vbv.vbv_max_bitrate)); + x264_gtk->vbv_max_bitrate = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->rate_control.vbv.vbv_buffer_size)); + x264_gtk->vbv_buffer_size = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->rate_control.vbv.vbv_buffer_init)); + x264_gtk->vbv_buffer_init = (gint)g_ascii_strtoull (text, NULL, 10); + /* mb */ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.partitions.transform_8x8))) x264_gtk->transform_8x8 = 1; @@ -739,25 +886,27 @@ _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) x264_gtk->inter_search_4 = 1; else x264_gtk->inter_search_4 = 0; - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.use_as_reference))) - x264_gtk->use_as_reference = 1; + + /* mb - bframes */ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.bframe_pyramid))) + x264_gtk->bframe_pyramid = 1; else - x264_gtk->use_as_reference = 0; + x264_gtk->bframe_pyramid = 0; if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.bidir_me))) x264_gtk->bidir_me = 1; else x264_gtk->bidir_me = 0; - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.adaptive))) - x264_gtk->adaptive = 1; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.bframe_adaptive))) + x264_gtk->bframe_adaptive = 1; else - x264_gtk->adaptive = 0; - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.weighted_biprediction))) - x264_gtk->weighted_biprediction = 1; + x264_gtk->bframe_adaptive = 0; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->mb.bframes.weighted_bipred))) + x264_gtk->weighted_bipred = 1; else - x264_gtk->weighted_biprediction = 0; - text = gtk_entry_get_text (GTK_ENTRY (gconfig->mb.bframes.max_consecutive)); - x264_gtk->max_consecutive = (gint)g_ascii_strtoull (text, NULL, 10); - x264_gtk->bias = (gint)gtk_range_get_value (GTK_RANGE (gconfig->mb.bframes.bias)); + x264_gtk->weighted_bipred = 0; + text = gtk_entry_get_text (GTK_ENTRY (gconfig->mb.bframes.bframe)); + x264_gtk->bframe = (gint)g_ascii_strtoull (text, NULL, 10); + x264_gtk->bframe_bias = (gint)gtk_range_get_value (GTK_RANGE (gconfig->mb.bframes.bframe_bias)); switch (gtk_combo_box_get_active (GTK_COMBO_BOX (gconfig->mb.bframes.direct_mode))) { @@ -766,9 +915,12 @@ _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) case 1: x264_gtk->direct_mode = X264_SPATIAL; break; - default: + case 2: x264_gtk->direct_mode = X264_TEMPORAL; break; + default: + x264_gtk->direct_mode = X264_AUTO; + break; } /* more */ @@ -820,18 +972,24 @@ _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) x264_gtk->chroma_me = 0; text = gtk_entry_get_text (GTK_ENTRY (gconfig->more.motion_estimation.max_ref_frames)); x264_gtk->max_ref_frames = (gint)g_ascii_strtoull (text, NULL, 10); - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->more.motion_estimation.mixed_refs))) + if (x264_gtk->max_ref_frames <= 0) + x264_gtk->max_ref_frames = 1; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->more.motion_estimation.mixed_refs)) && + (x264_gtk->max_ref_frames >= 2)) x264_gtk->mixed_refs = 1; else x264_gtk->mixed_refs = 0; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->more.motion_estimation.fast_pskip))) + x264_gtk->fast_pskip = 1; + else + x264_gtk->fast_pskip = 0; text = gtk_entry_get_text (GTK_ENTRY (gconfig->more.misc.sample_ar_x)); x264_gtk->sample_ar_x = (gint)g_ascii_strtoull (text, NULL, 10); text = gtk_entry_get_text (GTK_ENTRY (gconfig->more.misc.sample_ar_y)); x264_gtk->sample_ar_y = (gint)g_ascii_strtoull (text, NULL, 10); - text = gtk_entry_get_text (GTK_ENTRY (gconfig->more.misc.threads)); - x264_gtk->threads = (gint)g_ascii_strtoull (text, NULL, 10); + x264_gtk->threads = (gint)gtk_spin_button_get_value (GTK_SPIN_BUTTON (gconfig->more.misc.threads)); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->more.misc.cabac))) x264_gtk->cabac = 1; else @@ -866,4 +1024,53 @@ _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) } text = gtk_entry_get_text (GTK_ENTRY (gconfig->more.debug.fourcc)); memcpy (x264_gtk->fourcc, text, strlen (text) + 1); + + /* cqm */ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->cqm.radio_flat))) + x264_gtk->cqm_preset = X264_CQM_PRESET_FLAT; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->cqm.radio_jvt))) + x264_gtk->cqm_preset = X264_CQM_PRESET_JVT; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->cqm.radio_custom))) + x264_gtk->cqm_preset = X264_CQM_PRESET_CUSTOM; + text = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (gconfig->cqm.cqm_file)); + if (text && (text[0] != '\0')) + memcpy (x264_gtk->cqm_file, text, strlen (text) + 1); + for (i = 0; i < 16; i++) { + text = gtk_entry_get_text (GTK_ENTRY (gconfig->cqm.cqm_4iy[i])); + x264_gtk->cqm_4iy[i] = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->cqm.cqm_4ic[i])); + x264_gtk->cqm_4ic[i] = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->cqm.cqm_4py[i])); + x264_gtk->cqm_4py[i] = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->cqm.cqm_4pc[i])); + x264_gtk->cqm_4pc[i] = (gint)g_ascii_strtoull (text, NULL, 10); + } + for (i = 0; i < 64; i++) { + text = gtk_entry_get_text (GTK_ENTRY (gconfig->cqm.cqm_8iy[i])); + x264_gtk->cqm_8iy[i] = (gint)g_ascii_strtoull (text, NULL, 10); + text = gtk_entry_get_text (GTK_ENTRY (gconfig->cqm.cqm_8py[i])); + x264_gtk->cqm_8py[i] = (gint)g_ascii_strtoull (text, NULL, 10); + } +} + +gchar* +x264_gtk_path(const char* more) +{ +#ifdef _WIN32 + gchar szPath[MAX_PATH]; + + // "Documents and Settings\user" is CSIDL_PROFILE + szPath[0] = 0; + + SHGetSpecialFolderPath(NULL, szPath, CSIDL_APPDATA, FALSE); + if (more) + return g_build_filename(szPath, "x264", more, NULL); + else + return g_build_filename(szPath, "x264", NULL); +#else + if (more) + return g_build_filename (g_get_home_dir (), ".x264", more, NULL); + else + return g_build_filename (g_get_home_dir (), ".x264", NULL); +#endif } diff --git a/gtk/x264_gtk.h b/gtk/x264_gtk.h index cb552d19..ec3bba1a 100644 --- a/gtk/x264_gtk.h +++ b/gtk/x264_gtk.h @@ -4,7 +4,6 @@ #include "x264_gtk_enum.h" - typedef struct X264_Gtk_ X264_Gtk; struct X264_Gtk_ @@ -36,10 +35,14 @@ struct X264_Gtk_ gint min_idr_frame_interval; gint max_idr_frame_interval; + gint vbv_max_bitrate; + gint vbv_buffer_size; + gdouble vbv_buffer_init; + /* mb */ - gint max_consecutive; - gint bias; + gint bframe; /* max consecutive B frames */ + gint bframe_bias; X264_Direct_Mode direct_mode; /* more */ @@ -60,6 +63,16 @@ struct X264_Gtk_ X264_Debug_Method debug_method; gchar fourcc[4+1]; + /* cqm */ + X264_Cqm_Preset cqm_preset; + gchar cqm_file[4095+1]; + guint8 cqm_4iy[16]; + guint8 cqm_4ic[16]; + guint8 cqm_4py[16]; + guint8 cqm_4pc[16]; + guint8 cqm_8iy[64]; + guint8 cqm_8py[64]; + /* bitrate */ guint update_statfile : 1; /* mb - partitions */ @@ -70,14 +83,15 @@ struct X264_Gtk_ guint inter_search_8 : 1; guint inter_search_4 : 1; /* mb - bframes */ - guint use_as_reference : 1; - guint bidir_me : 1; - guint adaptive : 1; - guint weighted_biprediction : 1; + guint bframe_pyramid : 1; /* use as reference */ + guint bidir_me : 1; + guint bframe_adaptive : 1; + guint weighted_bipred : 1; /* more - me */ guint bframe_rdo : 1; guint chroma_me : 1; guint mixed_refs : 1; + guint fast_pskip : 1; /* more - misc */ guint cabac : 1; /* more - misc - df */ @@ -88,6 +102,7 @@ x264_param_t *x264_gtk_param_get (X264_Gtk *x264_gtk); X264_Gtk *x264_gtk_load (void); GtkWidget *x264_gtk_window_create (GtkWidget *parent); void x264_gtk_shutdown (GtkWidget *dialog); +void x264_gtk_free (X264_Gtk *x264_gtk); #endif /* __X264_GTK_H__ */ diff --git a/gtk/x264_gtk_bitrate.c b/gtk/x264_gtk_bitrate.c index 174a9bd3..5a807730 100644 --- a/gtk/x264_gtk_bitrate.c +++ b/gtk/x264_gtk_bitrate.c @@ -7,6 +7,7 @@ #include #include "../x264.h" +#include "x264_gtk_i18n.h" #include "x264_gtk_private.h" #include "x264_gtk_enum.h" @@ -20,20 +21,31 @@ static void _bitrate_statfile (GtkToggleButton *button, GtkWidget * _bitrate_page (X264_Gui_Config *gconfig) { - GtkWidget *vbox; - GtkWidget *frame; - GtkWidget *table; - GtkWidget *image; - GtkWidget *label; + GtkWidget *vbox; + GtkWidget *frame; + GtkWidget *table; + GtkWidget *image; + GtkWidget *eb; + GtkWidget *label; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); - image = gtk_image_new_from_file (X264_DATA_DIR "/x264.png"); +#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); - frame = gtk_frame_new ("Main settings"); + frame = gtk_frame_new (_("Main settings")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -44,23 +56,31 @@ _bitrate_page (X264_Gui_Config *gconfig) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Encoding type"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Encoding type - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Encoding type")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); gconfig->bitrate.pass = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (gconfig->bitrate.pass), - "Single Pass - Bitrate"); + _("Single Pass - Bitrate")); gtk_combo_box_append_text (GTK_COMBO_BOX (gconfig->bitrate.pass), - "Single Pass - Quantizer"); + _("Single Pass - Quantizer")); gtk_combo_box_append_text (GTK_COMBO_BOX (gconfig->bitrate.pass), - "Multipass - First Pass"); + _("Multipass - First Pass")); gtk_combo_box_append_text (GTK_COMBO_BOX (gconfig->bitrate.pass), - "Multipass - First Pass (fast)"); + _("Multipass - First Pass (fast)")); gtk_combo_box_append_text (GTK_COMBO_BOX (gconfig->bitrate.pass), - "Multipass - Nth Pass"); + _("Multipass - Nth Pass")); gtk_table_attach_defaults (GTK_TABLE (table), gconfig->bitrate.pass, 1, 2, 0, 1); g_signal_connect (G_OBJECT (gconfig->bitrate.pass), @@ -69,10 +89,18 @@ _bitrate_page (X264_Gui_Config *gconfig) gconfig); gtk_widget_show (gconfig->bitrate.pass); - gconfig->bitrate.label = gtk_label_new ("Quantizer"); - gtk_misc_set_alignment (GTK_MISC (gconfig->bitrate.label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), gconfig->bitrate.label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Quantizer - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 1, 2); + gtk_widget_show (eb); + + gconfig->bitrate.label = gtk_label_new (_("Quantizer")); + gtk_misc_set_alignment (GTK_MISC (gconfig->bitrate.label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), gconfig->bitrate.label); gtk_widget_show (gconfig->bitrate.label); gconfig->bitrate.w_quantizer = gtk_hscale_new_with_range (0.0, 51.0, 1.0); @@ -89,7 +117,7 @@ _bitrate_page (X264_Gui_Config *gconfig) gtk_table_attach_defaults (GTK_TABLE (table), gconfig->bitrate.w_target_bitrate, 1, 2, 1, 2); - frame = gtk_frame_new ("Statistic file"); + frame = gtk_frame_new (_("Statistic file")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -100,7 +128,10 @@ _bitrate_page (X264_Gui_Config *gconfig) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - gconfig->bitrate.update_statfile = gtk_check_button_new_with_label ("Update Statfile"); + gconfig->bitrate.update_statfile = gtk_check_button_new_with_label (_("Update statistic file")); + gtk_tooltips_set_tip (tooltips, gconfig->bitrate.update_statfile, + _("Update statistic file - description"), + ""); g_signal_connect (G_OBJECT (gconfig->bitrate.update_statfile), "toggled", G_CALLBACK (_bitrate_statfile), gconfig); @@ -108,7 +139,7 @@ _bitrate_page (X264_Gui_Config *gconfig) 0, 1, 0, 1); gtk_widget_show (gconfig->bitrate.update_statfile); - label = gtk_label_new ("Statsfile name"); + label = gtk_label_new (_("Statistic file name")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); @@ -134,7 +165,7 @@ _bitrate_pass (GtkComboBox *combo, switch (gtk_combo_box_get_active (combo)) { case X264_PASS_SINGLE_BITRATE: - gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), "Average bitrate"); + gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), _("Average bitrate")); if (!GTK_WIDGET_VISIBLE (gconfig->bitrate.w_average_bitrate)) { gtk_widget_hide (gconfig->bitrate.w_quantizer); gtk_widget_hide (gconfig->bitrate.w_target_bitrate); @@ -143,7 +174,7 @@ _bitrate_pass (GtkComboBox *combo, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile), FALSE); break; case X264_PASS_SINGLE_QUANTIZER: - gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), "Quantizer"); + gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), _("Quantizer")); if (!GTK_WIDGET_VISIBLE (gconfig->bitrate.w_quantizer)) { gtk_widget_hide (gconfig->bitrate.w_average_bitrate); gtk_widget_hide (gconfig->bitrate.w_target_bitrate); @@ -152,7 +183,7 @@ _bitrate_pass (GtkComboBox *combo, break; case X264_PASS_MULTIPASS_1ST: case X264_PASS_MULTIPASS_1ST_FAST: - gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), "Target bitrate"); + gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), _("Target bitrate")); if (!GTK_WIDGET_VISIBLE (gconfig->bitrate.w_target_bitrate)) { gtk_widget_hide (gconfig->bitrate.w_quantizer); gtk_widget_hide (gconfig->bitrate.w_average_bitrate); @@ -161,7 +192,7 @@ _bitrate_pass (GtkComboBox *combo, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gconfig->bitrate.update_statfile), TRUE); break; case X264_PASS_MULTIPASS_NTH: - gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), "Target bitrate"); + gtk_label_set_text (GTK_LABEL (gconfig->bitrate.label), _("Target bitrate")); if (!GTK_WIDGET_VISIBLE (gconfig->bitrate.w_target_bitrate)) { gtk_widget_hide (gconfig->bitrate.w_quantizer); gtk_widget_hide (gconfig->bitrate.w_average_bitrate); diff --git a/gtk/x264_gtk_cqm.c b/gtk/x264_gtk_cqm.c new file mode 100644 index 00000000..60661608 --- /dev/null +++ b/gtk/x264_gtk_cqm.c @@ -0,0 +1,471 @@ +#if defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ || defined __DragonFly__ +# include +#else +# include +#endif + +#include + +#include "../x264.h" +#include "x264_gtk_private.h" +#include "x264_gtk_i18n.h" +#include "x264_gtk_enum.h" + + +/* Callbacks */ +static void _cqm_flat_matrix_cb (GtkToggleButton *togglebutton, + gpointer user_data); +static void _cqm_jvt_matrix_cb (GtkToggleButton *togglebutton, + gpointer user_data); +static void _cqm_custom_matrix_cb (GtkToggleButton *togglebutton, + gpointer user_data); +static void _cqm_matrix_file_cb (GtkFileChooser *filechooser, + gint response, + gpointer user_data); + + +static GtkWidget *_cqm_4x4_page (X264_Gui_Config *gconfig); +static GtkWidget *_cqm_8x8_iy_page (X264_Gui_Config *gconfig); +static GtkWidget *_cqm_8x8_py_page (X264_Gui_Config *gconfig); + +GtkWidget * +_cqm_page (X264_Gui_Config *gconfig) +{ + GtkWidget *vbox; + GtkWidget *table; + GtkWidget *notebook; + GtkWidget *chooser; + GtkWidget *label; + GtkWidget *page; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); + + vbox = gtk_vbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); + + table = gtk_table_new (4, 2, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_container_set_border_width (GTK_CONTAINER (table), 6); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 6); + gtk_widget_show (table); + + gconfig->cqm.radio_flat = gtk_radio_button_new_with_label (NULL, _("Flat matrix")); + gtk_tooltips_set_tip (tooltips, gconfig->cqm.radio_flat, + _("Flat matrix - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), gconfig->cqm.radio_flat, + 0, 1, 0, 1); + g_signal_connect (G_OBJECT (gconfig->cqm.radio_flat), "toggled", + G_CALLBACK (_cqm_flat_matrix_cb), gconfig); + gtk_widget_show (gconfig->cqm.radio_flat); + + gconfig->cqm.radio_jvt = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (gconfig->cqm.radio_flat), _("JVT matrix")); + gtk_tooltips_set_tip (tooltips, gconfig->cqm.radio_jvt, + _("JVT matrix - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), gconfig->cqm.radio_jvt, + 0, 1, 1, 2); + g_signal_connect (G_OBJECT (gconfig->cqm.radio_jvt), "toggled", + G_CALLBACK (_cqm_jvt_matrix_cb), gconfig); + gtk_widget_show (gconfig->cqm.radio_jvt); + + gconfig->cqm.radio_custom = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (gconfig->cqm.radio_flat), _("Custom matrix")); + gtk_tooltips_set_tip (tooltips, gconfig->cqm.radio_custom, + _("Custom matrix - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), gconfig->cqm.radio_custom, + 0, 1, 2, 3); + g_signal_connect (G_OBJECT (gconfig->cqm.radio_custom), "toggled", + G_CALLBACK (_cqm_custom_matrix_cb), gconfig); + gtk_widget_show (gconfig->cqm.radio_custom); + + chooser = gtk_file_chooser_dialog_new(_("Select a file"), + NULL, + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + g_signal_connect (G_OBJECT (chooser), "response", + G_CALLBACK (_cqm_matrix_file_cb), gconfig); + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), + g_get_home_dir ()); + gconfig->cqm.cqm_file = gtk_file_chooser_button_new_with_dialog (chooser); + gtk_table_attach_defaults (GTK_TABLE (table), gconfig->cqm.cqm_file, + 1, 2, 2, 3); + gtk_widget_show (gconfig->cqm.cqm_file); + + notebook = gtk_notebook_new (); + gtk_table_attach_defaults (GTK_TABLE (table), notebook, + 0, 2, 3, 4); + gtk_widget_show (notebook); + + label = gtk_label_new (_("4x4 quant. matrices")); + gtk_widget_show (label); + + page = _cqm_4x4_page (gconfig); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + gtk_widget_show (page); + + label = gtk_label_new (_("8x8 I luma quant. matrices")); + gtk_widget_show (label); + + page = _cqm_8x8_iy_page (gconfig); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + gtk_widget_show (page); + + label = gtk_label_new (_("8x8 P luma quant. matrices")); + gtk_widget_show (label); + + page = _cqm_8x8_py_page (gconfig); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); + gtk_widget_show (page); + + return vbox; +} + +static GtkWidget * +_cqm_4x4_page (X264_Gui_Config *gconfig) +{ + GtkWidget *table; + GtkWidget *misc; + GtkWidget *frame; + GtkWidget *t; + GtkRequisition size; + gint i; + + misc = gtk_entry_new_with_max_length (3); + gtk_widget_size_request (misc, &size); + + table = gtk_table_new (2, 2, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_container_set_border_width (GTK_CONTAINER (table), 6); + + frame = gtk_frame_new (_("4x4 I luma quant. matrices")); + gtk_table_attach_defaults (GTK_TABLE (table), frame, + 0, 1, 0, 1); + gtk_widget_show (frame); + + t = gtk_table_new (4, 4, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (t), 6); + gtk_table_set_col_spacings (GTK_TABLE (t), 6); + gtk_container_set_border_width (GTK_CONTAINER (t), 6); + gtk_container_add (GTK_CONTAINER (frame), t); + gtk_widget_show (t); + + for (i = 0; i < 16; i++) { + gconfig->cqm.cqm_4iy[i] = gtk_entry_new_with_max_length (3); + gtk_widget_set_size_request (gconfig->cqm.cqm_4iy[i], 25, size.height); + gtk_table_attach_defaults (GTK_TABLE (t), gconfig->cqm.cqm_4iy[i], + i >> 2, (i >> 2) + 1, i & 3, (i & 3) + 1); + gtk_widget_show (gconfig->cqm.cqm_4iy[i]); + } + + frame = gtk_frame_new (_("4x4 I chroma quant. matrices")); + gtk_table_attach_defaults (GTK_TABLE (table), frame, + 0, 1, 1, 2); + gtk_widget_show (frame); + + t = gtk_table_new (4, 4, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (t), 6); + gtk_table_set_col_spacings (GTK_TABLE (t), 6); + gtk_container_set_border_width (GTK_CONTAINER (t), 6); + gtk_container_add (GTK_CONTAINER (frame), t); + gtk_widget_show (t); + + for (i = 0; i < 16; i++) { + gconfig->cqm.cqm_4ic[i] = gtk_entry_new_with_max_length (3); + gtk_widget_set_size_request (gconfig->cqm.cqm_4ic[i], 25, size.height); + gtk_table_attach_defaults (GTK_TABLE (t), gconfig->cqm.cqm_4ic[i], + i >> 2, (i >> 2) + 1, i & 3, (i & 3) + 1); + gtk_widget_show (gconfig->cqm.cqm_4ic[i]); + } + + frame = gtk_frame_new (_("4x4 P luma quant. matrix")); + gtk_table_attach_defaults (GTK_TABLE (table), frame, + 1, 2, 0, 1); + gtk_widget_show (frame); + + t = gtk_table_new (4, 4, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (t), 6); + gtk_table_set_col_spacings (GTK_TABLE (t), 6); + gtk_container_set_border_width (GTK_CONTAINER (t), 6); + gtk_container_add (GTK_CONTAINER (frame), t); + gtk_widget_show (t); + + for (i = 0; i < 16; i++) { + gconfig->cqm.cqm_4py[i] = gtk_entry_new_with_max_length (3); + gtk_widget_set_size_request (gconfig->cqm.cqm_4py[i], 25, size.height); + gtk_table_attach_defaults (GTK_TABLE (t), gconfig->cqm.cqm_4py[i], + i >> 2, (i >> 2) + 1, i & 3, (i & 3) + 1); + gtk_widget_show (gconfig->cqm.cqm_4py[i]); + } + + frame = gtk_frame_new (_("4x4 P chroma quant. matrix")); + gtk_table_attach_defaults (GTK_TABLE (table), frame, + 1, 2, 1, 2); + gtk_widget_show (frame); + + t = gtk_table_new (4, 4, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (t), 6); + gtk_table_set_col_spacings (GTK_TABLE (t), 6); + gtk_container_set_border_width (GTK_CONTAINER (t), 6); + gtk_container_add (GTK_CONTAINER (frame), t); + gtk_widget_show (t); + + for (i = 0; i < 16; i++) { + gconfig->cqm.cqm_4pc[i] = gtk_entry_new_with_max_length (3); + gtk_widget_set_size_request (gconfig->cqm.cqm_4pc[i], 25, size.height); + gtk_table_attach_defaults (GTK_TABLE (t), gconfig->cqm.cqm_4pc[i], + i >> 2, (i >> 2) + 1, i & 3, (i & 3) + 1); + gtk_widget_show (gconfig->cqm.cqm_4pc[i]); + } + + return table; +} + +static GtkWidget * +_cqm_8x8_iy_page (X264_Gui_Config *gconfig) +{ + GtkWidget *table; + GtkWidget *misc; + GtkRequisition size; + gint i; + + misc = gtk_entry_new_with_max_length (3); + gtk_widget_size_request (misc, &size); + + table = gtk_table_new (8, 8, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_container_set_border_width (GTK_CONTAINER (table), 6); + + for (i = 0; i < 64; i++) { + gconfig->cqm.cqm_8iy[i] = gtk_entry_new_with_max_length (3); + gtk_widget_set_size_request (gconfig->cqm.cqm_8iy[i], 25, size.height); + gtk_table_attach_defaults (GTK_TABLE (table), gconfig->cqm.cqm_8iy[i], + i >> 3, (i >> 3) + 1, i & 7, (i & 7) + 1); + gtk_widget_show (gconfig->cqm.cqm_8iy[i]); + } + + return table; +} + +static GtkWidget * +_cqm_8x8_py_page (X264_Gui_Config *gconfig) +{ + GtkWidget *table; + GtkWidget *misc; + GtkRequisition size; + gint i; + + misc = gtk_entry_new_with_max_length (3); + gtk_widget_size_request (misc, &size); + + table = gtk_table_new (8, 8, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_container_set_border_width (GTK_CONTAINER (table), 6); + + for (i = 0; i < 64; i++) { + gconfig->cqm.cqm_8py[i] = gtk_entry_new_with_max_length (3); + gtk_widget_set_size_request (gconfig->cqm.cqm_8py[i], 25, size.height); + gtk_table_attach_defaults (GTK_TABLE (table), gconfig->cqm.cqm_8py[i], + i >> 3, (i >> 3) + 1, i & 7, (i & 7) + 1); + gtk_widget_show (gconfig->cqm.cqm_8py[i]); + } + + return table; +} + +/* Callbacks */ +static void +_cqm_flat_matrix_cb (GtkToggleButton *togglebutton, + gpointer user_data) +{ + X264_Gui_Config *gconfig; + + gconfig = (X264_Gui_Config *)user_data; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->cqm.radio_flat))) { + gint i; + + gtk_widget_set_sensitive (gconfig->cqm.cqm_file, FALSE); + for (i = 0; i < 16; i++) { + gtk_widget_set_sensitive (gconfig->cqm.cqm_4iy[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4ic[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4py[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4pc[i], FALSE); + } + for (i = 0; i < 64; i++) { + gtk_widget_set_sensitive (gconfig->cqm.cqm_8iy[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_8py[i], FALSE); + } + } +} + +static void +_cqm_jvt_matrix_cb (GtkToggleButton *togglebutton, + gpointer user_data) +{ + X264_Gui_Config *gconfig; + + gconfig = (X264_Gui_Config *)user_data; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->cqm.radio_jvt))) { + gint i; + + gtk_widget_set_sensitive (gconfig->cqm.cqm_file, FALSE); + for (i = 0; i < 16; i++) { + gtk_widget_set_sensitive (gconfig->cqm.cqm_4iy[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4ic[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4py[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4pc[i], FALSE); + } + for (i = 0; i < 64; i++) { + gtk_widget_set_sensitive (gconfig->cqm.cqm_8iy[i], FALSE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_8py[i], FALSE); + } + } +} + +static void +_cqm_custom_matrix_cb (GtkToggleButton *togglebutton, + gpointer user_data) +{ + X264_Gui_Config *gconfig; + + gconfig = (X264_Gui_Config *)user_data; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->cqm.radio_custom))) { + gint i; + + gtk_widget_set_sensitive (gconfig->cqm.cqm_file, TRUE); + for (i = 0; i < 16; i++) { + gtk_widget_set_sensitive (gconfig->cqm.cqm_4iy[i], TRUE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4ic[i], TRUE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4py[i], TRUE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_4pc[i], TRUE); + } + for (i = 0; i < 64; i++) { + gtk_widget_set_sensitive (gconfig->cqm.cqm_8iy[i], TRUE); + gtk_widget_set_sensitive (gconfig->cqm.cqm_8py[i], TRUE); + } + } +} + +static gboolean +_set_coefs (int size, GtkWidget **entries, GIOChannel *file) +{ + gchar *line; + gsize length; + int i = 0; + int offset = 0; + + while (i < size) { + gchar **coefs; + int j; + + if (g_io_channel_read_line (file, &line, &length, NULL, NULL) != G_IO_STATUS_NORMAL) { + g_print ("Not a JM custom AVC matrix compliant file\n"); + return FALSE; + } + if ((line[0] == '\0') || (line[0] == '\n') || (line[0] == '\r') || (line[0] == '#')) { + g_free (line); + continue; + } + coefs = g_strsplit (line, ",", size + 1); + for (j = 0; j < size; j++) { + gtk_entry_set_text (GTK_ENTRY (entries[offset]), coefs[j]); + offset++; + } + g_strfreev (coefs); + g_free (line); + i++; + } + return TRUE; +} + +static void +_cqm_matrix_file_cb (GtkFileChooser *filechooser, + gint response, + gpointer user_data) +{ + X264_Gui_Config *gconfig; + GIOChannel *file; + GError *error = NULL; + gchar *filename; + gchar *line; + gsize length; + + if (!user_data) + return; + + gconfig = (X264_Gui_Config *)user_data; + + filename = gtk_file_chooser_get_filename (filechooser); + file = g_io_channel_new_file (filename, "r", &error); + if (error) { + g_print ("Can not open file %s\n", filename); + g_free (filename); + + return; + } + + while ((g_io_channel_read_line (file, &line, &length, NULL, NULL) == G_IO_STATUS_NORMAL)) { + if (!line) continue; + if ((line[0] == '\0') || (line[0] == '\n') || (line[0] == '\r') || (line[0] == '#')) { + g_free (line); + continue; + } + if (g_str_has_prefix (line, "INTRA4X4_LUMA")) { + g_free (line); + if (!_set_coefs (4, gconfig->cqm.cqm_4iy, file)) { + g_free (filename); + return; + } + continue; + } + if (g_str_has_prefix (line, "INTRA4X4_CHROMAU")) { + g_free (line); + if (!_set_coefs (4, gconfig->cqm.cqm_4ic, file)) { + g_free (filename); + return; + } + continue; + } + if (g_str_has_prefix (line, "INTER4X4_LUMA")) { + g_free (line); + if (!_set_coefs (4, gconfig->cqm.cqm_4py, file)) { + g_free (filename); + return; + } + continue; + } + + if (g_str_has_prefix (line, "INTER4X4_CHROMAU")) { + g_free (line); + if (!_set_coefs (4, gconfig->cqm.cqm_4pc, file)) { + g_free (filename); + return; + } + continue; + } + if (g_str_has_prefix (line, "INTRA8X8_LUMA")) { + g_free (line); + if (!_set_coefs (8, gconfig->cqm.cqm_8iy, file)) { + g_free (filename); + return; + } + continue; + } + if (g_str_has_prefix (line, "INTER8X8_LUMA")) { + g_free (line); + if (!_set_coefs (8, gconfig->cqm.cqm_8py, file)) { + g_free (filename); + return; + } + continue; + } + } + g_free (filename); +} diff --git a/gtk/x264_gtk_cqm.h b/gtk/x264_gtk_cqm.h new file mode 100644 index 00000000..8f6ebe1b --- /dev/null +++ b/gtk/x264_gtk_cqm.h @@ -0,0 +1,8 @@ +#ifndef __X264_GTK_CQM_H__ +#define __X264_GTK_CQM_H__ + + +GtkWidget *_cqm_page (X264_Gui_Config *config); + + +#endif /* __X264_GTK_CQM_H__ */ diff --git a/gtk/x264_gtk_encode.c b/gtk/x264_gtk_encode.c index 55ac7f79..8240a516 100644 --- a/gtk/x264_gtk_encode.c +++ b/gtk/x264_gtk_encode.c @@ -1,11 +1,22 @@ +#if defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ || defined __DragonFly__ +# include +#else +# include +#endif + #include +#include "x264_gtk_private.h" +#include "x264_gtk_i18n.h" #include "x264_gtk_encode_main_window.h" int main (int argc, char *argv[]) { + BIND_X264_TEXTDOMAIN(); + g_thread_init (NULL); + gtk_init (&argc, &argv); x264_gtk_encode_main_window (); diff --git a/gtk/x264_gtk_encode_encode.c b/gtk/x264_gtk_encode_encode.c index 9d35337d..a9589610 100644 --- a/gtk/x264_gtk_encode_encode.c +++ b/gtk/x264_gtk_encode_encode.c @@ -8,6 +8,7 @@ #include #include "../x264.h" +#include "x264_gtk_i18n.h" #include "x264_gtk_demuxers.h" #include "x264_gtk_encode_private.h" @@ -54,7 +55,7 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) int i_progress; int err; - g_print ("encoding...\n"); + g_print (_("encoding...\n")); param = thread_data->param; err = _set_drivers (thread_data->in_container, thread_data->out_container); if (err < 0) { @@ -63,15 +64,15 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - (err == -2) ? "Error: unknown output file type" - : "Error: unknown input file type"); + (err == -2) ? _("Error: unknown output file type") + : _("Error: unknown input file type")); gtk_dialog_run (GTK_DIALOG (no_driver)); gtk_widget_destroy (no_driver); return NULL; } - + if (p_open_infile (thread_data->file_input, &hin, param)) { - fprintf( stderr, "could not open input file '%s'\n", thread_data->file_input ); + fprintf( stderr, _("could not open input file '%s'\n"), thread_data->file_input ); return NULL; } @@ -85,7 +86,7 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) if ((h = x264_encoder_open (param)) == NULL) { - fprintf (stderr, "x264_encoder_open failed\n"); + fprintf (stderr, _("x264_encoder_open failed\n")); p_close_infile (hin); p_close_outfile (hout); g_free (param); @@ -95,7 +96,7 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) if (p_set_outfile_param (hout, param)) { - fprintf (stderr, "can't set outfile param\n"); + fprintf (stderr, _("can't set outfile param\n")); p_close_infile (hin); p_close_outfile (hout); g_free (param); @@ -122,12 +123,11 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) i_frame++; /* update status line (up to 1000 times per input file) */ - if (param->i_log_level < X264_LOG_DEBUG && + if (param->i_log_level < X264_LOG_DEBUG && (i_frame_total ? i_frame * 1000 / i_frame_total > i_progress : i_frame % 10 == 0)) { int64_t i_elapsed = x264_mdate () - i_start; - double fps = i_elapsed > 0 ? i_frame * 1000000. / i_elapsed : 0; if (i_frame_total) { @@ -140,20 +140,17 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) 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, sizeof (X264_Pipe_Data), size); } else { /* we force the GIOChannel to write to the pipeline */ status = g_io_channel_flush (thread_data->io_write, NULL); if (status != G_IO_STATUS_NORMAL) { - g_print ("Error ! %d\n", status); + g_print (_("Error ! %d\n"), status); } } } - else - fprintf( stderr, "encoded frames: %d, %.2f fps \r", i_frame, fps ); - fflush( stderr ); /* needed in windows */ } } /* Flush delayed B-frames */ @@ -173,7 +170,7 @@ x264_gtk_encode_encode (X264_Thread_Data *thread_data) double fps = (double)i_frame * (double)1000000 / (double)(i_end - i_start); - fprintf (stderr, "encoded %d frames, %.2f fps, %.2f kb/s\n", + fprintf (stderr, _("encoded %d frames, %.2f fps, %.2f kb/s\n"), i_frame, fps, (double) i_file * 8 * param->i_fps_num / ((double) param->i_fps_den * i_frame * 1000)); @@ -266,7 +263,7 @@ _encode_frame (x264_t *h, void *handle, x264_picture_t *pic) } if (x264_encoder_encode (h, &nal, &i_nal, pic, &pic_out) < 0) { - fprintf (stderr, "x264_encoder_encode failed\n"); + fprintf (stderr, _("x264_encoder_encode failed\n")); } for (i = 0; i < i_nal; i++) @@ -281,7 +278,7 @@ _encode_frame (x264_t *h, void *handle, x264_picture_t *pic) } else if (i_size < 0) { - fprintf (stderr, "need to increase buffer size (size=%d)\n", -i_size); + fprintf (stderr, _("need to increase buffer size (size=%d)\n"), -i_size); } } if (i_nal) diff --git a/gtk/x264_gtk_encode_main_window.c b/gtk/x264_gtk_encode_main_window.c index 3e24936d..a79f65d4 100644 --- a/gtk/x264_gtk_encode_main_window.c +++ b/gtk/x264_gtk_encode_main_window.c @@ -18,6 +18,7 @@ #include "../config.h" #include "x264_icon.h" #include "x264_gtk.h" +#include "x264_gtk_i18n.h" #include "x264_gtk_demuxers.h" #include "x264_gtk_encode_private.h" #include "x264_gtk_encode_encode.h" @@ -39,7 +40,7 @@ struct X264_Gtk_Encode_ GtkWidget *fps_num; GtkWidget *fps_den; GtkWidget *frame_count; - + /* output */ GtkWidget *path_output; GtkWidget *file_output; @@ -48,17 +49,17 @@ struct X264_Gtk_Encode_ /* Callbacks */ -static gboolean _delete_window_cb (GtkWidget *widget, - GdkEvent *event, - gpointer user_data); -static void _configure_window_cb (GtkButton *button, - gpointer user_data); -static void _chooser_window_cb (GtkDialog *dialog, - gint res, - gpointer user_data); -static void _response_window_cb (GtkDialog *dialog, - gint res, - gpointer user_data); +static gboolean _delete_window_cb (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); +static void _configure_window_cb (GtkButton *button, + gpointer user_data); +static void _chooser_window_cb (GtkDialog *dialog, + gint res, + gpointer user_data); +static void _response_window_cb (GtkDialog *dialog, + gint res, + gpointer user_data); static void _dimension_entry_cb (GtkEditable *editable, gpointer user_data); @@ -74,7 +75,7 @@ _file_size(const char* name) if (stat(name, &buf) < 0) { - fprintf(stderr, "Can't stat file\n"); + fprintf(stderr, _("Can't stat file\n")); return 0; } return buf.st_size; @@ -95,7 +96,7 @@ x264_gtk_encode_main_window () encode = (X264_Gtk_Encode *)g_malloc0 (sizeof (X264_Gtk_Encode)); - dialog = gtk_dialog_new_with_buttons ("X264 Gtk Encoder", + dialog = gtk_dialog_new_with_buttons (_("X264 Gtk Encoder"), NULL, 0, NULL); icon = gdk_pixbuf_new_from_inline (-1, x264_icon, @@ -111,7 +112,7 @@ x264_gtk_encode_main_window () encode); encode->main_dialog = dialog; - button = gtk_button_new_with_label ("Configure"); + button = gtk_button_new_with_label (_("Configure")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, FALSE, TRUE, 6); g_signal_connect (G_OBJECT (button), "clicked", @@ -125,7 +126,7 @@ x264_gtk_encode_main_window () NULL); /* input */ - frame = gtk_frame_new ("Input file"); + frame = gtk_frame_new (_("Input file")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -136,13 +137,13 @@ x264_gtk_encode_main_window () gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Input file:"); + label = gtk_label_new (_("Input file:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); chooser = (GtkFileChooser*) - gtk_file_chooser_dialog_new("Select a file", + gtk_file_chooser_dialog_new(_("Select a file"), GTK_WINDOW(dialog), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, @@ -151,7 +152,7 @@ x264_gtk_encode_main_window () gtk_file_chooser_set_current_folder (chooser, g_get_home_dir ()); /* All supported */ filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "All supported"); + gtk_file_filter_set_name (filter, _("All supported")); gtk_file_filter_add_pattern (filter, "*.yuv"); gtk_file_filter_add_pattern (filter, "*.cif"); gtk_file_filter_add_pattern (filter, "*.qcif"); @@ -163,25 +164,25 @@ x264_gtk_encode_main_window () gtk_file_chooser_add_filter (chooser, filter); /* YUV filter */ filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "YUV sequence"); + gtk_file_filter_set_name (filter, _("YUV sequence")); gtk_file_filter_add_pattern (filter, "*.yuv"); gtk_file_chooser_add_filter (chooser, filter); /* CIF filter */ filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "YUV CIF sequence"); + gtk_file_filter_set_name (filter, _("YUV CIF sequence")); gtk_file_filter_add_pattern (filter, "*.cif"); gtk_file_chooser_add_filter (chooser, filter); /* QCIF filter */ filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "YUV QCIF sequence"); + gtk_file_filter_set_name (filter, _("YUV QCIF sequence")); gtk_file_filter_add_pattern (filter, "*.qcif"); gtk_file_chooser_add_filter (chooser, filter); /* YUV4MPEG2 filter */ filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "YUV4MPEG2 sequence"); + gtk_file_filter_set_name (filter, _("YUV4MPEG2 sequence")); gtk_file_filter_add_pattern (filter, "*.y4m"); gtk_file_chooser_add_filter (chooser, filter); @@ -193,18 +194,18 @@ x264_gtk_encode_main_window () gtk_file_chooser_add_filter (chooser, filter); /* AVS filter */ filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "Avisynth Script"); + gtk_file_filter_set_name (filter, _("Avisynth Script")); gtk_file_filter_add_pattern (filter, "*.avs"); gtk_file_chooser_add_filter (chooser, filter); #endif g_signal_connect_after(G_OBJECT (chooser), "response", G_CALLBACK (_chooser_window_cb), encode); - encode->file_input = gtk_file_chooser_button_new_with_dialog(GTK_WIDGET(chooser)); + encode->file_input = gtk_file_chooser_button_new_with_dialog (GTK_WIDGET(chooser)); gtk_table_attach_defaults (GTK_TABLE (table), encode->file_input, 1, 2, 0, 1); gtk_widget_show (encode->file_input); - label = gtk_label_new ("Width:"); + label = gtk_label_new (_("Width:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); @@ -217,7 +218,7 @@ x264_gtk_encode_main_window () gtk_table_attach_defaults (GTK_TABLE (table), encode->width, 1, 2, 1, 2); gtk_widget_show (encode->width); - label = gtk_label_new ("Height:"); + label = gtk_label_new (_("Height:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3); gtk_widget_show (label); @@ -230,7 +231,7 @@ x264_gtk_encode_main_window () encode); gtk_widget_show (encode->height); - label = gtk_label_new ("Frame rate num:"); + label = gtk_label_new (_("Frame rate num:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4); gtk_widget_show (label); @@ -240,7 +241,7 @@ x264_gtk_encode_main_window () gtk_table_attach_defaults (GTK_TABLE (table), encode->fps_num, 1, 2, 3, 4); gtk_widget_show (encode->fps_num); - label = gtk_label_new ("Frame rate den:"); + label = gtk_label_new (_("Frame rate den:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5); gtk_widget_show (label); @@ -250,7 +251,7 @@ x264_gtk_encode_main_window () gtk_table_attach_defaults (GTK_TABLE (table), encode->fps_den, 1, 2, 4, 5); gtk_widget_show (encode->fps_den); - label = gtk_label_new ("Frame count:"); + label = gtk_label_new (_("Frame count:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6); gtk_widget_show (label); @@ -261,7 +262,7 @@ x264_gtk_encode_main_window () gtk_widget_show (encode->frame_count); /* output */ - frame = gtk_frame_new ("Output file"); + frame = gtk_frame_new (_("Output file")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -272,19 +273,19 @@ x264_gtk_encode_main_window () gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Output path:"); + label = gtk_label_new (_("Output path:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); - encode->path_output = gtk_file_chooser_button_new ("Select a path", + encode->path_output = gtk_file_chooser_button_new (_("Select a path"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (encode->path_output), g_get_home_dir ()); gtk_table_attach_defaults (GTK_TABLE (table), encode->path_output, 1, 2, 0, 1); gtk_widget_show (encode->path_output); - label = gtk_label_new ("Output file (without ext.):"); + label = gtk_label_new (_("Output file (without ext.):")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); @@ -293,7 +294,7 @@ x264_gtk_encode_main_window () gtk_table_attach_defaults (GTK_TABLE (table), encode->file_output, 1, 2, 1, 2); gtk_widget_show (encode->file_output); - label = gtk_label_new ("Container:"); + label = gtk_label_new (_("Container:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3); gtk_widget_show (label); @@ -377,7 +378,7 @@ _chooser_window_cb (GtkDialog *dialog, GSList *filters; GtkFileFilter *selected; int container; - + filters = gtk_file_chooser_list_filters(GTK_FILE_CHOOSER (encode->file_input)); selected = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER (encode->file_input)); container = g_slist_index(filters, selected); @@ -405,7 +406,7 @@ _chooser_window_cb (GtkDialog *dialog, /* The all supproted type is 0 => shift of 1 */ encode->container = (X264_Demuxer_Type)container-1; } - + switch (encode->container) { case X264_DEMUXER_YUV: /* YUV */ break; @@ -465,7 +466,7 @@ _chooser_window_cb (GtkDialog *dialog, GTK_BUTTONS_CLOSE, strerror(errno)); gtk_dialog_run (GTK_DIALOG (dialog_message)); - gtk_widget_destroy (dialog_message); + gtk_widget_destroy (dialog_message); } encode->size = _file_size(in); @@ -507,7 +508,7 @@ _configure_window_cb (GtkButton *button __UNUSED__, gpointer user_data) { GtkWidget *window; - + window = x264_gtk_window_create (GTK_WIDGET (user_data)); x264_gtk_shutdown (window); } @@ -538,7 +539,7 @@ _response_window_cb (GtkDialog *dialog, path_output = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (encode->path_output)); filename_output = gtk_entry_get_text (GTK_ENTRY (encode->file_output)); - if (!file_input || + if (!file_input || (file_input[0] == '\0')) { GtkWidget *dialog_message; @@ -546,21 +547,21 @@ _response_window_cb (GtkDialog *dialog, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - "Error: input file name is not set"); + _("Error: input file name is not set")); gtk_dialog_run (GTK_DIALOG (dialog_message)); gtk_widget_destroy (dialog_message); break; } - if (!filename_output || + if (!filename_output || (filename_output[0] == '\0')) { GtkWidget *dialog_message; dialog_message = gtk_message_dialog_new (GTK_WINDOW (dialog), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "Error: output file name is not set"); + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Error: output file name is not set")); gtk_dialog_run (GTK_DIALOG (dialog_message)); gtk_widget_destroy (dialog_message); break; @@ -583,11 +584,50 @@ _response_window_cb (GtkDialog *dialog, } file_output = g_strconcat (path_output, "/", filename_output, ext, NULL); - g_print ("file output : %s\n", file_output); + g_print (_("file output : %s\n"), file_output); + + { + GIOChannel *file; + + file = g_io_channel_new_file (file_output, "r", NULL); + if (file) { + GtkWidget *dialog_overwrite; + GtkWidget *eb; + GtkWidget *label; + const gchar *label_text = NULL; + gint res; + + dialog_overwrite = gtk_dialog_new_with_buttons (_("Existing file"), + GTK_WINDOW (dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_YES, + GTK_RESPONSE_ACCEPT, + GTK_STOCK_NO, + GTK_RESPONSE_REJECT, + NULL); + + eb = gtk_event_box_new (); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog_overwrite)->vbox), eb); + gtk_container_set_border_width (GTK_CONTAINER (eb), 6); + gtk_widget_show (eb); + + label_text = g_strconcat (_("Do you want to overwrite file\n"), + file_output, " ?", NULL); + label = gtk_label_new (label_text); + gtk_container_add (GTK_CONTAINER (eb), label); + gtk_widget_show (label); + + res = gtk_dialog_run (GTK_DIALOG (dialog_overwrite)); + gtk_widget_destroy (dialog_overwrite); + g_io_channel_unref (file); + if ((res == GTK_RESPONSE_REJECT) || (res == GTK_RESPONSE_DELETE_EVENT)) + break; + } + } x264_gtk = x264_gtk_load (); param = x264_gtk_param_get (x264_gtk); - g_free (x264_gtk); + x264_gtk_free (x264_gtk); { gint width; @@ -672,7 +712,7 @@ _fill_status_window (GIOChannel *io __UNUSED__, 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, sizeof (X264_Pipe_Data), size); return FALSE; } @@ -680,13 +720,13 @@ _fill_status_window (GIOChannel *io __UNUSED__, gtk_entry_set_text (GTK_ENTRY (thread_data->current_video_frame), str); - snprintf (str, 128, "%dKB", + snprintf (str, 128, _("%dKB"), pipe_data.file >> 10); gtk_entry_set_text (GTK_ENTRY (thread_data->video_data), str); fps = pipe_data.elapsed > 0 ? 1000000.0 * (gdouble)pipe_data.frame / (gdouble)pipe_data.elapsed : 0.0; - snprintf (str, 128, "%.2fKB/s (%.2f fps)", + snprintf (str, 128, _("%.2fKB/s (%.2f fps)"), (double) pipe_data.file * 8 * thread_data->param->i_fps_num / ((double) thread_data->param->i_fps_den * pipe_data.frame * 1000), fps); diff --git a/gtk/x264_gtk_encode_status_window.c b/gtk/x264_gtk_encode_status_window.c index b7a25dbb..95dc85fc 100644 --- a/gtk/x264_gtk_encode_status_window.c +++ b/gtk/x264_gtk_encode_status_window.c @@ -7,6 +7,7 @@ #include #include "../x264.h" +#include "x264_gtk_i18n.h" #include "x264_gtk_encode_private.h" @@ -28,7 +29,7 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) if (!thread_data) return NULL; win_status = thread_data->dialog = gtk_dialog_new (); - gtk_window_set_title (GTK_WINDOW (win_status), "Encoding status"); + gtk_window_set_title (GTK_WINDOW (win_status), _("Encoding status")); thread_data->button = gtk_dialog_add_button (GTK_DIALOG (win_status), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); thread_data->end_button = gtk_dialog_add_button (GTK_DIALOG (thread_data->dialog), @@ -51,55 +52,55 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) gtk_box_pack_start (GTK_BOX (GTK_DIALOG (win_status)->vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); - - label = gtk_label_new ("Current video frame:"); + + label = gtk_label_new (_("Current video frame:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_widget_show (label); - + thread_data->current_video_frame = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->current_video_frame, 1, 2, 0, 1); gtk_widget_show (thread_data->current_video_frame); - - label = gtk_label_new ("Video data:"); + + label = gtk_label_new (_("Video data:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); gtk_widget_show (label); - + thread_data->video_data = gtk_entry_new (); - gtk_entry_set_text (GTK_ENTRY (thread_data->video_data), "0KB"); + gtk_entry_set_text (GTK_ENTRY (thread_data->video_data), _("0KB")); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->video_data, 1, 2, 1, 2); gtk_widget_show (thread_data->video_data); - - label = gtk_label_new ("Video rendering rate:"); + + label = gtk_label_new (_("Video rendering rate:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3); gtk_widget_show (label); - + thread_data->video_rendering_rate = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->video_rendering_rate, 1, 2, 2, 3); gtk_widget_show (thread_data->video_rendering_rate); - - label = gtk_label_new ("Time elapsed:"); + + label = gtk_label_new (_("Time elapsed:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4); gtk_widget_show (label); - + thread_data->time_elapsed = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->time_elapsed, 1, 2, 3, 4); gtk_widget_show (thread_data->time_elapsed); - - label = gtk_label_new ("Total time (estimated):"); + + label = gtk_label_new (_("Total time (estimated):")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5); gtk_widget_show (label); - + thread_data->time_remaining = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->time_remaining, 1, 2, 4, 5); @@ -112,8 +113,8 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) gtk_box_pack_start (GTK_BOX (GTK_DIALOG (win_status)->vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); - - label = gtk_label_new ("Progress:"); + + label = gtk_label_new (_("Progress:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), @@ -121,7 +122,7 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) 0, 1, 0, 1); gtk_widget_show (label); - + thread_data->progress = gtk_progress_bar_new (); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->progress, 1, 2, 0, 1); diff --git a/gtk/x264_gtk_enum.h b/gtk/x264_gtk_enum.h index 5387da6d..9e498cab 100644 --- a/gtk/x264_gtk_enum.h +++ b/gtk/x264_gtk_enum.h @@ -1,7 +1,6 @@ #ifndef __X264_GTK_ENUM_H__ #define __X264_GTK_ENUM_H__ - typedef enum { X264_PASS_SINGLE_BITRATE, @@ -13,9 +12,10 @@ typedef enum typedef enum { - X264_NONE = X264_DIRECT_PRED_NONE, - X264_SPATIAL = X264_DIRECT_PRED_SPATIAL, - X264_TEMPORAL = X264_DIRECT_PRED_TEMPORAL + X264_NONE = X264_DIRECT_PRED_NONE, + X264_SPATIAL = X264_DIRECT_PRED_SPATIAL, + X264_TEMPORAL = X264_DIRECT_PRED_TEMPORAL, + X264_AUTO = X264_DIRECT_PRED_AUTO }X264_Direct_Mode; typedef enum @@ -31,20 +31,27 @@ typedef enum typedef enum { - X264_ME_METHOD_DIAMOND = X264_ME_DIA, - X264_ME_METHOD_HEXAGONAL = X264_ME_HEX, + X264_ME_METHOD_DIAMOND = X264_ME_DIA, + X264_ME_METHOD_HEXAGONAL = X264_ME_HEX, X264_ME_METHOD_UNEVEN_MULTIHEXA = X264_ME_UMH, - X264_ME_METHOD_EXHAUSTIVE = X264_ME_ESA + X264_ME_METHOD_EXHAUSTIVE = X264_ME_ESA }X264_Me_Method; typedef enum { - X264_DEBUG_METHOD_NONE = X264_LOG_NONE, - X264_DEBUG_METHOD_ERROR = X264_LOG_ERROR, - X264_DEBUG_METHOD_WARNING = X264_LOG_WARNING, - X264_DEBUG_METHOD_INFO = X264_LOG_INFO, - X264_DEBUG_METHOD_DEBUG = X264_LOG_DEBUG + X264_DEBUG_METHOD_NONE = X264_LOG_NONE + 1, + X264_DEBUG_METHOD_ERROR = X264_LOG_ERROR + 1, + X264_DEBUG_METHOD_WARNING = X264_LOG_WARNING + 1, + X264_DEBUG_METHOD_INFO = X264_LOG_INFO + 1, + X264_DEBUG_METHOD_DEBUG = X264_LOG_DEBUG + 1 }X264_Debug_Method; +typedef enum +{ + X264_CQM_PRESET_FLAT = X264_CQM_FLAT, + X264_CQM_PRESET_JVT = X264_CQM_JVT, + X264_CQM_PRESET_CUSTOM = X264_CQM_CUSTOM +}X264_Cqm_Preset; + #endif /* __X264_GTK_ENUM_H__ */ diff --git a/gtk/x264_gtk_i18n.h b/gtk/x264_gtk_i18n.h new file mode 100644 index 00000000..1fa46e86 --- /dev/null +++ b/gtk/x264_gtk_i18n.h @@ -0,0 +1,24 @@ +#ifndef _X264_GTK_I18N_ +#define _X264_GTK_I18N_ + + +#include + + +#define _(X) gettext(X) +#define GETTEXT_DOMAIN "x264_gtk" + +#ifdef __X264_GTK_PRIVATE_H__ +/* x264_path must be known for this to work */ +# define BIND_X264_TEXTDOMAIN() \ + gchar* _tmp = x264_gtk_path("locale"); \ + bindtextdomain(GETTEXT_DOMAIN, _tmp); \ + g_free(_tmp); \ + bind_textdomain_codeset (GETTEXT_DOMAIN, "UTF-8"); \ + textdomain(GETTEXT_DOMAIN) +#else +# define BIND_X264_TEXTDOMAIN() you_must_include_x64_gtk_private_h_first +#endif + + +#endif /* _X264_GTK_I18N_ */ diff --git a/gtk/x264_gtk_mb.c b/gtk/x264_gtk_mb.c index a494d383..d90e64da 100644 --- a/gtk/x264_gtk_mb.c +++ b/gtk/x264_gtk_mb.c @@ -1,8 +1,18 @@ #include +#include "x264_gtk_i18n.h" #include "x264_gtk_private.h" +/* Callbacks */ +static void _mb_bframe_pyramid (GtkToggleButton *button, + gpointer user_data); +static void _mb_inter_search_8 (GtkToggleButton *button, + gpointer user_data); +static void _mb_transform_8x8 (GtkToggleButton *button, + gpointer user_data); + + GtkWidget * _mb_page (X264_Gui_Config *config) { @@ -10,13 +20,17 @@ _mb_page (X264_Gui_Config *config) GtkWidget *frame; GtkWidget *vbox2; GtkWidget *table; + GtkWidget *eb; GtkWidget *label; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); /* Partitions */ - frame = gtk_frame_new ("Partitions"); + frame = gtk_frame_new (_("Partitions")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -25,32 +39,56 @@ _mb_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), vbox2); gtk_widget_show (vbox2); - config->mb.partitions.transform_8x8 = gtk_check_button_new_with_label ("8x8 Transform"); + config->mb.partitions.transform_8x8 = gtk_check_button_new_with_label (_("8x8 Transform")); + gtk_tooltips_set_tip (tooltips, config->mb.partitions.transform_8x8, + _("8x8 Transform - description"), + ""); + g_signal_connect (G_OBJECT (config->mb.partitions.transform_8x8), + "toggled", + G_CALLBACK (_mb_transform_8x8), config); gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.transform_8x8, FALSE, TRUE, 0); gtk_widget_show (config->mb.partitions.transform_8x8); - config->mb.partitions.pframe_search_8 = gtk_check_button_new_with_label ("8x16, 16x8 and 8x8 P-frame search"); + config->mb.partitions.pframe_search_8 = gtk_check_button_new_with_label (_("8x16, 16x8 and 8x8 P-frame search")); + gtk_tooltips_set_tip (tooltips, config->mb.partitions.pframe_search_8, + _("8x16, 16x8 and 8x8 P-frame search - description"), + ""); gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.pframe_search_8, FALSE, TRUE, 0); gtk_widget_show (config->mb.partitions.pframe_search_8); - config->mb.partitions.bframe_search_8 = gtk_check_button_new_with_label ("8x16, 16x8 and 8x8 B-frame search"); + config->mb.partitions.bframe_search_8 = gtk_check_button_new_with_label (_("8x16, 16x8 and 8x8 B-frame search")); + gtk_tooltips_set_tip (tooltips, config->mb.partitions.bframe_search_8, + _("8x16, 16x8 and 8x8 B-frame search - description"), + ""); gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.bframe_search_8, FALSE, TRUE, 0); gtk_widget_show (config->mb.partitions.bframe_search_8); - config->mb.partitions.pframe_search_4 = gtk_check_button_new_with_label ("4x8, 8x4 and 4x4 P-frame search"); + config->mb.partitions.pframe_search_4 = gtk_check_button_new_with_label (_("4x8, 8x4 and 4x4 P-frame search")); + gtk_tooltips_set_tip (tooltips, config->mb.partitions.pframe_search_4, + _("4x8, 8x4 and 4x4 P-frame search - description"), + ""); gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.pframe_search_4, FALSE, TRUE, 0); gtk_widget_show (config->mb.partitions.pframe_search_4); - config->mb.partitions.inter_search_8 = gtk_check_button_new_with_label ("8x8 Intra search"); + config->mb.partitions.inter_search_8 = gtk_check_button_new_with_label (_("8x8 Intra search")); + gtk_tooltips_set_tip (tooltips, config->mb.partitions.inter_search_8, + _("8x8 Intra search - description"), + ""); + g_signal_connect (G_OBJECT (config->mb.partitions.inter_search_8), + "toggled", + G_CALLBACK (_mb_inter_search_8), config); gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.inter_search_8, FALSE, TRUE, 0); gtk_widget_show (config->mb.partitions.inter_search_8); - config->mb.partitions.inter_search_4 = gtk_check_button_new_with_label ("4x4 Intra search"); + config->mb.partitions.inter_search_4 = gtk_check_button_new_with_label (_("4x4 Intra search")); + gtk_tooltips_set_tip (tooltips, config->mb.partitions.inter_search_4, + _("4x4 Intra search - description"), + ""); gtk_box_pack_start (GTK_BOX (vbox2), config->mb.partitions.inter_search_4, FALSE, TRUE, 0); gtk_widget_show (config->mb.partitions.inter_search_4); /* B-Frames */ - frame = gtk_frame_new ("B-Frames"); + frame = gtk_frame_new (_("B-Frames")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -60,67 +98,104 @@ _mb_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Max consecutive"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Max consecutive - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Max consecutive")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); - config->mb.bframes.max_consecutive = gtk_entry_new_with_max_length (3); - gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.max_consecutive, + config->mb.bframes.bframe = gtk_entry_new_with_max_length (3); + gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe, 1, 2, 0, 1); - gtk_widget_show (config->mb.bframes.max_consecutive); + gtk_widget_show (config->mb.bframes.bframe); + + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Bias - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 1, 2); + gtk_widget_show (eb); - label = gtk_label_new ("Bias"); + label = gtk_label_new (_("Bias")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 1, 1, 2); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); - config->mb.bframes.bias = gtk_hscale_new_with_range (-100.0, 100.0, 1.0); - gtk_scale_set_digits (GTK_SCALE (config->mb.bframes.bias), 0); - gtk_scale_set_value_pos (GTK_SCALE (config->mb.bframes.bias), GTK_POS_RIGHT); - gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bias, + config->mb.bframes.bframe_bias = gtk_hscale_new_with_range (-100.0, 100.0, 1.0); + gtk_scale_set_digits (GTK_SCALE (config->mb.bframes.bframe_bias), 0); + gtk_scale_set_value_pos (GTK_SCALE (config->mb.bframes.bframe_bias), GTK_POS_RIGHT); + gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe_bias, 1, 2, 1, 2); - gtk_widget_show (config->mb.bframes.bias); - - config->mb.bframes.use_as_reference = gtk_check_button_new_with_label ("Use as references"); - gtk_table_attach_defaults (GTK_TABLE (table), - config->mb.bframes.use_as_reference, + gtk_widget_show (config->mb.bframes.bframe_bias); + + config->mb.bframes.bframe_pyramid = gtk_check_button_new_with_label (_("Use as references")); + gtk_tooltips_set_tip (tooltips, config->mb.bframes.bframe_pyramid, + _("Use as references - description"), + ""); + g_signal_connect (G_OBJECT (config->mb.bframes.bframe_pyramid), + "toggled", + G_CALLBACK (_mb_bframe_pyramid), config); + gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe_pyramid, 0, 1, 2, 3); - gtk_widget_show (config->mb.bframes.use_as_reference); + gtk_widget_show (config->mb.bframes.bframe_pyramid); - config->mb.bframes.bidir_me = gtk_check_button_new_with_label ("Bidirectional ME"); - gtk_table_attach_defaults (GTK_TABLE (table), - config->mb.bframes.bidir_me, + config->mb.bframes.bidir_me = gtk_check_button_new_with_label (_("Bidirectional ME")); + gtk_tooltips_set_tip (tooltips, config->mb.bframes.bidir_me, + _("Bidirectional ME - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bidir_me, 1, 2, 2, 3); gtk_widget_show (config->mb.bframes.bidir_me); - config->mb.bframes.adaptive = gtk_check_button_new_with_label ("Adaptive"); - gtk_table_attach_defaults (GTK_TABLE (table), - config->mb.bframes.adaptive, + config->mb.bframes.bframe_adaptive = gtk_check_button_new_with_label (_("Adaptive")); + gtk_tooltips_set_tip (tooltips, config->mb.bframes.bframe_adaptive, + _("Adaptive - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.bframe_adaptive, 0, 1, 3, 4); - gtk_widget_show (config->mb.bframes.adaptive); + gtk_widget_show (config->mb.bframes.bframe_adaptive); - config->mb.bframes.weighted_biprediction = gtk_check_button_new_with_label ("Weighted biprediction"); - gtk_table_attach_defaults (GTK_TABLE (table), - config->mb.bframes.weighted_biprediction, + config->mb.bframes.weighted_bipred = gtk_check_button_new_with_label (_("Weighted biprediction")); + gtk_tooltips_set_tip (tooltips, config->mb.bframes.weighted_bipred, + _("Weighted biprediction - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.weighted_bipred, 1, 2, 3, 4); - gtk_widget_show (config->mb.bframes.weighted_biprediction); + gtk_widget_show (config->mb.bframes.weighted_bipred); + + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Direct mode - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 4, 5); + gtk_widget_show (eb); - label = gtk_label_new ("Direct mode"); + label = gtk_label_new (_("Direct mode")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 1, 4, 5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->mb.bframes.direct_mode = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode), - "None"); + _("None")); + gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode), + _("Spatial")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode), - "Spatial"); + _("Temporal")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->mb.bframes.direct_mode), - "Temporal"); + _("Auto")); gtk_table_attach_defaults (GTK_TABLE (table), config->mb.bframes.direct_mode, 1, 2, 4, 5); @@ -128,3 +203,48 @@ _mb_page (X264_Gui_Config *config) return vbox; } + +static void +_mb_bframe_pyramid (GtkToggleButton *button, + gpointer user_data) +{ + X264_Gui_Config *config; + + config = (X264_Gui_Config *)user_data; + + if (gtk_toggle_button_get_active (button)) { + const gchar *text; + gint val; + + text = gtk_entry_get_text (GTK_ENTRY (config->mb.bframes.bframe)); + val = (gint)g_ascii_strtoull (text, NULL, 10); + if (val < 2) + gtk_entry_set_text (GTK_ENTRY (config->mb.bframes.bframe), "2"); + } +} + +static void +_mb_inter_search_8 (GtkToggleButton *button, + gpointer user_data) +{ + X264_Gui_Config *config; + + config = (X264_Gui_Config *)user_data; + + if (gtk_toggle_button_get_active (button)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.transform_8x8), TRUE); + } +} + +static void +_mb_transform_8x8 (GtkToggleButton *button, + gpointer user_data) +{ + X264_Gui_Config *config; + + config = (X264_Gui_Config *)user_data; + + if (!gtk_toggle_button_get_active (button)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->mb.partitions.inter_search_8), FALSE); + } +} diff --git a/gtk/x264_gtk_more.c b/gtk/x264_gtk_more.c index aa569d98..1de1a76e 100644 --- a/gtk/x264_gtk_more.c +++ b/gtk/x264_gtk_more.c @@ -1,5 +1,6 @@ #include +#include "x264_gtk_i18n.h" #include "x264_gtk_private.h" @@ -8,6 +9,8 @@ static void _more_deblocking_filter (GtkToggleButton *button, gpointer user_data); static void _more_cabac (GtkToggleButton *button, gpointer user_data); +static void _more_mixed_ref (GtkToggleButton *button, + gpointer user_data); GtkWidget * @@ -17,26 +20,31 @@ _more_page (X264_Gui_Config *config) GtkWidget *frame; GtkWidget *hbox; GtkWidget *table; + GtkWidget *eb; GtkWidget *label; + GtkObject *adj; GtkRequisition size; GtkRequisition size2; GtkRequisition size3; GtkRequisition size4; GtkRequisition size5; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); label = gtk_entry_new_with_max_length (3); gtk_widget_size_request (label, &size); gtk_widget_destroy (GTK_WIDGET (label)); - label = gtk_check_button_new_with_label ("Deblocking Filter"); + label = gtk_check_button_new_with_label (_("Deblocking Filter")); gtk_widget_size_request (label, &size2); gtk_widget_destroy (GTK_WIDGET (label)); - label = gtk_label_new ("Partition decision"); + label = gtk_label_new (_("Partition decision")); gtk_widget_size_request (label, &size3); gtk_widget_destroy (GTK_WIDGET (label)); - label = gtk_label_new ("Threshold"); + label = gtk_label_new (_("Threshold")); gtk_widget_size_request (label, &size5); gtk_widget_destroy (GTK_WIDGET (label)); @@ -44,27 +52,35 @@ _more_page (X264_Gui_Config *config) gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); /* Motion Estimation */ - frame = gtk_frame_new ("Motion Estimation"); + frame = gtk_frame_new (_("Motion Estimation")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); - table = gtk_table_new (4, 3, TRUE); + table = gtk_table_new (5, 3, TRUE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_container_set_border_width (GTK_CONTAINER (table), 6); gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Partition decision"); + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Partition decision - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Partition decision")); gtk_widget_set_size_request (label, size2.width, size3.height); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 2, 0, 1); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.motion_estimation.partition_decision = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), - "1 (Fastest)"); + _("1 (Fastest)")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), "2"); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), @@ -72,39 +88,55 @@ _more_page (X264_Gui_Config *config) gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), "4"); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), - "5 (High quality)"); + _("5 (High quality)")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), - "6 (RDO)"); + _("6 (RDO)")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.partition_decision), - "6b (RDO on B frames)"); + _("6b (RDO on B frames)")); gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.partition_decision, 1, 3, 0, 1); gtk_widget_show (config->more.motion_estimation.partition_decision); - label = gtk_label_new ("Method"); + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Method - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 1, 2); + gtk_widget_show (eb); + + label = gtk_label_new (_("Method")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 2, 1, 2); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.motion_estimation.method = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method), - "Diamond Search"); + _("Diamond Search")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method), - "Hexagonal Search"); + _("Hexagonal Search")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method), - "Uneven Multi-Hexagon"); + _("Uneven Multi-Hexagon")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.motion_estimation.method), - "Exhaustive search"); + _("Exhaustive search")); gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.method, 1, 3, 1, 2); gtk_widget_show (config->more.motion_estimation.method); - label = gtk_label_new ("Range"); + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Range - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 2, 3); + gtk_widget_show (eb); + + label = gtk_label_new (_("Range")); gtk_widget_size_request (label, &size4); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 1, 2, 3); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.motion_estimation.range = gtk_entry_new_with_max_length (3); @@ -114,15 +146,26 @@ _more_page (X264_Gui_Config *config) 1, 2, 2, 3); gtk_widget_show (config->more.motion_estimation.range); - config->more.motion_estimation.chroma_me = gtk_check_button_new_with_label ("Chroma ME"); + config->more.motion_estimation.chroma_me = gtk_check_button_new_with_label (_("Chroma ME")); + gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.chroma_me, + _("Chroma ME - description"), + ""); gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.chroma_me, 2, 3, 2, 3); gtk_widget_show (config->more.motion_estimation.chroma_me); - label = gtk_label_new ("Max Ref. frames"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Max Ref. frames - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 3, 4); + gtk_widget_show (eb); + + label = gtk_label_new (_("Max Ref. frames")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.motion_estimation.max_ref_frames = gtk_entry_new_with_max_length (3); @@ -132,13 +175,27 @@ _more_page (X264_Gui_Config *config) 1, 2, 3, 4); gtk_widget_show (config->more.motion_estimation.max_ref_frames); - config->more.motion_estimation.mixed_refs = gtk_check_button_new_with_label ("Mixed Refs"); + config->more.motion_estimation.mixed_refs = gtk_check_button_new_with_label (_("Mixed Refs")); + gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.mixed_refs, + _("Mixed Refs - description"), + ""); + g_signal_connect (G_OBJECT (config->more.motion_estimation.mixed_refs), + "toggled", + G_CALLBACK (_more_mixed_ref), config); gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.mixed_refs, 2, 3, 3, 4); gtk_widget_show (config->more.motion_estimation.mixed_refs); + config->more.motion_estimation.fast_pskip = gtk_check_button_new_with_label (_("Fast P skip")); + gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.fast_pskip, + _("Fast P skip - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.fast_pskip, + 0, 1, 4, 5); + gtk_widget_show (config->more.motion_estimation.fast_pskip); + /* Misc. Options */ - frame = gtk_frame_new ("Misc. Options"); + frame = gtk_frame_new (_("Misc. Options")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -149,10 +206,18 @@ _more_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Sample AR"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Sample Aspect Ratio - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Sample Aspect Ratio")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); hbox = gtk_hbox_new (TRUE, 6); @@ -170,21 +235,34 @@ _more_page (X264_Gui_Config *config) gtk_box_pack_start (GTK_BOX (hbox), config->more.misc.sample_ar_y, FALSE, TRUE, 0); gtk_widget_show (config->more.misc.sample_ar_y); - label = gtk_label_new ("Threads"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Threads - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 2, 3, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Threads")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); - config->more.misc.threads = gtk_entry_new_with_max_length (3); + adj = gtk_adjustment_new (1.0, 1.0, 4.0, 1.0, 1.0, 1.0); + config->more.misc.threads = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1.0, 0); + gtk_widget_set_size_request (config->more.misc.threads, size5.width, size.height); gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.threads, 3, 4, 0, 1); gtk_widget_show (config->more.misc.threads); - config->more.misc.cabac = gtk_check_button_new_with_label ("CABAC"); + config->more.misc.cabac = gtk_check_button_new_with_label (_("CABAC")); gtk_widget_set_size_request (config->more.misc.cabac, size5.width, size.height); + gtk_tooltips_set_tip (tooltips, config->more.misc.cabac, + _("CABAC - description"), + ""); g_signal_connect (G_OBJECT (config->more.misc.cabac), "toggled", G_CALLBACK (_more_cabac), config); @@ -192,27 +270,43 @@ _more_page (X264_Gui_Config *config) 0, 1, 1, 2); gtk_widget_show (config->more.misc.cabac); - label = gtk_label_new ("Trellis"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Trellis - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 1, 2, 1, 2); + gtk_widget_show (eb); + + label = gtk_label_new (_("Trellis")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.misc.trellis = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.misc.trellis), - "Disabled"); + _("Disabled")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.misc.trellis), - "Enabled (once)"); + _("Enabled (once)")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.misc.trellis), - "Enabled (mode decision)"); + _("Enabled (mode decision)")); gtk_table_attach_defaults (GTK_TABLE (table), config->more.misc.trellis, 2, 4, 1, 2); gtk_widget_show (config->more.misc.trellis); - label = gtk_label_new ("Noise reduction"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Noise reduction - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 2, 3); + gtk_widget_show (eb); + + label = gtk_label_new (_("Noise reduction")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.misc.noise_reduction = gtk_entry_new_with_max_length (3); @@ -221,7 +315,10 @@ _more_page (X264_Gui_Config *config) 1, 2, 2, 3); gtk_widget_show (config->more.misc.noise_reduction); - config->more.misc.df.deblocking_filter = gtk_check_button_new_with_label ("Deblocking Filter"); + config->more.misc.df.deblocking_filter = gtk_check_button_new_with_label (_("Deblocking Filter")); + gtk_tooltips_set_tip (tooltips, config->more.misc.df.deblocking_filter, + _("Deblocking Filter - description"), + ""); g_signal_connect (G_OBJECT (config->more.misc.df.deblocking_filter), "toggled", G_CALLBACK (_more_deblocking_filter), config); @@ -229,11 +326,19 @@ _more_page (X264_Gui_Config *config) 0, 1, 3, 4); gtk_widget_show (config->more.misc.df.deblocking_filter); - label = gtk_label_new ("Strength"); + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Strength - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 1, 2, 3, 4); + gtk_widget_show (eb); + + label = gtk_label_new (_("Strength")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_set_size_request (label, size5.width, size4.height); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 1, 2, 3, 4); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.misc.df.strength = gtk_hscale_new_with_range (-6.0, 6.0, 1.0); @@ -245,11 +350,19 @@ _more_page (X264_Gui_Config *config) 2, 4, 3, 4); gtk_widget_show (config->more.misc.df.strength); - label = gtk_label_new ("Threshold"); + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Threshold - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 1, 2, 4, 5); + gtk_widget_show (eb); + + label = gtk_label_new (_("Threshold")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_set_size_request (label, size5.width, size4.height); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 1, 2, 4, 5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.misc.df.threshold = gtk_hscale_new_with_range (-6.0, 6.0, 1.0); @@ -260,7 +373,7 @@ _more_page (X264_Gui_Config *config) gtk_widget_show (config->more.misc.df.threshold); /* Debug */ - frame = gtk_frame_new ("Debug"); + frame = gtk_frame_new (_("Debug")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -270,38 +383,54 @@ _more_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Log level"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_widget_set_size_request (label, size2.width, size3.height); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Log level - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Log level")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.debug.log_level = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level), - "None"); + _("None")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level), - "Error"); + _("Error")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level), - "Warning"); + _("Warning")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level), - "Info"); + _("Info")); gtk_combo_box_append_text (GTK_COMBO_BOX (config->more.debug.log_level), - "Debug"); + _("Debug")); gtk_table_attach_defaults (GTK_TABLE (table), config->more.debug.log_level, 1, 2, 0, 1); gtk_widget_show (config->more.debug.log_level); + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("FourCC - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 1, 2); + gtk_widget_show (eb); + label = gtk_label_new ("FourCC"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 1, 1, 2); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->more.debug.fourcc = gtk_entry_new_with_max_length (4); gtk_table_attach_defaults (GTK_TABLE (table), config->more.debug.fourcc, 1, 2, 1, 2); + gtk_widget_set_sensitive (config->more.debug.fourcc, FALSE); gtk_widget_show (config->more.debug.fourcc); @@ -341,3 +470,22 @@ _more_cabac (GtkToggleButton *button, else gtk_widget_set_sensitive (config->more.misc.trellis, FALSE); } + +static void +_more_mixed_ref (GtkToggleButton *button, + gpointer user_data) +{ + X264_Gui_Config *config; + + config = (X264_Gui_Config *)user_data; + + if (gtk_toggle_button_get_active (button)) { + const gchar *text; + gint val; + + text = gtk_entry_get_text (GTK_ENTRY (config->more.motion_estimation.max_ref_frames)); + val = (gint)g_ascii_strtoull (text, NULL, 10); + if (val < 2) + gtk_entry_set_text (GTK_ENTRY (config->more.motion_estimation.max_ref_frames), "2"); + } +} diff --git a/gtk/x264_gtk_private.h b/gtk/x264_gtk_private.h index cff90527..d0aeeb1b 100644 --- a/gtk/x264_gtk_private.h +++ b/gtk/x264_gtk_private.h @@ -9,6 +9,7 @@ typedef struct Bitrate_ Bitrate; typedef struct Rate_Control_ Rate_Control; typedef struct MB_ MB; typedef struct More_ More; +typedef struct Cqm_ Cqm; typedef struct Zones_ Zones; typedef struct X264_Gui_Config_ X264_Gui_Config; typedef struct X264_Gui_Zone_ X264_Gui_Zone; @@ -51,6 +52,14 @@ struct Rate_Control_ GtkWidget *max_idr_frame_interval; }scene_cuts; + /* VBV */ + struct + { + GtkWidget *vbv_max_bitrate; + GtkWidget *vbv_buffer_size; + GtkWidget *vbv_buffer_init; + }vbv; + }; struct MB_ @@ -69,12 +78,12 @@ struct MB_ /* B-frames */ struct { - GtkWidget *use_as_reference; + GtkWidget *bframe_pyramid; GtkWidget *bidir_me; - GtkWidget *adaptive; - GtkWidget *weighted_biprediction; - GtkWidget *max_consecutive; - GtkWidget *bias; + GtkWidget *bframe_adaptive; + GtkWidget *weighted_bipred; + GtkWidget *bframe; + GtkWidget *bframe_bias; GtkWidget *direct_mode; }bframes; @@ -91,6 +100,7 @@ struct More_ GtkWidget *chroma_me; GtkWidget *max_ref_frames; GtkWidget *mixed_refs; + GtkWidget *fast_pskip; }motion_estimation; /* Misc. Options */ @@ -120,6 +130,20 @@ struct More_ }; +struct Cqm_ +{ + GtkWidget *radio_flat; + GtkWidget *radio_jvt; + GtkWidget *radio_custom; + GtkWidget *cqm_file; + GtkWidget *cqm_4iy[16]; + GtkWidget *cqm_4ic[16]; + GtkWidget *cqm_4py[16]; + GtkWidget *cqm_4pc[16]; + GtkWidget *cqm_8iy[64]; + GtkWidget *cqm_8py[64]; +}; + struct Zones_ { GtkWidget *list_zones; @@ -131,6 +155,7 @@ struct X264_Gui_Config_ Rate_Control rate_control; MB mb; More more; + Cqm cqm; Zones zones; }; @@ -142,5 +167,7 @@ struct X264_Gui_Zone_ GtkWidget *entry_weight; }; +gchar *x264_gtk_path (const char* more_path); + #endif /* __X264_GTK_PRIVATE_H__ */ diff --git a/gtk/x264_gtk_rc.c b/gtk/x264_gtk_rc.c index cdff2a1c..cd011388 100644 --- a/gtk/x264_gtk_rc.c +++ b/gtk/x264_gtk_rc.c @@ -1,5 +1,6 @@ #include +#include "x264_gtk_i18n.h" #include "x264_gtk_private.h" @@ -13,16 +14,20 @@ static void _insert_numeric (GtkEditable *editable, GtkWidget * _rate_control_page (X264_Gui_Config *config) { - GtkWidget *vbox; - GtkWidget *frame; - GtkWidget *table; - GtkWidget *label; + GtkWidget *vbox; + GtkWidget *frame; + GtkWidget *table; + GtkWidget *eb; + GtkWidget *label; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); /* bitrate */ - frame = gtk_frame_new ("Bitrate"); + frame = gtk_frame_new (_("Bitrate")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -32,10 +37,18 @@ _rate_control_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Keyframe boost (%)"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Keyframe boost - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Keyframe boost (%)")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.bitrate.keyframe_boost = gtk_entry_new_with_max_length (3); @@ -48,10 +61,18 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 0, 1); gtk_widget_show (config->rate_control.bitrate.keyframe_boost); - label = gtk_label_new ("B-frames reduction (%)"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("B-frames reduction - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 1, 2); + gtk_widget_show (eb); + + label = gtk_label_new (_("B-frames reduction (%)")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.bitrate.bframes_reduction = gtk_entry_new_with_max_length (5); @@ -60,10 +81,18 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 1, 2); gtk_widget_show (config->rate_control.bitrate.bframes_reduction); - label = gtk_label_new ("Bitrate variability (%)"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Bitrate variability - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 2, 3); + gtk_widget_show (eb); + + label = gtk_label_new (_("Bitrate variability (%)")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.bitrate.bitrate_variability = gtk_entry_new_with_max_length (3); @@ -73,7 +102,7 @@ _rate_control_page (X264_Gui_Config *config) gtk_widget_show (config->rate_control.bitrate.bitrate_variability); /* Quantization limits */ - frame = gtk_frame_new ("Quantization limits"); + frame = gtk_frame_new (_("Quantization limits")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -83,10 +112,18 @@ _rate_control_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Min QP"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Min QP - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Min QP")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.quantization_limits.min_qp = gtk_entry_new_with_max_length (3); @@ -95,10 +132,18 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 0, 1); gtk_widget_show (config->rate_control.quantization_limits.min_qp); - label = gtk_label_new ("Max QP"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Max QP - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 1, 2); + gtk_widget_show (eb); + + label = gtk_label_new (_("Max QP")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.quantization_limits.max_qp = gtk_entry_new_with_max_length (3); @@ -107,10 +152,18 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 1, 2); gtk_widget_show (config->rate_control.quantization_limits.max_qp); - label = gtk_label_new ("Max QP Step"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Max QP Step - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 2, 3); + gtk_widget_show (eb); + + label = gtk_label_new (_("Max QP Step")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.quantization_limits.max_qp_step = gtk_entry_new_with_max_length (3); @@ -120,7 +173,7 @@ _rate_control_page (X264_Gui_Config *config) gtk_widget_show (config->rate_control.quantization_limits.max_qp_step); /* Scene Cuts */ - frame = gtk_frame_new ("Scene Cuts"); + frame = gtk_frame_new (_("Scene Cuts")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); gtk_widget_show (frame); @@ -130,10 +183,18 @@ _rate_control_page (X264_Gui_Config *config) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - label = gtk_label_new ("Scene Cut Threshold"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Scene Cut Threshold - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Scene Cut Threshold")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.scene_cuts.scene_cut_threshold = gtk_entry_new_with_max_length (3); @@ -142,10 +203,18 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 0, 1); gtk_widget_show (config->rate_control.scene_cuts.scene_cut_threshold); - label = gtk_label_new ("Min IDR-frame interval"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Min IDR-frame interval - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 1, 2); + gtk_widget_show (eb); + + label = gtk_label_new (_("Min IDR-frame interval")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.scene_cuts.min_idr_frame_interval = gtk_entry_new_with_max_length (3); @@ -154,10 +223,18 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 1, 2); gtk_widget_show (config->rate_control.scene_cuts.min_idr_frame_interval); - label = gtk_label_new ("Max IDR-frame interval"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Max IDR-frame interval - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, 0, 1, 2, 3); + gtk_widget_show (eb); + + label = gtk_label_new (_("Max IDR-frame interval")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); gtk_widget_show (label); config->rate_control.scene_cuts.max_idr_frame_interval = gtk_entry_new_with_max_length (3); @@ -166,6 +243,76 @@ _rate_control_page (X264_Gui_Config *config) 1, 2, 2, 3); gtk_widget_show (config->rate_control.scene_cuts.max_idr_frame_interval); + /* vbv */ + frame = gtk_frame_new (_("Video buffer verifier")); + gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); + gtk_widget_show (frame); + + table = gtk_table_new (3, 2, TRUE); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_container_set_border_width (GTK_CONTAINER (table), 6); + gtk_container_add (GTK_CONTAINER (frame), table); + gtk_widget_show (table); + + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Max local bitrate - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 0, 1); + gtk_widget_show (eb); + + label = gtk_label_new (_("Max local bitrate")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); + gtk_widget_show (label); + + config->rate_control.vbv.vbv_max_bitrate = gtk_entry_new_with_max_length (3); + gtk_table_attach_defaults (GTK_TABLE (table), + config->rate_control.vbv.vbv_max_bitrate, + 1, 2, 0, 1); + gtk_widget_show (config->rate_control.vbv.vbv_max_bitrate); + + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("VBV buffer size - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 1, 2); + gtk_widget_show (eb); + + label = gtk_label_new (_("VBV buffer size")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); + gtk_widget_show (label); + + config->rate_control.vbv.vbv_buffer_size = gtk_entry_new_with_max_length (3); + gtk_table_attach_defaults (GTK_TABLE (table), + config->rate_control.vbv.vbv_buffer_size, + 1, 2, 1, 2); + gtk_widget_show (config->rate_control.vbv.vbv_buffer_size); + + eb = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (eb), FALSE); + gtk_tooltips_set_tip (tooltips, eb, + _("Initial VBV buffer occupancy - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), eb, + 0, 1, 2, 3); + gtk_widget_show (eb); + + label = gtk_label_new (_("Initial VBV buffer occupancy")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_container_add (GTK_CONTAINER (eb), label); + gtk_widget_show (label); + + config->rate_control.vbv.vbv_buffer_init = gtk_entry_new_with_max_length (3); + gtk_table_attach_defaults (GTK_TABLE (table), + config->rate_control.vbv.vbv_buffer_init, + 1, 2, 2, 3); + gtk_widget_show (config->rate_control.vbv.vbv_buffer_init); return vbox; } -- 2.40.0