From: Loren Merritt Date: Fri, 28 Jul 2006 21:39:07 +0000 (+0000) Subject: GTK update. patch by Vincent Torri. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75d6edb847722b1058914a2effcc6d47c5b7971a;p=libx264 GTK update. patch by Vincent Torri. fixed: cleaning of Makefile time elapsed seems broken ('total time' label replaced by 'time remaining') text entries of the status window are now not editable added: compilation from x264/ (add --enable-gtk option to configure) shared lib creation if --enable-shared is passed to configure x264gtk.pc --b-rdo, --no-dct-decimate git-svn-id: svn://svn.videolan.org/x264/trunk@539 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/Makefile b/Makefile index 323a7547..2f3ed343 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ OBJS = $(SRCS:%.c=%.o) OBJCLI = $(SRCCLI:%.c=%.o) DEP = depend -.PHONY: default fprofiled clean distclean install uninstall +.PHONY: default fprofiled clean distclean install install-gtk uninstall default: $(DEP) x264$(EXE) libx264.a: .depend $(OBJS) $(OBJASM) @@ -76,6 +76,9 @@ x264$(EXE): $(OBJCLI) libx264.a x264vfw.dll: libx264.a $(wildcard vfw/*.c vfw/*.h) $(MAKE) -C vfw/build/cygwin +libx264gtk.a: muxers.o libx264.a + $(MAKE) -C gtk + checkasm: tools/checkasm.o libx264.a $(CC) -o $@ $+ $(LDFLAGS) @@ -132,7 +135,8 @@ clean: $(MAKE) -C gtk clean distclean: clean - rm -f config.mak config.h vfw/build/cygwin/config.mak gtk/config.mak x264.pc + rm -f config.mak config.h vfw/build/cygwin/config.mak x264.pc + $(MAKE) -C gtk distclean install: x264 $(SONAME) install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) @@ -145,10 +149,14 @@ install: x264 $(SONAME) $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so) $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir)) +install-gtk: libx264gtk.a + $(MAKE) -C gtk install + uninstall: rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a rm -f $(DESTDIR)$(bindir)/x264 $(DESTDIR)$(libdir)/pkgconfig/x264.pc $(if $(SONAME), rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.so) + $(MAKE) -C gtk uninstall etags: TAGS diff --git a/configure b/configure index 01f6cb14..afe3eab5 100755 --- a/configure +++ b/configure @@ -10,6 +10,7 @@ echo " --help print this message" echo " --enable-avis-input enables avisynth input (win32 only)" echo " --enable-mp4-output enables mp4 output (using gpac)" echo " --enable-vfw compiles the VfW frontend" +echo " --enable-gtk build GTK+ interface" echo " --enable-pthread enables multithreaded encoding" echo " --enable-debug adds -g, doesn't strip" echo " --enable-gprof adds -pg, doesn't strip" @@ -51,6 +52,7 @@ debug="no" gprof="no" pic="no" vfw="no" +gtk="no" vis="no" shared="no" @@ -255,6 +257,12 @@ for opt do --disable-vfw) vfw="no" ;; + --enable-gtk) + gtk="yes" + ;; + --disable-gtk) + gtk="no" + ;; --enable-shared) shared="yes" if [ $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" ] ; then @@ -355,6 +363,7 @@ LDFLAGS=$LDFLAGS AS=$AS ASFLAGS=$ASFLAGS VFW=$vfw +GTK=$gtk EXE=$EXE VIS=$vis HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG @@ -382,6 +391,14 @@ if [ "$shared" = "yes" ]; then API=`grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' '` echo "SONAME=libx264.so.$API" >> config.mak echo 'default: $(SONAME)' >> config.mak + if [ "$gtk" = "yes" ]; then + echo "SONAMEGTK=libx264gtk.so.$API" >> gtk/config.mak + fi +fi + +if [ "$gtk" = "yes" ]; then + echo 'default: libx264gtk.a' >> config.mak + echo 'install: install-gtk' >> config.mak fi ./version.sh @@ -416,6 +433,7 @@ echo "avis input: $avis_input" echo "mp4 output: $mp4_output" echo "pthread: $pthread" echo "vfw: $vfw" +echo "gtk: $gtk" echo "debug: $debug" echo "gprof: $gprof" echo "PIC: $pic" diff --git a/gtk/Makefile b/gtk/Makefile index e064af5f..88db89f7 100644 --- a/gtk/Makefile +++ b/gtk/Makefile @@ -5,22 +5,19 @@ include config.mak ifeq ($(SYS),MINGW) datadir=. -TEST_OBJECTS+=x264gtk.o -LDFLAGS+=-mwindows -XGETTEXT=xgettext.exe X264GTK_O = x264gtk.o +TEST_OBJECTS+=$(X264GTK_O) +LDFLAGS+=-mwindows ICONV_LIB = -liconv -TEST_BIN = test.exe -ENCODE_BIN = x264_gtk_encode.exe else datadir=${prefix}/share -XGETTEXT=xgettext X264GTK_O = ICONV_LIB = -TEST_BIN = test -ENCODE_BIN = x264_gtk_encode endif +XGETTEXT=xgettext$(EXE) +TEST_BIN = test$(EXE) +ENCODE_BIN = x264_gtk_encode$(EXE) # PO / MO files PO_FILES = $(shell ls *.po) @@ -47,14 +44,16 @@ x264_gtk_encode.o OBJECTS_ALL = $(OBJECTS_LIB) $(OBJECTS_TEST) $(OBJECTS_ENCODE) SOURCES_ALL = $(OBJECTS_ALL:%.o=%.c) +X264GTK_PC = x264gtk.pc + EXTERNAL_DEPS= ../muxers.o ../matroska.o ../libx264.a -all: $(ENCODE_BIN) $(TEST_BIN) $(MO_FILES) +all: $(ENCODE_BIN) $(TEST_BIN) $(MO_FILES) $(X264GTK_PC) # 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` +LDFLAGS += `pkg-config --libs gtk+-2.0 gthread-2.0` ../libx264.a # gettext rules @@ -92,6 +91,10 @@ libx264gtk.a: $(OBJECTS_LIB) @ar rc libx264gtk.a $(OBJECTS_LIB) @ranlib libx264gtk.a +$(SONAMEGTK): $(OBJECTS_LIB) + @echo " L: $(@F)" + @$(CC) -shared -o $@ $(OBJECTS_LIB) -Wl,-soname,$(SONAMEGTK) $(LDFLAGS) + # Program : test $(TEST_BIN): $(OBJECTS_LIB) $(OBJECTS_TEST) @echo " B: $(@F)" @@ -99,14 +102,34 @@ $(TEST_BIN): $(OBJECTS_LIB) $(OBJECTS_TEST) @$(CC) -o $(TEST_BIN) $(OBJECTS_LIB) $(OBJECTS_TEST) $(LDFLAGS) $(ICONV_LIB) -lintl # Program : x264_gtk_encode -$(ENCODE_BIN): $(OBJECTS_LIB) x264_icon.h libx264gtk.a $(OBJECTS_ENCODE) $(EXTERNAL_DEPS) $(X264GTK_O) +$(ENCODE_BIN): x264_icon.h libx264gtk.a $(SONAMEGTK) $(OBJECTS_ENCODE) $(EXTERNAL_DEPS) $(X264GTK_O) @echo " B: $(@F)" @$(CC) -o $(ENCODE_BIN) $(OBJECTS_LIB) $(OBJECTS_ENCODE) $(EXTERNAL_DEPS) $(LDFLAGS) $(X264GTK_O) +# x264gtk.pc file +$(X264GTK_PC): + @echo " S: $(X264GTK_PC)" + @rm -f $(X264GTK_PC) + @echo "prefix=$(DESTDIR)${prefix}" > $(X264GTK_PC) + @echo "exec_prefix=$(DESTDIR)${exec_prefix}" >> $(X264GTK_PC) + @echo "libdir=$(DESTDIR)${libdir}" >> $(X264GTK_PC) + @echo "includedir=$(DESTDIR)${includedir}" >> $(X264GTK_PC) + @echo "" >> $(X264GTK_PC) + @echo "Name: Gtk+ interface for X264" >> $(X264GTK_PC) + @echo "Description: Gtk+ interface to configure X264" >> $(X264GTK_PC) + @echo "Requires: x264" >> $(X264GTK_PC) + @echo "Version: 0.1" >> $(X264GTK_PC) + @echo "Libs: -L$(DESTDIR)$(libdir) -lx264gtk" >> $(X264GTK_PC) + @echo "Cflags: -I$(DESTDIR)$(includedir)" >> $(X264GTK_PC) + # Clean rule clean: @rm -f *.o *.mo x264_gtk.pot $(TEST_BIN) $(ENCODE_BIN) libx264gtk.a x264_icon.h x264gtk.o +# Distclean rule +distclean: + @rm -f config.mak $(X264GTK_PC) + # Install rule install: x264_gtk_encode @echo " I: $(DESTDIR)$(includedir)/x264_gtk.h" @@ -115,6 +138,9 @@ install: x264_gtk_encode @install -m 644 x264_gtk_enum.h "$(DESTDIR)$(includedir)" @echo " I: $(DESTDIR)$(libdir)/libx264gtk.a" @install -m 644 libx264gtk.a "$(DESTDIR)$(libdir)" + @echo " I: $(DESTDIR)$(libdir)/libx264gtk.so" + @$(if $(SONAMEGTK), ln -sf $(SONAMEGTK) $(DESTDIR)$(libdir)/libx264gtk.so) + @$(if $(SONAMEGTK), install -m 755 $(SONAMEGTK) $(DESTDIR)$(libdir)) @echo " I: $(DESTDIR)$(bindir)/x264_gtk_encode" @install x264_gtk_encode "$(DESTDIR)$(bindir)" @echo " D: ${prefix}/share/x264" @@ -127,6 +153,8 @@ install: x264_gtk_encode echo " I: $(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES/x264_gtk.mo"; \ install -m 644 $$L.mo "$(DESTDIR)${prefix}/share/locale/$$L/LC_MESSAGES/x264_gtk.mo"; \ done + @echo " I: ${libdir}/pkgconfig/$(X264GTK_PC)" + @install -m 644 $(X264GTK_PC) "$(DESTDIR)${libdir}/pkgconfig" # Uninstall rule uninstall: @@ -136,6 +164,9 @@ uninstall: @rm -f "$(DESTDIR)$(includedir)/x264_gtk_enum.h" @echo " U: $(DESTDIR)$(libdir)/libx264gtk.a" @rm -f "$(DESTDIR)$(libdir)/libx264gtk.a" + @echo " U: $(DESTDIR)$(libdir)/libx264gtk.so" + @$(if $(SONAMEGTK), rm -f "$(DESTDIR)$(libdir)/$(SONAMEGTK)") + @rm -f "$(DESTDIR)$(libdir)/libx264gtk.so" @echo " U: $(DESTDIR)$(bindir)/x264_gtk_encode" @rm -f "$(DESTDIR)$(bindir)/x264_gtk_encode" @echo " U: $(DESTDIR)${prefix}/share/x264" @@ -144,6 +175,8 @@ uninstall: 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 + @echo " U: $(DESTDIR)${libdir}/pkgconfig/$(X264GTK_PC)" + @rm -f "$(DESTDIR)${libdir}/pkgconfig/$(X264GTK_PC)" 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 diff --git a/gtk/fr.po b/gtk/fr.po index e86218eb..9c76e1bc 100644 --- a/gtk/fr.po +++ b/gtk/fr.po @@ -8,15 +8,15 @@ 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" +"POT-Creation-Date: 2006-06-22 16:00+0200\n" +"PO-Revision-Date: 2006-06-14 13:27+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 +#: test.c:48 #, c-format msgid "" "\n" @@ -25,7 +25,7 @@ msgstr "" "\n" "Diffère des valeurs par défaut\n" -#: test.c:45 +#: test.c:46 #, c-format msgid "" "\n" @@ -44,7 +44,7 @@ msgstr "%.2fKo/s (%.2f fps)" msgid "%dKB" msgstr "%dKo" -#: x264_gtk_encode_status_window.c:73 +#: x264_gtk_encode_status_window.c:74 msgid "0KB" msgstr "0Ko" @@ -207,7 +207,7 @@ msgstr "EM bidirectionnel" msgid "Bidirectional ME - description" msgstr "Estimation de mouvement bidirectionnel" -#: x264_gtk_rc.c:30 x264_gtk.c:236 +#: x264_gtk_rc.c:30 x264_gtk.c:238 msgid "Bitrate" msgstr "Débit" @@ -220,11 +220,11 @@ msgstr "Variabili msgid "Bitrate variability - description" msgstr "Variabilié du débit (%)" -#: x264_gtk_more.c:261 +#: x264_gtk_more.c:269 msgid "CABAC" msgstr "CABAC" -#: x264_gtk_more.c:264 +#: x264_gtk_more.c:272 msgid "CABAC - description" msgstr "" @@ -262,20 +262,29 @@ msgstr "Matrice personnalis msgid "Custom matrix - description" msgstr "Matrice personnalisée" -#: x264_gtk_more.c:39 x264_gtk_more.c:318 +#: x264_gtk_more.c:197 +msgid "DCT decimate" +msgstr "Décimation DCT" + +#: x264_gtk_more.c:199 +#, fuzzy +msgid "DCT decimate - description" +msgstr "Décimation DCT" + +#: x264_gtk_more.c:39 x264_gtk_more.c:326 msgid "Deblocking Filter" msgstr "Filtre de lissage" -#: x264_gtk_more.c:320 +#: x264_gtk_more.c:328 #, fuzzy msgid "Deblocking Filter - description" msgstr "Filtre de lissage" -#: x264_gtk_more.c:376 x264_gtk_more.c:410 +#: x264_gtk_more.c:384 x264_gtk_more.c:418 msgid "Debug" msgstr "Déboguage" -#: x264_gtk.c:215 +#: x264_gtk.c:217 msgid "Default" msgstr "Par défaut" @@ -292,7 +301,7 @@ msgstr "Mode direct" msgid "Direct mode - description" msgstr "Mode direct" -#: x264_gtk_more.c:289 +#: x264_gtk_more.c:297 msgid "Disabled" msgstr "Désactivé" @@ -300,11 +309,11 @@ msgstr "D msgid "Do you want to overwrite file\n" msgstr "" -#: x264_gtk_more.c:293 +#: x264_gtk_more.c:301 msgid "Enabled (mode decision)" msgstr "Activé (décision de mode)" -#: x264_gtk_more.c:291 +#: x264_gtk_more.c:299 msgid "Enabled (once)" msgstr "Activé" @@ -321,7 +330,7 @@ msgstr "Type de codage" msgid "Encoding type - description" msgstr "Type de codage" -#: x264_gtk_more.c:404 +#: x264_gtk_more.c:412 msgid "Error" msgstr "Erreurs" @@ -378,7 +387,7 @@ msgstr "Matrice plate" msgid "Flat matrix - description" msgstr "Matrice plate" -#: x264_gtk_more.c:418 +#: x264_gtk_more.c:426 msgid "FourCC - description" msgstr "" @@ -402,7 +411,7 @@ msgstr "Hauteur:" msgid "Hexagonal Search" msgstr "Recherche en hexagone" -#: x264_gtk_more.c:408 +#: x264_gtk_more.c:416 msgid "Info" msgstr "Information" @@ -440,24 +449,24 @@ msgstr "Bonus image cl msgid "Keyframe boost - description" msgstr "Bonus image clé (%)" -#: x264_gtk.c:174 +#: x264_gtk.c:176 #, c-format msgid "Loading configuration from %s\n" msgstr "Chargement de la configuration à partir de %s\n" -#: x264_gtk.c:166 +#: x264_gtk.c:168 msgid "Loading default configuration\n" msgstr "Chargement de la configuration par défaut\n" -#: x264_gtk_more.c:395 +#: x264_gtk_more.c:403 msgid "Log level" msgstr "Niveau de trace" -#: x264_gtk_more.c:389 +#: x264_gtk_more.c:397 msgid "Log level - description" msgstr "" -#: x264_gtk.c:250 +#: x264_gtk.c:252 msgid "MB & Frames" msgstr "MB et image" @@ -543,7 +552,7 @@ msgstr "QP min" msgid "Min QP - description" msgstr "" -#: x264_gtk_more.c:198 +#: x264_gtk_more.c:206 msgid "Misc. Options" msgstr "Options diverses" @@ -555,7 +564,7 @@ msgstr "R msgid "Mixed Refs - description" msgstr "" -#: x264_gtk.c:257 +#: x264_gtk.c:259 msgid "More..." msgstr "Plus..." @@ -575,16 +584,16 @@ msgstr "Plusieurs - premi msgid "Multipass - Nth Pass" msgstr "Plusieurs - passe N" -#: x264_gtk_more.c:307 +#: x264_gtk_more.c:315 msgid "Noise reduction" msgstr "Débruitage" -#: x264_gtk_more.c:301 +#: x264_gtk_more.c:309 #, fuzzy msgid "Noise reduction - description" msgstr "Débruitage" -#: x264_gtk_mb.c:192 x264_gtk_more.c:402 +#: x264_gtk_mb.c:192 x264_gtk_more.c:410 msgid "None" msgstr "Aucune" @@ -613,7 +622,7 @@ msgstr "Decision de la partition" msgid "Partitions" msgstr "Partitions" -#: x264_gtk_encode_status_window.c:117 +#: x264_gtk_encode_status_window.c:122 msgid "Progress:" msgstr "Progression:" @@ -621,7 +630,7 @@ msgstr "Progression:" msgid "Quantization limits" msgstr "Limite de quantification" -#: x264_gtk.c:264 +#: x264_gtk.c:266 msgid "Quantization matrices" msgstr "Matrices" @@ -641,15 +650,15 @@ msgstr "Port msgid "Range - description" msgstr "" -#: x264_gtk.c:243 +#: x264_gtk.c:245 msgid "Rate Control" msgstr "Contrôle de débit" -#: x264_gtk_more.c:218 +#: x264_gtk_more.c:226 msgid "Sample Aspect Ratio" msgstr "Ratio d'aspect de pixel" -#: x264_gtk_more.c:212 +#: x264_gtk_more.c:220 #, fuzzy msgid "Sample Aspect Ratio - description" msgstr "Ratio d'aspect de pixel" @@ -696,11 +705,11 @@ msgstr "Fichier de statistiques" msgid "Statistic file name" msgstr "Fichier de statistiques" -#: x264_gtk_more.c:338 +#: x264_gtk_more.c:346 msgid "Strength" msgstr "Force" -#: x264_gtk_more.c:332 +#: x264_gtk_more.c:340 msgid "Strength - description" msgstr "" @@ -712,35 +721,36 @@ msgstr "D msgid "Temporal" msgstr "Temporelle" -#: x264_gtk_more.c:247 +#: x264_gtk_more.c:255 msgid "Threads" msgstr "Tâches" -#: x264_gtk_more.c:241 +#: x264_gtk_more.c:249 msgid "Threads - description" msgstr "" -#: x264_gtk_more.c:47 x264_gtk_more.c:362 +#: x264_gtk_more.c:47 x264_gtk_more.c:370 msgid "Threshold" msgstr "Seuil" -#: x264_gtk_more.c:356 +#: x264_gtk_more.c:364 msgid "Threshold - description" msgstr "" -#: x264_gtk_encode_status_window.c:89 +#: x264_gtk_encode_status_window.c:92 msgid "Time elapsed:" msgstr "Temps écoulé:" -#: x264_gtk_encode_status_window.c:99 -msgid "Total time (estimated):" +#: x264_gtk_encode_status_window.c:103 +#, fuzzy +msgid "Time remaining (estimated):" msgstr "Temps total (estimé):" -#: x264_gtk_more.c:282 +#: x264_gtk_more.c:290 msgid "Trellis" msgstr "Treillis" -#: x264_gtk_more.c:276 +#: x264_gtk_more.c:284 msgid "Trellis - description" msgstr "" @@ -780,15 +790,15 @@ msgstr "Skip pour P rapide" msgid "Video buffer verifier" msgstr "" -#: x264_gtk_encode_status_window.c:67 +#: x264_gtk_encode_status_window.c:68 msgid "Video data:" msgstr "Données vidéo:" -#: x264_gtk_encode_status_window.c:78 +#: x264_gtk_encode_status_window.c:80 msgid "Video rendering rate:" msgstr "Vitesse de codage vidéo:" -#: x264_gtk_more.c:406 +#: x264_gtk_more.c:414 msgid "Warning" msgstr "Avertissements" @@ -805,12 +815,12 @@ msgstr "Bi-Pr msgid "Width:" msgstr "Largeur:" -#: x264_gtk.c:340 +#: x264_gtk.c:342 #, c-format msgid "Writing configuration to %s\n" msgstr "Ecriture de la configuration dans %s\n" -#: x264_gtk.c:210 +#: x264_gtk.c:212 msgid "X264 Configuration" msgstr "Configuration de X264" @@ -863,11 +873,11 @@ msgstr "fichier de sortie : %s\n" 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 +#: x264_gtk.c:801 msgid "problem...\n" msgstr "Problème...\n" -#: x264_gtk.c:165 +#: x264_gtk.c:167 #, c-format msgid "x264.cfg: %s\n" msgstr "" diff --git a/gtk/test.c b/gtk/test.c index c0bf6e6d..a4c5609f 100644 --- a/gtk/test.c +++ b/gtk/test.c @@ -3,7 +3,8 @@ #include -# define DECLARE_ALIGNED( type, var, n ) type var __attribute__((aligned(n))) +#define DECLARE_ALIGNED( type, var, n ) type var __attribute__((aligned(n))) + #include "../x264.h" #include "../common/common.h" diff --git a/gtk/x264_gtk.c b/gtk/x264_gtk.c index 6e19538c..7f3da5e9 100644 --- a/gtk/x264_gtk.c +++ b/gtk/x264_gtk.c @@ -121,6 +121,8 @@ x264_param_t *x264_gtk_param_get (X264_Gtk *x264_gtk) 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->analyse.b_dct_decimate = x264_gtk->dct_decimate; + /* rdo : RD based mode decision for B-frames. Requires subme 6 */ param->vui.i_sar_width = x264_gtk->sample_ar_x; param->vui.i_sar_height = x264_gtk->sample_ar_y; @@ -383,9 +385,9 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) gtk_widget_set_sensitive (config->bitrate.statsfile_name, FALSE); /* rate control */ - g_snprintf (buf, 64, "%d", round((param.rc.f_ip_factor - 1) * 100)); + g_snprintf (buf, 64, "%d", round((param.rc.f_ip_factor - 1.0) * 100)); gtk_entry_set_text (GTK_ENTRY (config->rate_control.bitrate.keyframe_boost), buf); - g_snprintf (buf, 64, "%d", round((param.rc.f_pb_factor - 1) * 100)); + g_snprintf (buf, 64, "%d", round((param.rc.f_pb_factor - 1.0) * 100)); gtk_entry_set_text (GTK_ENTRY (config->rate_control.bitrate.bframes_reduction), buf); g_snprintf (buf, 64, "%d", (gint)(param.rc.f_qcompress * 100)); gtk_entry_set_text (GTK_ENTRY (config->rate_control.bitrate.bitrate_variability), buf); @@ -441,6 +443,7 @@ _default_load (GtkButton *button __UNUSED__, gpointer user_data) 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); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.dct_decimate), param.analyse.b_dct_decimate); g_snprintf (buf, 64, "%d", param.vui.i_sar_width); gtk_entry_set_text (GTK_ENTRY (config->more.misc.sample_ar_x), buf); @@ -515,8 +518,8 @@ _default_set (X264_Gtk *x264_gtk) memcpy (x264_gtk->statsfile_name, text, strlen (text) + 1); /* rate control */ - x264_gtk->keyframe_boost = round((param.rc.f_ip_factor - 1) * 100); - x264_gtk->bframes_reduction = round((param.rc.f_pb_factor - 1) * 100); + x264_gtk->keyframe_boost = round((param.rc.f_ip_factor - 1.0) * 100); + x264_gtk->bframes_reduction = round((param.rc.f_pb_factor - 1.0) * 100); x264_gtk->bitrate_variability = round(param.rc.f_qcompress * 100); x264_gtk->min_qp = param.rc.i_qp_min; @@ -566,6 +569,7 @@ _default_set (X264_Gtk *x264_gtk) 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->dct_decimate = param.analyse.b_dct_decimate; x264_gtk->sample_ar_x = param.vui.i_sar_width; x264_gtk->sample_ar_y = param.vui.i_sar_height; @@ -718,6 +722,10 @@ _current_set (X264_Gui_Config *config, X264_Gtk *x264_gtk) 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); + if (x264_gtk->dct_decimate) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.dct_decimate), TRUE); + else + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config->more.motion_estimation.dct_decimate), FALSE); g_snprintf (buf, 5, "%d", x264_gtk->sample_ar_x); gtk_entry_set_text (GTK_ENTRY (config->more.misc.sample_ar_x), buf); @@ -983,6 +991,10 @@ _current_get (X264_Gui_Config *gconfig, X264_Gtk *x264_gtk) x264_gtk->fast_pskip = 1; else x264_gtk->fast_pskip = 0; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gconfig->more.motion_estimation.dct_decimate))) + x264_gtk->dct_decimate = 1; + else + x264_gtk->dct_decimate = 0; text = gtk_entry_get_text (GTK_ENTRY (gconfig->more.misc.sample_ar_x)); diff --git a/gtk/x264_gtk.h b/gtk/x264_gtk.h index ec3bba1a..1b495186 100644 --- a/gtk/x264_gtk.h +++ b/gtk/x264_gtk.h @@ -92,6 +92,7 @@ struct X264_Gtk_ guint chroma_me : 1; guint mixed_refs : 1; guint fast_pskip : 1; + guint dct_decimate : 1; /* more - misc */ guint cabac : 1; /* more - misc - df */ diff --git a/gtk/x264_gtk_encode_status_window.c b/gtk/x264_gtk_encode_status_window.c index 95dc85fc..a8f7f6e6 100644 --- a/gtk/x264_gtk_encode_status_window.c +++ b/gtk/x264_gtk_encode_status_window.c @@ -59,6 +59,7 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) gtk_widget_show (label); thread_data->current_video_frame = gtk_entry_new (); + gtk_editable_set_editable (GTK_EDITABLE (thread_data->current_video_frame), FALSE); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->current_video_frame, 1, 2, 0, 1); @@ -71,6 +72,7 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) thread_data->video_data = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (thread_data->video_data), _("0KB")); + gtk_editable_set_editable (GTK_EDITABLE (thread_data->video_data), FALSE); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->video_data, 1, 2, 1, 2); gtk_widget_show (thread_data->video_data); @@ -81,6 +83,7 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) gtk_widget_show (label); thread_data->video_rendering_rate = gtk_entry_new (); + gtk_editable_set_editable (GTK_EDITABLE (thread_data->video_rendering_rate), FALSE); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->video_rendering_rate, 1, 2, 2, 3); @@ -92,16 +95,18 @@ x264_gtk_encode_status_window (X264_Thread_Data *thread_data) gtk_widget_show (label); thread_data->time_elapsed = gtk_entry_new (); + gtk_editable_set_editable (GTK_EDITABLE (thread_data->time_elapsed), FALSE); 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 (_("Time remaining (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_editable_set_editable (GTK_EDITABLE (thread_data->time_remaining), FALSE); gtk_table_attach_defaults (GTK_TABLE (table), thread_data->time_remaining, 1, 2, 4, 5); gtk_widget_show (thread_data->time_remaining); diff --git a/gtk/x264_gtk_more.c b/gtk/x264_gtk_more.c index 1de1a76e..f83426d3 100644 --- a/gtk/x264_gtk_more.c +++ b/gtk/x264_gtk_more.c @@ -194,6 +194,14 @@ _more_page (X264_Gui_Config *config) 0, 1, 4, 5); gtk_widget_show (config->more.motion_estimation.fast_pskip); + config->more.motion_estimation.dct_decimate = gtk_check_button_new_with_label (_("DCT decimate")); + gtk_tooltips_set_tip (tooltips, config->more.motion_estimation.dct_decimate, + _("DCT decimate - description"), + ""); + gtk_table_attach_defaults (GTK_TABLE (table), config->more.motion_estimation.dct_decimate, + 1, 2, 4, 5); + gtk_widget_show (config->more.motion_estimation.dct_decimate); + /* Misc. Options */ frame = gtk_frame_new (_("Misc. Options")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 6); diff --git a/gtk/x264_gtk_private.h b/gtk/x264_gtk_private.h index d0aeeb1b..6d08f53f 100644 --- a/gtk/x264_gtk_private.h +++ b/gtk/x264_gtk_private.h @@ -101,6 +101,7 @@ struct More_ GtkWidget *max_ref_frames; GtkWidget *mixed_refs; GtkWidget *fast_pskip; + GtkWidget *dct_decimate; }motion_estimation; /* Misc. Options */