diff options
author | John Stebbins <[email protected]> | 2015-10-05 08:53:19 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-10-09 13:36:59 -0700 |
commit | 305d591def7d9bb32f3dd3020c511970f3363960 (patch) | |
tree | 555cdc269479feca0d816ea7d7e27d6e23eeae8e | |
parent | 7f1f6dc4ff37e1dbc194f2ffec3c706f43131292 (diff) |
Make deinterlace/decomb behave similar to nlmeans/hqdn3d
I.e. use a dropdown to select between the filters instead of a radio
button.
-rw-r--r-- | gtk/src/callbacks.c | 12 | ||||
-rw-r--r-- | gtk/src/ghb-3.12.ui | 143 | ||||
-rw-r--r-- | gtk/src/ghb-3.14.ui | 143 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 143 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 155 | ||||
-rw-r--r-- | gtk/src/makedeps.py | 12 | ||||
-rw-r--r-- | gtk/src/presets.c | 4 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 73 | ||||
-rw-r--r-- | libhb/builtin_presets.h | 80 | ||||
-rw-r--r-- | libhb/libhb_presets.list | 2 | ||||
-rw-r--r-- | libhb/param.c | 2 | ||||
-rw-r--r-- | libhb/preset.c | 148 | ||||
-rw-r--r-- | libhb/preset_builtin.json | 72 | ||||
-rw-r--r-- | libhb/preset_template.json | 6 | ||||
-rw-r--r-- | test/test.c | 27 |
15 files changed, 397 insertions, 625 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 6acee07ab..215900275 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2117,6 +2117,18 @@ setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } G_MODULE_EXPORT void +deint_filter_changed_cb(GtkWidget *widget, signal_user_data_t *ud) +{ + ghb_widget_to_setting(ud->settings, widget); + ghb_check_dependency(ud, widget, NULL); + ghb_clear_presets_selection(ud); + ghb_live_reset(ud); + ghb_update_ui_combo_box(ud, "PictureDeinterlacePreset", NULL, FALSE); + ghb_ui_update(ud, "PictureDeinterlacePreset", + ghb_dict_get(ud->settings, "PictureDeinterlacePreset")); +} + +G_MODULE_EXPORT void title_angle_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { ghb_widget_to_setting(ud->settings, widget); diff --git a/gtk/src/ghb-3.12.ui b/gtk/src/ghb-3.12.ui index cf65d0346..db3acea2f 100644 --- a/gtk/src/ghb-3.12.ui +++ b/gtk/src/ghb-3.12.ui @@ -3065,92 +3065,31 @@ SpatialLuma:SpatialChroma:TemporalLuma:TemporalChroma</property> </packing> </child> <child> - <object class="GtkGrid" id="table10"> + <object class="GtkGrid" id="table14"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="label86"> + <object class="GtkLabel" id="PictureDeinterlaceFilterLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Detelecine:</property> + <property name="label" translatable="yes">Deinterlace 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="GtkComboBox" id="PictureDetelecine"> + <object class="GtkComboBox" id="PictureDeinterlaceFilter"> <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">This filter removes 'combing' artifacts that are the result of telecining. - -Telecining is a process that adjusts film framerates that are 24fps to NTSC video frame rates which are 30fps.</property> - <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> - </object> - <packing> - <property name="top_attach">0</property> - <property name="left_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="PictureDetelecineCustom"> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom detelecine filter string format - -JunkLeft:JunkRight:JunkTop:JunkBottom:StrictBreaks:MetricPlane:Parity</property> - <property name="width_chars">8</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <signal name="changed" handler="setting_widget_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="GtkRadioButton" id="PictureDecombDeinterlace"> - <property name="label" translatable="yes">Decomb</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Choose decomb or deinterlace filter options. - -The decomb filter selectively deinterlaces frames that appear to be interlaced. -This will preserve quality in frames that are not interlaced. - -The classic deinterlace filter is applied to all frames. -Frames that are not interlaced will suffer some quality degradation.</property> - <property name="halign">start</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/> - </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="GtkRadioButton" id="PictureDeinterlaceDecomb"> - <property name="label" translatable="yes">Deinterlace</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> <property name="tooltip_text" translatable="yes">Choose decomb or deinterlace filter options. The decomb filter selectively deinterlaces frames that appear to be interlaced. @@ -3158,115 +3097,127 @@ This will preserve quality in frames that are not interlaced. The classic deinterlace filter is applied to all frames. Frames that are not interlaced will suffer some quality degradation.</property> - <property name="halign">start</property> - <property name="draw_indicator">True</property> - <property name="group">PictureDecombDeinterlace</property> - <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/> + <signal name="changed" handler="deint_filter_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">2</property> + <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="PictureDecombLabel"> + <object class="GtkLabel" id="PictureDeinterlacePresetLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Decomb:</property> + <property name="label" translatable="yes">Deinterlace Preset:</property> </object> <packing> - <property name="top_attach">3</property> + <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="PictureDecomb"> + <object class="GtkComboBox" id="PictureDeinterlacePreset"> <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 decomb filter selectively deinterlaces frames that appear to be interlaced. -This will preserve quality in frames that are not interlaced.</property> + <property name="tooltip_text" translatable="yes"> The decomb filter selectively deinterlaces frames that appear to be interlaced. +This will preserve quality in frames that are not interlaced. + +The classic deinterlace filter is applied to all frames. +Frames that are not interlaced will suffer some quality degradation.</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">3</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="PictureDecombCustom"> + <object class="GtkEntry" id="PictureDeinterlaceCustom"> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom decomb filter string format + <property name="tooltip_text" translatable="yes">Custom denoise filter string format -Mode:SpatialMetric:MotionThresh:SpatialThresh:BlockThresh:BlockWidth: -BlockHeight:MagnitudeThres:VarianceThres:LaplacianThresh:DilationThresh: -ErosionThresh:NoiseThresh:MaxSearchDistance:PostProcessing:Parity</property> +SpatialLuma:SpatialChroma:TemporalLuma:TemporalChroma</property> <property name="width_chars">8</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">4</property> + <property name="top_attach">3</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">2</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="table10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="PictureDeinterlaceLabel"> + <object class="GtkLabel" id="label86"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Deinterlace:</property> + <property name="label" translatable="yes">Detelecine:</property> </object> <packing> - <property name="top_attach">5</property> + <property name="top_attach">0</property> <property name="left_attach">0</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkComboBox" id="PictureDeinterlace"> + <object class="GtkComboBox" id="PictureDetelecine"> <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 classic deinterlace filter is applied to all frames. -Frames that are not interlaced will suffer some quality degradation.</property> + <property name="tooltip_text" translatable="yes">This filter removes 'combing' artifacts that are the result of telecining. + +Telecining is a process that adjusts film framerates that are 24fps to NTSC video frame rates which are 30fps.</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">5</property> + <property name="top_attach">0</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkEntry" id="PictureDeinterlaceCustom"> + <object class="GtkEntry" id="PictureDetelecineCustom"> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom deinterlace filter string format + <property name="tooltip_text" translatable="yes">Custom detelecine filter string format -YadifMode:YadifParity:McdintMode:McdeintQp</property> +JunkLeft:JunkRight:JunkTop:JunkBottom:StrictBreaks:MetricPlane:Parity</property> <property name="width_chars">8</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">6</property> + <property name="top_attach">1</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> @@ -3277,7 +3228,7 @@ YadifMode:YadifParity:McdintMode:McdeintQp</property> <property name="expand">False</property> <property name="fill">True</property> <property name="padding">2</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> diff --git a/gtk/src/ghb-3.14.ui b/gtk/src/ghb-3.14.ui index 7164d39b7..3dd55d58d 100644 --- a/gtk/src/ghb-3.14.ui +++ b/gtk/src/ghb-3.14.ui @@ -3066,92 +3066,31 @@ SpatialLuma:SpatialChroma:TemporalLuma:TemporalChroma</property> </packing> </child> <child> - <object class="GtkGrid" id="table10"> + <object class="GtkGrid" id="table14"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="label86"> + <object class="GtkLabel" id="PictureDeinterlaceFilterLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Detelecine:</property> + <property name="label" translatable="yes">Deinterlace 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="GtkComboBox" id="PictureDetelecine"> + <object class="GtkComboBox" id="PictureDeinterlaceFilter"> <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">This filter removes 'combing' artifacts that are the result of telecining. - -Telecining is a process that adjusts film framerates that are 24fps to NTSC video frame rates which are 30fps.</property> - <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> - </object> - <packing> - <property name="top_attach">0</property> - <property name="left_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="PictureDetelecineCustom"> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom detelecine filter string format - -JunkLeft:JunkRight:JunkTop:JunkBottom:StrictBreaks:MetricPlane:Parity</property> - <property name="width_chars">8</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <signal name="changed" handler="setting_widget_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="GtkRadioButton" id="PictureDecombDeinterlace"> - <property name="label" translatable="yes">Decomb</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Choose decomb or deinterlace filter options. - -The decomb filter selectively deinterlaces frames that appear to be interlaced. -This will preserve quality in frames that are not interlaced. - -The classic deinterlace filter is applied to all frames. -Frames that are not interlaced will suffer some quality degradation.</property> - <property name="halign">start</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/> - </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="GtkRadioButton" id="PictureDeinterlaceDecomb"> - <property name="label" translatable="yes">Deinterlace</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> <property name="tooltip_text" translatable="yes">Choose decomb or deinterlace filter options. The decomb filter selectively deinterlaces frames that appear to be interlaced. @@ -3159,115 +3098,127 @@ This will preserve quality in frames that are not interlaced. The classic deinterlace filter is applied to all frames. Frames that are not interlaced will suffer some quality degradation.</property> - <property name="halign">start</property> - <property name="draw_indicator">True</property> - <property name="group">PictureDecombDeinterlace</property> - <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/> + <signal name="changed" handler="deint_filter_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">2</property> + <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="PictureDecombLabel"> + <object class="GtkLabel" id="PictureDeinterlacePresetLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Decomb:</property> + <property name="label" translatable="yes">Deinterlace Preset:</property> </object> <packing> - <property name="top_attach">3</property> + <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="PictureDecomb"> + <object class="GtkComboBox" id="PictureDeinterlacePreset"> <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 decomb filter selectively deinterlaces frames that appear to be interlaced. -This will preserve quality in frames that are not interlaced.</property> + <property name="tooltip_text" translatable="yes"> The decomb filter selectively deinterlaces frames that appear to be interlaced. +This will preserve quality in frames that are not interlaced. + +The classic deinterlace filter is applied to all frames. +Frames that are not interlaced will suffer some quality degradation.</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">3</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="PictureDecombCustom"> + <object class="GtkEntry" id="PictureDeinterlaceCustom"> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom decomb filter string format + <property name="tooltip_text" translatable="yes">Custom denoise filter string format -Mode:SpatialMetric:MotionThresh:SpatialThresh:BlockThresh:BlockWidth: -BlockHeight:MagnitudeThres:VarianceThres:LaplacianThresh:DilationThresh: -ErosionThresh:NoiseThresh:MaxSearchDistance:PostProcessing:Parity</property> +SpatialLuma:SpatialChroma:TemporalLuma:TemporalChroma</property> <property name="width_chars">8</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">4</property> + <property name="top_attach">3</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">2</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="table10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="PictureDeinterlaceLabel"> + <object class="GtkLabel" id="label86"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Deinterlace:</property> + <property name="label" translatable="yes">Detelecine:</property> </object> <packing> - <property name="top_attach">5</property> + <property name="top_attach">0</property> <property name="left_attach">0</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkComboBox" id="PictureDeinterlace"> + <object class="GtkComboBox" id="PictureDetelecine"> <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 classic deinterlace filter is applied to all frames. -Frames that are not interlaced will suffer some quality degradation.</property> + <property name="tooltip_text" translatable="yes">This filter removes 'combing' artifacts that are the result of telecining. + +Telecining is a process that adjusts film framerates that are 24fps to NTSC video frame rates which are 30fps.</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">5</property> + <property name="top_attach">0</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkEntry" id="PictureDeinterlaceCustom"> + <object class="GtkEntry" id="PictureDetelecineCustom"> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom deinterlace filter string format + <property name="tooltip_text" translatable="yes">Custom detelecine filter string format -YadifMode:YadifParity:McdintMode:McdeintQp</property> +JunkLeft:JunkRight:JunkTop:JunkBottom:StrictBreaks:MetricPlane:Parity</property> <property name="width_chars">8</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">6</property> + <property name="top_attach">1</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> @@ -3278,7 +3229,7 @@ YadifMode:YadifParity:McdintMode:McdeintQp</property> <property name="expand">False</property> <property name="fill">True</property> <property name="padding">2</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 6c3303eb2..cf29e4493 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -3065,92 +3065,31 @@ SpatialLuma:SpatialChroma:TemporalLuma:TemporalChroma</property> </packing> </child> <child> - <object class="GtkGrid" id="table10"> + <object class="GtkGrid" id="table14"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="label86"> + <object class="GtkLabel" id="PictureDeinterlaceFilterLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Detelecine:</property> + <property name="label" translatable="yes">Deinterlace 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="GtkComboBox" id="PictureDetelecine"> + <object class="GtkComboBox" id="PictureDeinterlaceFilter"> <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">This filter removes 'combing' artifacts that are the result of telecining. - -Telecining is a process that adjusts film framerates that are 24fps to NTSC video frame rates which are 30fps.</property> - <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> - </object> - <packing> - <property name="top_attach">0</property> - <property name="left_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="PictureDetelecineCustom"> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom detelecine filter string format - -JunkLeft:JunkRight:JunkTop:JunkBottom:StrictBreaks:MetricPlane:Parity</property> - <property name="width_chars">8</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <signal name="changed" handler="setting_widget_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="GtkRadioButton" id="PictureDecombDeinterlace"> - <property name="label" translatable="yes">Decomb</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Choose decomb or deinterlace filter options. - -The decomb filter selectively deinterlaces frames that appear to be interlaced. -This will preserve quality in frames that are not interlaced. - -The classic deinterlace filter is applied to all frames. -Frames that are not interlaced will suffer some quality degradation.</property> - <property name="halign">start</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/> - </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="GtkRadioButton" id="PictureDeinterlaceDecomb"> - <property name="label" translatable="yes">Deinterlace</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> <property name="tooltip_text" translatable="yes">Choose decomb or deinterlace filter options. The decomb filter selectively deinterlaces frames that appear to be interlaced. @@ -3158,115 +3097,127 @@ This will preserve quality in frames that are not interlaced. The classic deinterlace filter is applied to all frames. Frames that are not interlaced will suffer some quality degradation.</property> - <property name="halign">start</property> - <property name="draw_indicator">True</property> - <property name="group">PictureDecombDeinterlace</property> - <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/> + <signal name="changed" handler="deint_filter_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">2</property> + <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="PictureDecombLabel"> + <object class="GtkLabel" id="PictureDeinterlacePresetLabel"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Decomb:</property> + <property name="label" translatable="yes">Deinterlace Preset:</property> </object> <packing> - <property name="top_attach">3</property> + <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="PictureDecomb"> + <object class="GtkComboBox" id="PictureDeinterlacePreset"> <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 decomb filter selectively deinterlaces frames that appear to be interlaced. -This will preserve quality in frames that are not interlaced.</property> + <property name="tooltip_text" translatable="yes"> The decomb filter selectively deinterlaces frames that appear to be interlaced. +This will preserve quality in frames that are not interlaced. + +The classic deinterlace filter is applied to all frames. +Frames that are not interlaced will suffer some quality degradation.</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">3</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="PictureDecombCustom"> + <object class="GtkEntry" id="PictureDeinterlaceCustom"> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom decomb filter string format + <property name="tooltip_text" translatable="yes">Custom denoise filter string format -Mode:SpatialMetric:MotionThresh:SpatialThresh:BlockThresh:BlockWidth: -BlockHeight:MagnitudeThres:VarianceThres:LaplacianThresh:DilationThresh: -ErosionThresh:NoiseThresh:MaxSearchDistance:PostProcessing:Parity</property> +SpatialLuma:SpatialChroma:TemporalLuma:TemporalChroma</property> <property name="width_chars">8</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">4</property> + <property name="top_attach">3</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">2</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="table10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="PictureDeinterlaceLabel"> + <object class="GtkLabel" id="label86"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Deinterlace:</property> + <property name="label" translatable="yes">Detelecine:</property> </object> <packing> - <property name="top_attach">5</property> + <property name="top_attach">0</property> <property name="left_attach">0</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkComboBox" id="PictureDeinterlace"> + <object class="GtkComboBox" id="PictureDetelecine"> <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 classic deinterlace filter is applied to all frames. -Frames that are not interlaced will suffer some quality degradation.</property> + <property name="tooltip_text" translatable="yes">This filter removes 'combing' artifacts that are the result of telecining. + +Telecining is a process that adjusts film framerates that are 24fps to NTSC video frame rates which are 30fps.</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">5</property> + <property name="top_attach">0</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkEntry" id="PictureDeinterlaceCustom"> + <object class="GtkEntry" id="PictureDetelecineCustom"> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Custom deinterlace filter string format + <property name="tooltip_text" translatable="yes">Custom detelecine filter string format -YadifMode:YadifParity:McdintMode:McdeintQp</property> +JunkLeft:JunkRight:JunkTop:JunkBottom:StrictBreaks:MetricPlane:Parity</property> <property name="width_chars">8</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <signal name="changed" handler="setting_widget_changed_cb" swapped="no"/> </object> <packing> - <property name="top_attach">6</property> + <property name="top_attach">1</property> <property name="left_attach">1</property> <property name="width">1</property> <property name="height">1</property> @@ -3277,7 +3228,7 @@ YadifMode:YadifParity:McdintMode:McdeintQp</property> <property name="expand">False</property> <property name="fill">True</property> <property name="padding">2</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 57135578b..beb9797e5 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -196,6 +196,18 @@ combo_opts_t vqual_granularity_opts = d_vqual_granularity_opts }; +static options_map_t d_deint_opts[] = +{ + {N_("Off"), "off", HB_FILTER_INVALID, ""}, + {N_("Decomb"), "decomb", HB_FILTER_DECOMB, ""}, + {N_("Deinterlace"), "deinterlace", HB_FILTER_DEINTERLACE, ""}, +}; +combo_opts_t deint_opts = +{ + sizeof(d_deint_opts)/sizeof(options_map_t), + d_deint_opts +}; + static options_map_t d_denoise_opts[] = { {N_("Off"), "off", HB_FILTER_INVALID, ""}, @@ -324,6 +336,12 @@ typedef struct gboolean preset; } filter_opts_t; +static filter_opts_t deint_preset_opts = +{ + .filter_id = HB_FILTER_DECOMB, + .preset = TRUE +}; + static filter_opts_t nlmeans_preset_opts = { .filter_id = HB_FILTER_NLMEANS, @@ -350,18 +368,6 @@ static filter_opts_t detel_opts = .preset = TRUE }; -static filter_opts_t decomb_opts = -{ - .filter_id = HB_FILTER_DECOMB, - .preset = TRUE -}; - -static filter_opts_t deint_opts = -{ - .filter_id = HB_FILTER_DEINTERLACE, - .preset = TRUE -}; - typedef void (*opts_set_f)(signal_user_data_t *ud, const gchar *name, void *opts, const void* data); typedef GhbValue* (*opt_get_f)(const gchar *name, const void *opts, @@ -410,11 +416,14 @@ static void container_opts_set(signal_user_data_t *ud, const gchar *name, void *opts, const void* data); static void filter_opts_set(signal_user_data_t *ud, const gchar *name, void *opts, const void* data); +static void deint_opts_set(signal_user_data_t *ud, const gchar *name, + void *vopts, const void* data); static GhbValue * generic_opt_get(const char *name, const void *opts, const GhbValue *gval, GhbType type); static GhbValue * filter_opt_get(const char *name, const void *opts, const GhbValue *gval, GhbType type); + combo_name_map_t combo_name_map[] = { { @@ -484,15 +493,15 @@ combo_name_map_t combo_name_map[] = generic_opt_get }, { - "PictureDeinterlace", + "PictureDeinterlaceFilter", &deint_opts, - filter_opts_set, - filter_opt_get + small_opts_set, + generic_opt_get }, { - "PictureDecomb", - &decomb_opts, - filter_opts_set, + "PictureDeinterlacePreset", + &deint_preset_opts, + deint_opts_set, filter_opt_get }, { @@ -2740,6 +2749,18 @@ filter_opts_set(signal_user_data_t *ud, const gchar *name, filter_opts_set2(ud, name, opts->filter_id, opts->preset); } +static void +deint_opts_set(signal_user_data_t *ud, const gchar *name, + void *vopts, const void* data) +{ + (void)data; // Silence "unused variable" warning + + filter_opts_t *opts = (filter_opts_t*)vopts; + opts->filter_id = ghb_settings_combo_int(ud->settings, + "PictureDeinterlaceFilter"); + filter_opts_set2(ud, name, opts->filter_id, opts->preset); +} + combo_name_map_t* find_combo_map(const gchar *name) { @@ -2936,7 +2957,6 @@ ghb_update_ui_combo_box( if (name != NULL) { - g_debug("ghb_update_ui_combo_box() %s\n", name); // Clearing a combo box causes a rash of "changed" events, even when // the active item is -1 (inactive). To control things, I'm disabling // the event till things are settled down. @@ -3931,16 +3951,16 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent) gchar *message; // Deinterlace - gboolean decomb_deint; - const char *deint_preset; - decomb_deint = ghb_dict_get_bool(settings, "PictureDecombDeinterlace"); - deint_preset = ghb_dict_get_string(settings, "PictureDeinterlace"); - if (!decomb_deint && strcasecmp(deint_preset, "off")) + int filter_id; + filter_id = ghb_settings_combo_int(settings, "PictureDeinterlaceFilter"); + if (filter_id != HB_FILTER_INVALID) { - const char *deint_custom = NULL; - int filter_id; + const char *deint_filter, *deint_preset, *deint_custom = NULL; - filter_id = HB_FILTER_DEINTERLACE; + deint_filter = ghb_dict_get_string(settings, + "PictureDeinterlaceFilter"); + deint_preset = ghb_dict_get_string(settings, + "PictureDeinterlacePreset"); if (!strcasecmp(deint_preset, "custom")) { deint_custom = ghb_dict_get_string(settings, @@ -3952,48 +3972,17 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent) { message = g_strdup_printf( _("Invalid Deinterlace Settings:\n\n" + "Filter: %s\n" "Preset: %s\n" - "Custom: %s\n"), deint_preset, deint_custom); + "Custom: %s\n"), deint_filter, deint_preset, + deint_custom); } else { message = g_strdup_printf( _("Invalid Deinterlace Settings:\n\n" - "Preset: %s\n"), deint_preset); - } - ghb_message_dialog(parent, GTK_MESSAGE_ERROR, - message, _("Cancel"), NULL); - g_free(message); - return FALSE; - } - } - - // Decomb - deint_preset = ghb_dict_get_string(settings, "PictureDecomb"); - if (decomb_deint && strcasecmp(deint_preset, "off")) - { - const char *deint_custom = NULL; - int filter_id; - - filter_id = HB_FILTER_DECOMB; - if (!strcasecmp(deint_preset, "custom")) - { - deint_custom = ghb_dict_get_string(settings, "PictureDecombCustom"); - } - if (hb_validate_filter_preset(filter_id, deint_preset, deint_custom)) - { - if (deint_custom != NULL) - { - message = g_strdup_printf( - _("Invalid Decomb Settings:\n\n" - "Preset: %s\n" - "Custom: %s\n"), deint_preset, deint_custom); - } - else - { - message = g_strdup_printf( - _("Invalid Decomb Settings:\n\n" - "Preset: %s\n"), deint_preset); + "Filter: %s\n" + "Preset: %s\n"), deint_filter, deint_preset); } ghb_message_dialog(parent, GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); @@ -4039,31 +4028,13 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent) } // Denoise - const char *denoise_filter; - denoise_filter = ghb_dict_get_string(settings, "PictureDenoiseFilter"); - if (strcasecmp(denoise_filter, "off")) + filter_id = ghb_settings_combo_int(settings, "PictureDenoiseFilter"); + if (filter_id != HB_FILTER_INVALID) { - const char *denoise_preset; + const char *denoise_filter, *denoise_preset; const char *denoise_tune = NULL, *denoise_custom = NULL; - int filter_id; - if (!strcasecmp(denoise_filter, "nlmeans")) - { - filter_id = HB_FILTER_NLMEANS; - } - else if (!strcasecmp(denoise_filter, "hqdn3d")) - { - filter_id = HB_FILTER_HQDN3D; - } - else - { - message = g_strdup_printf( - _("Invalid Denoise Filter: %s\n"), denoise_filter); - ghb_message_dialog(parent, GTK_MESSAGE_ERROR, - message, _("Cancel"), NULL); - g_free(message); - return FALSE; - } + denoise_filter = ghb_dict_get_string(settings, "PictureDenoiseFilter"); denoise_preset = ghb_dict_get_string(settings, "PictureDenoisePreset"); if (filter_id == HB_FILTER_NLMEANS) { @@ -4101,6 +4072,7 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent) return FALSE; } } + return TRUE; } @@ -4526,16 +4498,9 @@ ghb_get_preview_image( if( title == NULL ) return NULL; gboolean deinterlace; - if (ghb_dict_get_bool(ud->settings, "PictureDecombDeinterlace")) - { - deinterlace = ghb_settings_combo_int(ud->settings, "PictureDecomb") - == 0 ? 0 : 1; - } - else - { - deinterlace = ghb_settings_combo_int(ud->settings, "PictureDeinterlace") - == 0 ? 0 : 1; - } + deinterlace = ghb_settings_combo_int(ud->settings, + "PictureDeinterlaceFilter") != HB_FILTER_INVALID; + // Get the geometry settings for the preview. This will disable // cropping if the setting to show the cropped region is enabled. get_preview_geometry(ud, title, &srcGeo, &uiGeo); diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py index 1a04a9f06..7159a87c0 100644 --- a/gtk/src/makedeps.py +++ b/gtk/src/makedeps.py @@ -28,13 +28,10 @@ dep_map = ( DepEntry("VideoFramerate", "VideoFrameratePFR", "auto", True, True), DepEntry("VideoFramerate", "VideoFramerateVFR", "auto", False, True), DepEntry("VideoTwoPass", "VideoTurboTwoPass", "1", False, False), - DepEntry("PictureDecombDeinterlace", "PictureDeinterlace", "1", True, True), - DepEntry("PictureDecombDeinterlace", "PictureDeinterlaceCustom", "1", True, True), - DepEntry("PictureDecombDeinterlace", "PictureDeinterlaceLabel", "1", True, True), - DepEntry("PictureDecombDeinterlace", "PictureDecomb", "0", True, True), - DepEntry("PictureDecombDeinterlace", "PictureDecombCustom", "0", True, True), - DepEntry("PictureDecombDeinterlace", "PictureDecombLabel", "0", True, True), - DepEntry("PictureDeinterlace", "PictureDeinterlaceCustom", "custom", False, True), + DepEntry("PictureDeinterlaceFilter", "PictureDeinterlacePreset", "off", True, True), + DepEntry("PictureDeinterlaceFilter", "PictureDeinterlacePresetLabel", "off", True, True), + DepEntry("PictureDeinterlaceFilter", "PictureDeinterlaceCustom", "off", True, True), + DepEntry("PictureDeinterlacePreset", "PictureDeinterlaceCustom", "custom", False, True), DepEntry("PictureDenoiseFilter", "PictureDenoisePreset", "off", True, True), DepEntry("PictureDenoiseFilter", "PictureDenoisePresetLabel", "off", True, True), DepEntry("PictureDenoiseFilter", "PictureDenoiseTune", "nlmeans", False, True), @@ -43,7 +40,6 @@ dep_map = ( DepEntry("PictureDenoisePreset", "PictureDenoiseCustom", "custom", False, True), DepEntry("PictureDenoisePreset", "PictureDenoiseTune", "custom", True, True), DepEntry("PictureDenoisePreset", "PictureDenoiseTuneLabel", "custom", True, True), - DepEntry("PictureDecomb", "PictureDecombCustom", "custom", False, True), DepEntry("PictureDetelecine", "PictureDetelecineCustom", "custom", False, True), DepEntry("PictureWidthEnable", "PictureWidth", "1", False, False), DepEntry("PictureHeightEnable", "PictureHeight", "1", False, False), diff --git a/gtk/src/presets.c b/gtk/src/presets.c index b105c7221..33757b992 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -273,8 +273,6 @@ ghb_preset_to_settings(GhbValue *settings, GhbValue *preset) ghb_dict_copy(settings, preset); // Fix up all the internal settings that are derived from preset values. - ghb_dict_set_bool(settings, "PictureDeinterlaceDecomb", - !ghb_dict_get_bool(settings, "PictureDecombDeinterlace")); int width, height; width = ghb_dict_get_int(settings, "PictureWidth"); @@ -495,6 +493,8 @@ static const char *widget_priority_list[] = "VideoEncoder", "VideoQualityGranularity", "AudioEncoder", + "PictureDeinterlaceFilter", + "PictureDeinterlacePreset", NULL }; diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 61ed78a16..d99784070 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -293,31 +293,21 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter // Next line in the display (Filter settings) // Filters: - Deinterlace - gint deblock, denoise; - gboolean decomb, deint, detel; - const gchar *decomb_opt, *deint_opt; - const gchar *decomb_preset, *deint_preset, *detel_preset; - const gchar *denoise_preset, *denoise_tune; - const gchar *detel_cust, *deint_cust, *decomb_cust, *denoise_cust; - gchar *denoise_opt; - gboolean decomb_deint; - gboolean grayscale; - gboolean filters; - - decomb_deint = ghb_dict_get_bool(settings, "PictureDecombDeinterlace"); - decomb_preset = ghb_dict_get_string(settings, "PictureDecomb"); - decomb = decomb_preset != NULL && !!strcasecmp(decomb_preset, "off") && - decomb_deint; - decomb_opt = ghb_lookup_filter_name(HB_FILTER_DECOMB, - ghb_dict_get_string(settings, "PictureDecomb"), 1); - decomb_cust = ghb_dict_get_string(settings, "PictureDecombCustom"); - - deint_preset = ghb_dict_get_string(settings, "PictureDeinterlace"); - deint = deint_preset != NULL && !!strcasecmp(deint_preset, "off") && - !decomb_deint; - deint_opt = ghb_lookup_filter_name(HB_FILTER_DEINTERLACE, - ghb_dict_get_string(settings, "PictureDeinterlace"), 1); - deint_cust = ghb_dict_get_string(settings, "PictureDeinterlaceCustom"); + gint deblock, denoise, deint; + const gchar *deint_preset, *detel_preset, *denoise_preset; + const gchar *denoise_tune; + const gchar *deint_cust, *detel_cust, *denoise_cust; + gchar *deint_opt, *denoise_opt; + gboolean grayscale, detel, filters; + + deint = ghb_settings_combo_int(settings, "PictureDeinterlaceFilter"); + deint_opt = ghb_settings_combo_option(settings, "PictureDeinterlaceFilter"); + if (deint != HB_FILTER_INVALID) + { + deint_preset = ghb_lookup_filter_name(deint, + ghb_dict_get_string(settings, "PictureDeinterlacePreset"), 1); + deint_cust = ghb_dict_get_string(settings, "PictureDeinterlaceCustom"); + } detel_preset = ghb_dict_get_string(settings, "PictureDetelecine"); detel = detel_preset != NULL && !!strcasecmp(detel_preset, "off"); @@ -333,14 +323,15 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter ghb_dict_get_string(settings, "PictureDenoisePreset"), 1); denoise_tune = ghb_lookup_filter_name(denoise, ghb_dict_get_string(settings, "PictureDenoiseTune"), 0); - denoise_cust = ghb_dict_get_string(settings, "PictureDenoiseCustom"); } grayscale = ghb_dict_get_bool(settings, "VideoGrayScale"); - filters = detel || decomb || deint || grayscale || - denoise != HB_FILTER_INVALID || (deblock >= 5); + filters = detel || grayscale || + deint != HB_FILTER_INVALID || + denoise != HB_FILTER_INVALID || + (deblock >= 5); if (filters) { const char *prefix = " "; @@ -354,35 +345,24 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter } prefix = " - "; } - if (decomb) + if (deint != HB_FILTER_INVALID) { - XPRINT(_("%sDecomb"), prefix); - if (!strcasecmp(decomb_preset, "custom")) - { - XPRINT(": %s", decomb_cust); - } - else - { - XPRINT(": %s", decomb_opt); - } - prefix = " - "; - } - if (deint) - { - XPRINT(_("%sDeinterlace"), prefix); - if (!strcasecmp(deint_preset, "custom")) + XPRINT(_("%s%s:"), prefix, deint_opt); + const char *preset; + preset = ghb_dict_get_string(settings, "PictureDeinterlacePreset"); + if (!strcasecmp(preset, "custom")) { XPRINT(": %s", deint_cust); } else { - XPRINT(": %s", deint_opt); + XPRINT(" %s", deint_preset); } prefix = " - "; } if (denoise != HB_FILTER_INVALID) { - XPRINT(_("%sDenoise Filter %s:"), prefix, denoise_opt); + XPRINT(_("%sDenoise %s:"), prefix, denoise_opt); const char *preset; preset = ghb_dict_get_string(settings, "PictureDenoisePreset"); if (preset && !strcasecmp(preset, "custom")) @@ -414,6 +394,7 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *settings, GtkTreeIter *piter } XPRINT("</small>\n"); } + free(deint_opt); free(denoise_opt); // Next line in the display (Video Encoder) diff --git a/libhb/builtin_presets.h b/libhb/builtin_presets.h index 2ad9f34ec..99ab89662 100644 --- a/libhb/builtin_presets.h +++ b/libhb/builtin_presets.h @@ -32,11 +32,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -92,11 +90,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -152,11 +148,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -212,11 +206,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -280,11 +272,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -348,11 +338,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -416,11 +404,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"fast\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"decomb\", \n" +" \"PictureDeinterlacePreset\": \"fast\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -476,11 +462,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -536,11 +520,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -596,11 +578,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -663,11 +643,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -731,11 +709,9 @@ const char hb_builtin_presets_json[] = " \"PictureAutoCrop\": true, \n" " \"PictureBottomCrop\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"default\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"decomb\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDetelecine\": \"off\", \n" @@ -821,11 +797,9 @@ const char hb_builtin_presets_json[] = " \"PictureBottomCrop\": 0, \n" " \"PictureDARWidth\": 0, \n" " \"PictureDeblock\": 0, \n" -" \"PictureDecomb\": \"off\", \n" -" \"PictureDecombCustom\": \"\", \n" -" \"PictureDecombDeinterlace\": true, \n" -" \"PictureDeinterlace\": \"off\", \n" " \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" " \"PictureDenoiseCustom\": \"\", \n" " \"PictureDenoiseFilter\": \"off\", \n" " \"PictureDenoisePreset\": \"medium\", \n" @@ -882,7 +856,7 @@ const char hb_builtin_presets_json[] = " \"x264Option\": \"\", \n" " \"x264UseAdvancedOptions\": false\n" " }, \n" -" \"VersionMajor\": 10, \n" +" \"VersionMajor\": 11, \n" " \"VersionMicro\": 0, \n" " \"VersionMinor\": 0\n" " }\n" diff --git a/libhb/libhb_presets.list b/libhb/libhb_presets.list index 3742b1d40..cc972f0f2 100644 --- a/libhb/libhb_presets.list +++ b/libhb/libhb_presets.list @@ -1,6 +1,6 @@ <resources> <section name="PresetTemplate"> - <integer name="VersionMajor" value="10" /> + <integer name="VersionMajor" value="11" /> <integer name="VersionMinor" value="0" /> <integer name="VersionMicro" value="0" /> <json name="Preset" file="preset_template.json" /> diff --git a/libhb/param.c b/libhb/param.c index 494badf39..723943ba8 100644 --- a/libhb/param.c +++ b/libhb/param.c @@ -57,7 +57,6 @@ static hb_filter_param_t detelecine_presets[] = static hb_filter_param_t decomb_presets[] = { - { 0, "Off", "off", hb_filter_off }, { 1, "Custom", "custom", NULL }, { 2, "Default", "default", "" }, { 3, "Fast", "fast", "7:2:6:9:1:80" }, @@ -67,7 +66,6 @@ static hb_filter_param_t decomb_presets[] = static hb_filter_param_t deinterlace_presets[] = { - { 0, "Off", "off", hb_filter_off }, { 1, "Custom", "custom", NULL }, { 2, "Fast", "fast", "0:-1:-1:0:1" }, { 3, "Slow", "slow", "1:-1:-1:0:1" }, diff --git a/libhb/preset.c b/libhb/preset.c index b7074feb0..e733a175a 100644 --- a/libhb/preset.c +++ b/libhb/preset.c @@ -1113,69 +1113,41 @@ int hb_preset_apply_filters(const hb_dict_t *preset, hb_dict_t *job_dict) } // Decomb or deinterlace filters - int decomb_or_deint; - decomb_or_deint = hb_value_get_bool(hb_dict_get(preset, - "PictureDecombDeinterlace")); - hb_value_t *decomb_val = hb_dict_get(preset, "PictureDecomb"); - if (decomb_or_deint && decomb_val != NULL) + const char *deint_filter, *deint_preset, *deint_custom; + deint_filter = hb_value_get_string(hb_dict_get(preset, + "PictureDeinterlaceFilter")); + deint_preset = hb_value_get_string(hb_dict_get(preset, + "PictureDeinterlacePreset")); + deint_custom = hb_value_get_string(hb_dict_get(preset, + "PictureDeinterlaceCustom")); + if (deint_filter != NULL && deint_preset != NULL && + strcasecmp(deint_filter, "off")) { - const char *custom; - custom = hb_value_get_string(hb_dict_get(preset, - "PictureDecombCustom")); - if (hb_value_type(decomb_val) == HB_VALUE_TYPE_STRING) + int filter_id; + if (!strcasecmp(deint_filter, "decomb")) { - filter_str = hb_generate_filter_settings( - HB_FILTER_DECOMB, hb_value_get_string(decomb_val), custom); - } - else - { - filter_str = hb_generate_filter_settings_by_index( - HB_FILTER_DECOMB, hb_value_get_int(decomb_val), custom); + filter_id = HB_FILTER_DECOMB; } - if (filter_str == NULL) + else if (!strcasecmp(deint_filter, "deinterlace")) { - char *s = hb_value_get_string_xform(decomb_val); - hb_error("Invalid decomb filter settings (%s)", s); - free(s); - return -1; - } - else if (filter_str != hb_filter_off) - { - filter_dict = hb_dict_init(); - hb_dict_set(filter_dict, "ID", hb_value_int(HB_FILTER_DECOMB)); - hb_dict_set(filter_dict, "Settings", hb_value_string(filter_str)); - hb_value_array_append(filter_list, filter_dict); - free(filter_str); - } - } - - hb_value_t *deint_val = hb_dict_get(preset, "PictureDeinterlace"); - if (!decomb_or_deint && deint_val != NULL) - { - const char *custom; - custom = hb_value_get_string(hb_dict_get(preset, - "PictureDeinterlaceCustom")); - if (hb_value_type(deint_val) == HB_VALUE_TYPE_STRING) - { - filter_str = hb_generate_filter_settings( - HB_FILTER_DEINTERLACE, hb_value_get_string(deint_val), custom); + filter_id = HB_FILTER_DEINTERLACE; } else { - filter_str = hb_generate_filter_settings_by_index( - HB_FILTER_DEINTERLACE, hb_value_get_int(deint_val), custom); + hb_error("Invalid deinterlace filter (%s)", deint_filter); + return -1; } + filter_str = hb_generate_filter_settings( + filter_id, deint_preset, deint_custom); if (filter_str == NULL) { - char *s = hb_value_get_string_xform(deint_val); - hb_error("Invalid deinterlace filter settings (%s)", s); - free(s); + hb_error("Invalid deinterlace filter preset (%s)", deint_preset); return -1; } else if (filter_str != hb_filter_off) { filter_dict = hb_dict_init(); - hb_dict_set(filter_dict, "ID", hb_value_int(HB_FILTER_DEINTERLACE)); + hb_dict_set(filter_dict, "ID", hb_value_int(filter_id)); hb_dict_set(filter_dict, "Settings", hb_value_string(filter_str)); hb_value_array_append(filter_list, filter_dict); free(filter_str); @@ -1961,6 +1933,41 @@ void hb_presets_clean(hb_value_t *preset) presets_clean(preset, hb_preset_template); } +static void import_deint_10_0_0(hb_value_t *preset) +{ + hb_value_t *val = hb_dict_get(preset, "PictureDecombDeinterlace"); + if (val != NULL) + { + int decomb_or_deint = hb_value_get_bool(val); + const char * deint_preset; + if (decomb_or_deint) + { + deint_preset = hb_value_get_string( + hb_dict_get(preset, "PictureDecomb")); + } + else + { + deint_preset = hb_value_get_string( + hb_dict_get(preset, "PictureDeinterlace")); + } + if (deint_preset != NULL && strcasecmp(deint_preset, "off")) + { + hb_dict_set(preset, "PictureDeinterlaceFilter", + decomb_or_deint ? hb_value_string("decomb") + : hb_value_string("deinterlace")); + hb_dict_set(preset, "PictureDeinterlacePreset", + hb_value_string(deint_preset)); + } + else + { + hb_dict_set(preset, "PictureDeinterlaceFilter", + hb_value_string("off")); + hb_dict_set(preset, "PictureDeinterlacePreset", + hb_value_string("default")); + } + } +} + static const char* import_indexed_filter(int filter_id, int index) { hb_filter_param_t *filter_presets; @@ -1975,7 +1982,7 @@ static const char* import_indexed_filter(int filter_id, int index) return filter_presets[ii].short_name; } -static void import_decomb(hb_value_t *preset) +static void import_deint_0_0_0(hb_value_t *preset) { hb_value_t *val = hb_dict_get(preset, "PictureDecomb"); if (hb_value_is_number(val)) @@ -1993,11 +2000,8 @@ static void import_decomb(hb_value_t *preset) hb_dict_set(preset, "PictureDecomb", hb_value_string("off")); } } -} -static void import_deint(hb_value_t *preset) -{ - hb_value_t *val = hb_dict_get(preset, "PictureDeinterlace"); + val = hb_dict_get(preset, "PictureDeinterlace"); if (hb_value_is_number(val)) { const char *s; @@ -2013,9 +2017,10 @@ static void import_deint(hb_value_t *preset) hb_dict_set(preset, "PictureDeinterlace", hb_value_string("off")); } } + import_deint_10_0_0(preset); } -static void import_detel(hb_value_t *preset) +static void import_detel_0_0_0(hb_value_t *preset) { hb_value_t *val = hb_dict_get(preset, "PictureDetelecine"); if (hb_value_is_number(val)) @@ -2035,7 +2040,7 @@ static void import_detel(hb_value_t *preset) } } -static void import_denoise(hb_value_t *preset) +static void import_denoise_0_0_0(hb_value_t *preset) { hb_value_t *val = hb_dict_get(preset, "PictureDenoise"); if (hb_value_is_number(val)) @@ -2058,7 +2063,7 @@ static void import_denoise(hb_value_t *preset) } } -static void import_pic(hb_value_t *preset) +static void import_pic_0_0_0(hb_value_t *preset) { if (hb_value_get_bool(hb_dict_get(preset, "UsesMaxPictureSettings"))) { @@ -2091,7 +2096,7 @@ static void import_pic(hb_value_t *preset) } } -static void import_audio(hb_value_t *preset) +static void import_audio_0_0_0(hb_value_t *preset) { hb_value_t *copy = hb_dict_get(preset, "AudioCopyMask"); if (copy != NULL) @@ -2117,7 +2122,7 @@ static void import_audio(hb_value_t *preset) hb_value_array_append(copy, hb_value_string("copy:truehd")); } -static void import_video(hb_value_t *preset) +static void import_video_0_0_0(hb_value_t *preset) { hb_value_t *val; @@ -2184,6 +2189,21 @@ static void import_video(hb_value_t *preset) } } +static void import_0_0_0(hb_value_t *preset) +{ + import_video_0_0_0(preset); + import_pic_0_0_0(preset); + import_audio_0_0_0(preset); + import_deint_0_0_0(preset); + import_detel_0_0_0(preset); + import_denoise_0_0_0(preset); +} + +static void import_10_0_0(hb_value_t *preset) +{ + import_deint_10_0_0(preset); +} + static void preset_import(hb_value_t *preset, int major, int minor, int micro) { if (!hb_value_get_bool(hb_dict_get(preset, "Folder"))) @@ -2191,13 +2211,11 @@ static void preset_import(hb_value_t *preset, int major, int minor, int micro) if (major == 0 && minor == 0 && micro == 0) { // Convert legacy presets (before versioning introduced) - import_video(preset); - import_pic(preset); - import_audio(preset); - import_decomb(preset); - import_deint(preset); - import_detel(preset); - import_denoise(preset); + import_0_0_0(preset); + } + else if (major == 10 && minor == 0 && micro == 0) + { + import_10_0_0(preset); } preset_clean(preset, hb_preset_template); } diff --git a/libhb/preset_builtin.json b/libhb/preset_builtin.json index cc16e0f89..16cc2bdaa 100644 --- a/libhb/preset_builtin.json +++ b/libhb/preset_builtin.json @@ -30,11 +30,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -90,11 +88,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -150,11 +146,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -210,11 +204,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -278,11 +270,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -346,11 +336,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -414,11 +402,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "fast", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "decomb", + "PictureDeinterlacePreset": "fast", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -474,11 +460,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -534,11 +518,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -594,11 +576,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -661,11 +641,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", @@ -729,11 +707,9 @@ "PictureAutoCrop": true, "PictureBottomCrop": 0, "PictureDeblock": 0, - "PictureDecomb": "default", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "decomb", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDetelecine": "off", diff --git a/libhb/preset_template.json b/libhb/preset_template.json index e371a8ebc..8787c19ca 100644 --- a/libhb/preset_template.json +++ b/libhb/preset_template.json @@ -46,11 +46,9 @@ "PictureTopCrop": 0, "PictureDARWidth": 0, "PictureDeblock": 0, - "PictureDecomb": "off", - "PictureDecombCustom": "", - "PictureDecombDeinterlace": true, - "PictureDeinterlace": "off", "PictureDeinterlaceCustom": "", + "PictureDeinterlaceFilter": "off", + "PictureDeinterlacePreset": "default", "PictureDenoiseCustom": "", "PictureDenoiseFilter": "off", "PictureDenoisePreset": "medium", diff --git a/test/test.c b/test/test.c index 27690cfc1..789b5aae0 100644 --- a/test/test.c +++ b/test/test.c @@ -3429,41 +3429,42 @@ static hb_dict_t * PreparePreset(const char *preset_name) { hb_dict_set(preset, "VideoGrayScale", hb_value_bool(grayscale)); } - if (deinterlace_disable) + if (decomb_disable || deinterlace_disable) { - hb_dict_set(preset, "PictureDeinterlace", hb_value_string("off")); + hb_dict_set(preset, "PictureDeinterlaceFilter", hb_value_string("off")); } if (deinterlace != NULL) { - hb_dict_set(preset, "PictureDecombDeinterlace", hb_value_int(0)); + hb_dict_set(preset, "PictureDeinterlaceFilter", + hb_value_string("deinterlace")); if (!deinterlace_custom) { - hb_dict_set(preset, "PictureDeinterlace", + hb_dict_set(preset, "PictureDeinterlacePreset", hb_value_string(deinterlace)); } else { - hb_dict_set(preset, "PictureDeinterlace", + hb_dict_set(preset, "PictureDeinterlacePreset", hb_value_string("custom")); hb_dict_set(preset, "PictureDeinterlaceCustom", hb_value_string(deinterlace)); } } - if (decomb_disable) - { - hb_dict_set(preset, "PictureDecomb", hb_value_string("off")); - } if (decomb != NULL) { - hb_dict_set(preset, "PictureDecombDeinterlace", hb_value_int(1)); + hb_dict_set(preset, "PictureDeinterlaceFilter", + hb_value_string("decomb")); if (!decomb_custom) { - hb_dict_set(preset, "PictureDecomb", hb_value_string(decomb)); + hb_dict_set(preset, "PictureDeinterlacePreset", + hb_value_string(decomb)); } else { - hb_dict_set(preset, "PictureDecomb", hb_value_string("custom")); - hb_dict_set(preset, "PictureDecombCustom", hb_value_string(decomb)); + hb_dict_set(preset, "PictureDeinterlacePreset", + hb_value_string("custom")); + hb_dict_set(preset, "PictureDeinterlaceCustom", + hb_value_string(decomb)); } } if (detelecine_disable) |