summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-03-18 17:33:36 -0600
committerJohn Stebbins <[email protected]>2019-05-02 08:50:07 -0600
commit28bac379078b23d98e2ba91597c155c0cc7c5145 (patch)
tree8a9f097c36f0b0bb259de0d513d3bb1d4cfee585 /gtk/src
parent6d9d23d9103ad7086880b36ad671190fe1ab6519 (diff)
deblock: replace pp7 with avfilter vf_deblock
Adds deblock presets and tunes. Old preset values are converted upon preset import. Old PictureDeblock preset key is now PictureDeblockPreset.
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c5
-rw-r--r--gtk/src/ghb.m468
-rw-r--r--gtk/src/hb-backend.c24
-rw-r--r--gtk/src/makedeps.py3
-rw-r--r--gtk/src/presets.c5
-rw-r--r--gtk/src/queuehandler.c49
6 files changed, 122 insertions, 32 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index f73892ba9..a84e2115f 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -2472,7 +2472,6 @@ ghb_update_summary_info(signal_user_data_t *ud)
gboolean detel, comb_detect, deint, decomb, deblock, nlmeans, denoise;
gboolean unsharp, lapsharp, rot, gray;
const char * sval;
- int ival;
sval = ghb_dict_get_string(ud->settings, "PictureDetelecine");
detel = sval != NULL && !!strcasecmp(sval, "off");
@@ -2481,8 +2480,8 @@ ghb_update_summary_info(signal_user_data_t *ud)
sval = ghb_dict_get_string(ud->settings, "PictureDeinterlaceFilter");
deint = sval != NULL && !strcasecmp(sval, "deinterlace");
decomb = sval != NULL && !strcasecmp(sval, "decomb");
- ival = ghb_dict_get_int(ud->settings, "PictureDeblock");
- deblock = ival >= 5;
+ sval = ghb_dict_get_string(ud->settings, "PictureDeblockPreset");
+ deblock = sval != NULL && !!strcasecmp(sval, "off");
sval = ghb_dict_get_string(ud->settings, "PictureDenoiseFilter");
nlmeans = sval != NULL && !strcasecmp(sval, "nlmeans");
denoise = sval != NULL && !strcasecmp(sval, "hqdn3d");
diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4
index a9cb6ea8b..6a7ecc964 100644
--- a/gtk/src/ghb.m4
+++ b/gtk/src/ghb.m4
@@ -2965,34 +2965,80 @@ filter_output([
<property name="halign">start</property>
<property name="valign">start</property>
<child>
- <object class="GtkLabel" id="label41">
+ <object class="GtkLabel" id="PictureDeblockPresetLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes">Deblock:</property>
+ <property name="label" translatable="yes">Deblock Filter:</property>
</object>
<packing>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
<property name="left_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkScale" id="PictureDeblock">
+ <object class="GtkComboBox" id="PictureDeblockPreset">
+ <property name="valign">GTK_ALIGN_CENTER</property>
+ <property name="width_request">100</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip_text" translatable="yes">The deblocking filter removes a common type of compression artifact.
+If your source exhibits 'blockiness', this filter may help clean it up.</property>
+ <signal name="changed" handler="denoise_filter_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="PictureDeblockTuneLabel">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Deblock Tune:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="PictureDeblockTune">
+ <property name="valign">GTK_ALIGN_CENTER</property>
<property name="width_request">100</property>
- <property name="can_focus">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text" translatable="yes">The deblocking filter removes a common type of compression artifact.
If your source exhibits 'blockiness', this filter may help clean it up.</property>
- <property name="adjustment">adjustment20</property>
- <property name="digits">0</property>
- <property name="value_pos">right</property>
- <signal name="format-value" handler="format_deblock_cb" swapped="no"/>
- <signal name="value-changed" handler="setting_widget_changed_cb" swapped="no"/>
+ <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/>
</object>
<packing>
- <property name="top_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="PictureDeblockCustom">
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Custom deblock filter string format
+
+strength=weak|strong:thresh=0-100:blocksize=4-512</property>
+ <property name="width-chars">8</property>
+ <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index b80bed556..6d70fb300 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -360,6 +360,18 @@ typedef struct
gboolean preset;
} filter_opts_t;
+static filter_opts_t deblock_preset_opts =
+{
+ .filter_id = HB_FILTER_DEBLOCK,
+ .preset = TRUE
+};
+
+static filter_opts_t deblock_tune_opts =
+{
+ .filter_id = HB_FILTER_DEBLOCK,
+ .preset = FALSE
+};
+
static filter_opts_t deint_preset_opts =
{
.filter_id = HB_FILTER_DECOMB,
@@ -565,6 +577,18 @@ combo_name_map_t combo_name_map[] =
filter_opt_get
},
{
+ "PictureDeblockPreset",
+ &deblock_preset_opts,
+ filter_opts_set,
+ filter_opt_get
+ },
+ {
+ "PictureDeblockTune",
+ &deblock_tune_opts,
+ filter_opts_set,
+ filter_opt_get
+ },
+ {
"PictureDenoiseFilter",
&denoise_opts,
small_opts_set,
diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py
index 2cbd1bcb1..5294eb88c 100644
--- a/gtk/src/makedeps.py
+++ b/gtk/src/makedeps.py
@@ -26,6 +26,9 @@ dep_map = (
DepEntry("PictureDeinterlaceFilter", "PictureDeinterlacePresetLabel", "off", True, True),
DepEntry("PictureDeinterlaceFilter", "PictureDeinterlaceCustom", "off", True, True),
DepEntry("PictureDeinterlacePreset", "PictureDeinterlaceCustom", "custom", False, True),
+ DepEntry("PictureDeblockPreset", "PictureDeblockTune", "off|custom", True, True),
+ DepEntry("PictureDeblockPreset", "PictureDeblockTuneLabel", "off|custom", True, True),
+ DepEntry("PictureDeblockPreset", "PictureDeblockCustom", "custom", False, True),
DepEntry("PictureDenoiseFilter", "PictureDenoisePreset", "off", True, True),
DepEntry("PictureDenoiseFilter", "PictureDenoisePresetLabel", "off", True, True),
DepEntry("PictureDenoiseFilter", "PictureDenoiseTune", "nlmeans", False, True),
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index 9284b94f7..e522c88f6 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -1694,11 +1694,6 @@ ghb_settings_to_preset(GhbValue *settings)
ghb_dict_set_string(preset, "VideoFramerateMode", "vfr");
}
- if (ghb_dict_get_int(preset, "PictureDeblock") < 5)
- {
- ghb_dict_set_int(preset, "PictureDeblock", 0);
- }
-
GhbValue *alist, *adict;
gint count, ii;
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index d00dc4a66..b1ee364e3 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -328,16 +328,19 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
preset_modified = ghb_dict_get_bool(uiDict, "preset_modified");
name = ghb_dict_get_string(uiDict, "PresetFullName");
+ escape = g_markup_escape_text(name, -1);
markers = ghb_dict_get_bool(uiDict, "ChapterMarkers");
if (preset_modified)
{
- XPRINT(_("<b>Modified Preset Based On:</b> <small>%s</small>\n"), name);
+ XPRINT(_("<b>Modified Preset Based On:</b> <small>%s</small>\n"),
+ escape);
}
else
{
- XPRINT(_("<b>Preset:</b> <small>%s</small>\n"), name);
+ XPRINT(_("<b>Preset:</b> <small>%s</small>\n"), escape);
}
+ g_free(escape);
// Next line in the display (Container type)
// Format: XXX Container
@@ -439,12 +442,12 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
// Next line in the display (Filter settings)
// Filters: - Deinterlace
- gint deblock, denoise, deint;
- const gchar *deint_preset, *detel_preset, *denoise_preset;
- const gchar *denoise_tune;
- const gchar *deint_cust, *detel_cust, *denoise_cust;
+ gint denoise, deint;
+ const gchar *deint_preset, *detel_preset, *deblock_preset, *denoise_preset;
+ const gchar *deblock_tune, *denoise_tune;
+ const gchar *deint_cust, *detel_cust, *deblock_cust, *denoise_cust;
gchar *deint_opt, *denoise_opt;
- gboolean grayscale, detel, filters;
+ gboolean grayscale, deblock, detel, filters;
deint = ghb_settings_combo_int(uiDict, "PictureDeinterlaceFilter");
deint_opt = ghb_settings_combo_option(uiDict, "PictureDeinterlaceFilter");
@@ -459,7 +462,12 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
detel = detel_preset != NULL && !!strcasecmp(detel_preset, "off");
detel_cust = ghb_dict_get_string(uiDict, "PictureDetelecineCustom");
- deblock = ghb_dict_get_int(uiDict, "PictureDeblock");
+ deblock_preset = ghb_lookup_filter_name(HB_FILTER_DEBLOCK,
+ ghb_dict_get_string(uiDict, "PictureDeblockPreset"), 1);
+ deblock_tune = ghb_lookup_filter_name(HB_FILTER_DEBLOCK,
+ ghb_dict_get_string(uiDict, "PictureDeblockTune"), 0);
+ deblock = deblock_preset != NULL && !!strcasecmp(deblock_preset, "off");
+ deblock_cust = ghb_dict_get_string(uiDict, "PictureDeblockCustom");
denoise = ghb_settings_combo_int(uiDict, "PictureDenoiseFilter");
denoise_opt = ghb_settings_combo_option(uiDict, "PictureDenoiseFilter");
@@ -474,10 +482,9 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
grayscale = ghb_dict_get_bool(uiDict, "VideoGrayScale");
- filters = detel || grayscale ||
+ filters = detel || grayscale || deblock ||
deint != HB_FILTER_INVALID ||
- denoise != HB_FILTER_INVALID ||
- (deblock >= 5);
+ denoise != HB_FILTER_INVALID;
if (filters)
{
const char *prefix = " ";
@@ -528,9 +535,25 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
}
prefix = " - ";
}
- if (deblock >= 5)
+ if (deblock)
{
- XPRINT(_("%sDeblock: %d"), prefix, deblock);
+ XPRINT(_("%sDeblock:"), prefix);
+ const char *preset;
+ preset = ghb_dict_get_string(uiDict, "PictureDeblockPreset");
+ if (preset && !strcasecmp(preset, "custom"))
+ {
+ XPRINT(" %s", deblock_cust);
+ }
+ else
+ {
+ XPRINT(" %s", deblock_preset);
+ const char *tune;
+ tune = ghb_dict_get_string(uiDict, "PictureDeblockTune");
+ if (deblock_tune != NULL && strcasecmp(tune, "none"))
+ {
+ XPRINT(",%s", deblock_tune);
+ }
+ }
prefix = " - ";
}
if (grayscale)