Skip to content

Commit cd4470e

Browse files
Make 30 advanced QTGMC parameters optional and fix missing template blocks
Parameters like TrueMotion, GlobalMotion, DCT, SubPelInterp, ThSAD1/2, ThSCD1/2, and 22 others were always passed to QTGMC even when the user hadn't touched them. Tools like Hybrid don't expose these at all — they should be optional so QTGMC uses its own preset-driven defaults. - Mark 30 QTGMC parameters as optional in deinterlace.json schema - Add 5 missing template blocks (Str, Amp, FastMA, ESearchP, RefineMotion) to pipeline_template.vpy — these params had no template substitution - Add corresponding process_optional_* calls in script_generator.rs - Fix OpenCL vapoursynth.name casing (OpenCL→opencl) to match template Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3012762 commit cd4470e

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

app/assets/filters/core/deinterlace.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@
322322
"rep1": {
323323
"type": "integer",
324324
"default": 0,
325+
"optional": true,
325326
"min": 0,
326327
"max": 4,
327328
"vapoursynth": {
@@ -361,6 +362,7 @@
361362
"repChroma": {
362363
"type": "boolean",
363364
"default": true,
365+
"optional": true,
364366
"vapoursynth": {
365367
"name": "RepChroma"
366368
},
@@ -441,6 +443,7 @@
441443
"ediQual": {
442444
"type": "integer",
443445
"default": 1,
446+
"optional": true,
444447
"min": 1,
445448
"max": 2,
446449
"vapoursynth": {
@@ -480,6 +483,7 @@
480483
"chromaEdi": {
481484
"type": "enum",
482485
"default": "",
486+
"optional": true,
483487
"options": [
484488
"",
485489
"NNEDI3",
@@ -620,6 +624,7 @@
620624
"trueMotion": {
621625
"type": "boolean",
622626
"default": false,
627+
"optional": true,
623628
"vapoursynth": {
624629
"name": "TrueMotion"
625630
},
@@ -716,6 +721,7 @@
716721
"globalMotion": {
717722
"type": "boolean",
718723
"default": true,
724+
"optional": true,
719725
"vapoursynth": {
720726
"name": "GlobalMotion"
721727
},
@@ -732,6 +738,7 @@
732738
"dct": {
733739
"type": "integer",
734740
"default": 0,
741+
"optional": true,
735742
"min": 0,
736743
"max": 10,
737744
"vapoursynth": {
@@ -771,6 +778,7 @@
771778
"subPelInterp": {
772779
"type": "integer",
773780
"default": 2,
781+
"optional": true,
774782
"min": 0,
775783
"max": 2,
776784
"vapoursynth": {
@@ -790,6 +798,7 @@
790798
"thSad1": {
791799
"type": "integer",
792800
"default": 640,
801+
"optional": true,
793802
"min": 0,
794803
"max": 2000,
795804
"vapoursynth": {
@@ -809,6 +818,7 @@
809818
"thSad2": {
810819
"type": "integer",
811820
"default": 256,
821+
"optional": true,
812822
"min": 0,
813823
"max": 2000,
814824
"vapoursynth": {
@@ -828,6 +838,7 @@
828838
"thScd1": {
829839
"type": "integer",
830840
"default": 180,
841+
"optional": true,
831842
"min": 0,
832843
"max": 500,
833844
"vapoursynth": {
@@ -847,6 +858,7 @@
847858
"thScd2": {
848859
"type": "integer",
849860
"default": 98,
861+
"optional": true,
850862
"min": 0,
851863
"max": 255,
852864
"vapoursynth": {
@@ -948,6 +960,7 @@
948960
"sOvs": {
949961
"type": "integer",
950962
"default": 0,
963+
"optional": true,
951964
"min": 0,
952965
"max": 255,
953966
"vapoursynth": {
@@ -967,6 +980,7 @@
967980
"svThin": {
968981
"type": "number",
969982
"default": 0.0,
983+
"optional": true,
970984
"min": 0.0,
971985
"max": 1.0,
972986
"step": 0.1,
@@ -1092,6 +1106,7 @@
10921106
"noisePreset": {
10931107
"type": "enum",
10941108
"default": "Fast",
1109+
"optional": true,
10951110
"options": [
10961111
"Slower",
10971112
"Slow",
@@ -1140,6 +1155,7 @@
11401155
"fftThreads": {
11411156
"type": "integer",
11421157
"default": 1,
1158+
"optional": true,
11431159
"min": 1,
11441160
"max": 16,
11451161
"vapoursynth": {
@@ -1218,6 +1234,7 @@
12181234
"chromaNoise": {
12191235
"type": "boolean",
12201236
"default": false,
1237+
"optional": true,
12211238
"vapoursynth": {
12221239
"name": "ChromaNoise"
12231240
},
@@ -1234,6 +1251,7 @@
12341251
"showNoise": {
12351252
"type": "number",
12361253
"default": 0.0,
1254+
"optional": true,
12371255
"min": 0.0,
12381256
"max": 2.0,
12391257
"step": 0.1,
@@ -1339,6 +1357,7 @@
13391357
"sourceMatch": {
13401358
"type": "integer",
13411359
"default": 0,
1360+
"optional": true,
13421361
"min": 0,
13431362
"max": 3,
13441363
"vapoursynth": {
@@ -1468,6 +1487,7 @@
14681487
"matchTr2": {
14691488
"type": "integer",
14701489
"default": 1,
1490+
"optional": true,
14711491
"min": 0,
14721492
"max": 3,
14731493
"vapoursynth": {
@@ -1487,6 +1507,7 @@
14871507
"matchEnhance": {
14881508
"type": "number",
14891509
"default": 0.5,
1510+
"optional": true,
14901511
"min": 0.0,
14911512
"max": 1.0,
14921513
"step": 0.1,
@@ -1508,6 +1529,7 @@
15081529
"lossless": {
15091530
"type": "integer",
15101531
"default": 0,
1532+
"optional": true,
15111533
"min": 0,
15121534
"max": 2,
15131535
"vapoursynth": {
@@ -1527,6 +1549,7 @@
15271549
"border": {
15281550
"type": "boolean",
15291551
"default": false,
1552+
"optional": true,
15301553
"vapoursynth": {
15311554
"name": "Border"
15321555
},
@@ -1560,6 +1583,7 @@
15601583
"forceTr": {
15611584
"type": "integer",
15621585
"default": 0,
1586+
"optional": true,
15631587
"min": 0,
15641588
"max": 3,
15651589
"vapoursynth": {
@@ -1579,6 +1603,7 @@
15791603
"str": {
15801604
"type": "number",
15811605
"default": 2.0,
1606+
"optional": true,
15821607
"min": 0.0,
15831608
"max": 4.0,
15841609
"step": 0.25,
@@ -1600,6 +1625,7 @@
16001625
"amp": {
16011626
"type": "number",
16021627
"default": 0.0625,
1628+
"optional": true,
16031629
"min": 0.0,
16041630
"max": 1.0,
16051631
"step": 0.0625,
@@ -1621,6 +1647,7 @@
16211647
"fastMa": {
16221648
"type": "boolean",
16231649
"default": false,
1650+
"optional": true,
16241651
"vapoursynth": {
16251652
"name": "FastMA"
16261653
},
@@ -1637,6 +1664,7 @@
16371664
"eSearchP": {
16381665
"type": "boolean",
16391666
"default": false,
1667+
"optional": true,
16401668
"vapoursynth": {
16411669
"name": "ESearchP"
16421670
},
@@ -1653,6 +1681,7 @@
16531681
"refineMotion": {
16541682
"type": "boolean",
16551683
"default": false,
1684+
"optional": true,
16561685
"vapoursynth": {
16571686
"name": "RefineMotion"
16581687
},
@@ -1669,8 +1698,9 @@
16691698
"opencl": {
16701699
"type": "boolean",
16711700
"default": false,
1701+
"optional": true,
16721702
"vapoursynth": {
1673-
"name": "OpenCL"
1703+
"name": "opencl"
16741704
},
16751705
"ui": {
16761706
"label": "OpenCL",

worker/src/script_generator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ impl ScriptGenerator {
375375
script = process_optional_bool("BORDER", params.border, script);
376376
script = process_optional_bool("PRECISE", params.precise, script);
377377
script = process_optional_int("FORCE_TR", params.force_tr, script);
378+
script = process_optional_double("STR", params.str, script);
379+
script = process_optional_double("AMP", params.amp, script);
380+
script = process_optional_bool("FAST_MA", params.fast_ma, script);
381+
script = process_optional_bool("E_SEARCH_P", params.e_search_p, script);
382+
script = process_optional_bool("REFINE_MOTION", params.refine_motion, script);
378383

379384
// GPU — default to OpenCL on macOS where ZNEDI3/NNEDI3
380385
// lack NEON optimisations and run pure scalar C.

worker/templates/pipeline_template.vpy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,21 @@ clip = haf.QTGMC(
271271
{{#FORCE_TR}}
272272
ForceTR={{FORCE_TR}},
273273
{{/FORCE_TR}}
274+
{{#STR}}
275+
Str={{STR}},
276+
{{/STR}}
277+
{{#AMP}}
278+
Amp={{AMP}},
279+
{{/AMP}}
280+
{{#FAST_MA}}
281+
FastMA={{FAST_MA}},
282+
{{/FAST_MA}}
283+
{{#E_SEARCH_P}}
284+
ESearchP={{E_SEARCH_P}},
285+
{{/E_SEARCH_P}}
286+
{{#REFINE_MOTION}}
287+
RefineMotion={{REFINE_MOTION}},
288+
{{/REFINE_MOTION}}
274289
{{#OPENCL}}
275290
opencl={{OPENCL}},
276291
{{/OPENCL}}

0 commit comments

Comments
 (0)