tophf

Kenji

Sep 16th, 2011
1,469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Avisynth 22.93 KB | None | 0 0
  1. setmemorymax(1024)
  2. global DEBUG=!true
  3. DGDecode_mpeg2source("kenji.d2v",info=3)
  4. fix1()
  5. IVTC()
  6. fix2()
  7. fix3()
  8. tdecimate()
  9. crop(6,0,-10,0)
  10. #~ histogram().bilinearresize(1744,1116)
  11. DEBUG ? assumefps(6) : last
  12.  
  13. function IVTC( clip c )
  14. {
  15.     c
  16.     vComb=CombMask(2,5).removegrain(4).binomialblur(2).mt_lut("256 x 8 << -").binomialblur(5)
  17.     global vQ=QTGMC(DEBUG ? "super fast" : "medium",sourcematch=DEBUG ? 0 : 3,fpsdivisor=2,thSAD1=100,thSAD2=100)#.colorstripe()
  18.     vTD=tdeint(tryWeave=true,AP=100,mthreshL=3).maa()
  19.     v2=vQ.mt_merge(repair(vTD,vQ.asharp(),1),vComb,true)\
  20.             .ReplaceFramesSimple(mt_merge(vTD,vComb.mt_invert(),true)/*.colorstripe($ff)*/,mappings="[84090 84104] [84262 84508] [90630 90671] [90699 90901] [94536 94795]")
  21.     tfm(cthresh=1,mi=150,pp=4,clip2=v2,ovr="kenji.tfm",d2v="kenji.d2v",display=!true).trim(0,100987)
  22. }
  23.  
  24. function fix1( clip c )
  25. {
  26.     c
  27.     crop(6,0,-10,0).addborders(6,0,10,0)
  28.     t_checkmate(tfm(cthresh=1,mi=150,ovr="kenji.tfm",d2v="kenji.d2v"),mappings="[0 73382] [73387 76864] [76868 78264] [78267 79411] [79413 100987]")
  29.     ReplaceFramesSimple(mergebycolor(checkmate(),$45655c,70),mappings="[7753 8899]")
  30.     ReplaceFramesSimple(mergebycolor(checkmate(),$1b7ca1,70),mappings="[57672 58419]")
  31.     ReplaceFramesSimple(checkmate().repair(last),mappings="[270 392] [532 690] [1190 1406] [1533 1666] [1667 1786] [1807 1830] [3167 3299] [4021 4177] [4464 4973] [7753 8899] [8900 8952] [9409 9782] [10493 11201] [11569 12001] [12524 12814] [13250 13443] [13777 13806] [17249 17428] [18199 18528] [23417 24008] [28048 28137] [28586 28704] [29693 30593] [31484 31586] [32096 32220] [33402 33593] [33594 33893] [34194 34673] [36091 36296] [36755 36819] [37000 37253] [37494 38156] [38502 38681] [38833 38864] [39194 39371] [39507 39716] [39963 40637] [40673 41535] [43738 44095] [44400 44768] [46464 46471] [47553 47848] [48851 49216] [49365 49390] [49956 50036] [50366 50383] [50484 50527] [50669 50808] [58327 58449] [69081 69808] [70574 70796] [71834 72013] [78087 78548] [78609 79253] [81454 82128] [82808 82943] [83064 83377] [83468 83939] [84090 84104] [84239 84277] [84458 84467] [84531 84537] [84792 84803] [84838 84915] [84946 84955] [84956 84980] [85005 85064] [85137 85158] [85207 86608] [89534 89663] [90418 90548] [90699 93359] [95081 95352] [96362 97146]")
  32. }
  33.  
  34. function fix2( clip c )
  35. {
  36.     c
  37.     mt_merge(daa2(),mt_edge("sobel",2,3).blur(1.5).mt_invert()).repair(last)
  38.     \   .ReplaceFramesSimple(last,mappings="[4232 4389] 10082 11345 [32040 32095] [39717 39837] [39963 40082] [40673 41535] [41538 41545] [41648 41822] 41879 41881 [42265 42966] [43083 43355] [43473 43737] [44935 45042] [45136 45299] [51455 51789] [54850 54938] [68862 68952] 82578 [82721 82737] [82774 82789] 83044 83050 83052 [84090 84104] [84455 84457] [84632 84647] [84957 84969] [87919 88023] [88516 88620] [95764 96040]")
  39.     ReplaceFramesSimple(daa().repair(last),mappings="[32040 32095] [35776 36090] 41879 41881 [68862 68952] 82578 [82721 82737] [82774 82789] 83044 83050 83052 [84090 84104] [84455 84457] [84957 84969] [95764 96040]")
  40.     ReplaceFramesSimple(mt_merge(daa(),mt_logic(mt_binarize(70).removegrain(4).blur(1.58),mt_binarize(140).removegrain(4).mt_inpand().mt_inpand().binomialblur(20),"xor"),true),mappings="[1916 1944]")
  41.     ReplaceFramesSimple(daa(),mappings="9237 11291 11345 [31552 31584] 46433 84418 [97097 97127] [97128 97173]")
  42.  
  43.     ReplaceFramesSimple(lumayv12(int(16*float(240-16)/219-16),219.0/(240-16)),mappings=" [18199 18348] [41776 41822] [44096 44394] [52521 52820] [56516 56718] [77068 77121] [84531 84537] [84846 84865] [85390 85410] [96362 96481]")
  44.     ReplaceFramesSimple(lumayv12(int(16*float(245-16)/219-16),219.0/(245-16)),mappings=" [7467 7572] [9327 9382] [10024 10072] [10082 10142] [12513 12518] [35432 35519] [78266 78323] [78609 79253] [79344 79412] [79736 79817] [85226 85256] [85457 85460] [85476 85478] [85491 85493] [85890 86067] [88182 88264]")
  45.     ReplaceFramesSimple(lumayv12(int(16*float(255-16)/219-16),219.0/(255-16)),mappings=" [38970 39088] [68190 68237] [85065 85089]")
  46.     ReplaceFramesSimple(animate(36448,36496,"lumayv12",int(16*float(245-16)/219-16),219.0/(245-16), int(16*float(236-16)/219-16),219.0/(236-16)),mappings="[36448 36496]")
  47.     ReplaceFramesSimple(animate(45395,45408,"lumayv12",int(16*float(240-16)/219-16),219.0/(240-16), int(16*float(236-16)/219-16),219.0/(236-16)),mappings="[45390 45408]")
  48.     ReplaceFramesSimple(animate(56719,56725,"lumayv12",int(16*float(240-16)/219-16),219.0/(240-16), int(16*float(236-16)/219-16),219.0/(236-16)),mappings="[56719 56725]")
  49.     ReplaceFramesSimple(animate(86068,86071,"lumayv12",int(16*float(245-16)/219-16),219.0/(245-16), int(16*float(236-16)/219-16),219.0/(236-16)),mappings="[86068 86071]")
  50.  
  51.     ReplaceFramesSimple(overlaycropped(freezeframe(0,frameCount()-1,3300),0,394,0,0,fadetop=4),mappings="[3300 3403]")
  52.     ReplaceFramesSimple(overlaycropped(freezeframe(0,frameCount()-1,3300),0,348,340,0,fadetop=4,faderight=4),mappings="[3300 3403]")
  53.     crossfade(4147,4177)
  54.     freezeStillAreas(10406)
  55.     freezeStillAreas(11276,true).freezeStillAreas(11278).freezeStillAreas(11283)
  56.     freezeStillAreas(11345,true)
  57.     freezeOvr(11569,11570, 2,0, fadeleft=8)
  58.     freezeOvr(11996,12000, 0,0, 320,220,100,60)
  59.     vMM=mmask(manalyse(msuper(),isb=true,blksize=8),ml=1,kind=0,thscd1=9999,thscd2=255).bicubicresize(ceil(width/32)*4,ceil(height/32)*4).removegrain(4).bicubicresize(width,height)
  60.     vMM=mt_logic(vMM,vMM.trim(0,-1)+vMM,"or")
  61.     ReplaceFramesSimple(mt_merge(vQ,vMM,true),mappings="[15879 15991] 17694 17695")
  62.     ReplaceFramesSimple(mt_merge(daa(),vMM,true),mappings="17193 17215 17216 17238 17644 17657 17658 17661 17674 17687 17688 20496 20497 28953 28954 [29026 29285] [30316 30317]")
  63.     ReplaceFramesSimple(SeparateFields().selectEven().nnedi3_rpow2(2).spline64resize(width,height),mappings="[16340 16362] [32011 32013]")
  64.     freezeStillAreas(48643,true).freezeStillAreas(48646,true).freezeStillAreas(48653).freezeStillAreas(48654,true).freezeStillAreas(48656).freezeStillAreas(48661,true).freezeStillAreas(48668).freezeStillAreas(48669,true).freezeStillAreas(48683).freezeStillAreas(48698).freezeStillAreas(48713).freezeStillAreas(48728).freezeStillAreas(49782).freezeStillAreas(49785).freezeStillAreas(49795)
  65.     freezeOvr(49958,49957, 1,-1, fade=4)
  66.     freezeOvr(49969,49968, -2,-1, fade=4)
  67.     ReplaceFramesSimple(overlayCropped(freezeframe(50669,50669,50670),240,200,200,200),mappings="50669")
  68.     ReplaceFramesSimple(overlayCropped(freezeframe(50670,50679,50679),500,0,160,360),mappings="[50676 50678]")
  69.     ReplaceFramesSimple(overlaycropped(freezeframe(0,frameCount()-1,54850),464,0,0,0,fadeleft=8,fadetop=8),mappings="[54850 54938]")
  70.     crossfade(70489,70502).crossfade(73668,73700).crossfade(73702,73730).crossfade(84418,84422).crossfade(84425,84430).crossfade(84432,84437).crossfade(84440,84445).crossfade(84447,84452)
  71.     ReplaceFramesSimple(cleanshit().edeenaaa(),mappings="[68704 68757] 85479")
  72.     ReplaceFramesSimple(overlay(last,-2,0,mode="chroma"),mappings="[48851 49216] [80080 80521] [82702 82736] [82755 82789] [88024 88181] [89010 89210] [95419 95612] [96152 96361] [95419 95612]")
  73.     ReplaceFramesSimple(overlay(last,-1,0,mode="chroma"),mappings="[75495 76420] [94879 95352]")
  74.     freezeovr(84618,84619, 0,-11, fadebottom=16)
  75.     freezeovr(84620,84619, 0,11, fadetop=16)
  76.     freezeovr(85890,85892, -2,0)
  77.     freezeovr(85891,85892, -1,0)
  78.     ReplaceFramesSimple(aaa().grainfactory3mod(20,15,10, 100,50,0, 1.5,1.3,1),mappings="[68704 68757] [84275 84508] [85479 85536]")
  79. }
  80.  
  81. function fix3( clip c )
  82. {
  83.     c
  84.     remapframes(mappings="
  85.         [31 134] 134
  86.         1328 1327
  87.         1338 1337
  88.         1918 1917
  89.         2325 2324
  90.         3302 3301
  91.         3305 3304
  92.         3307 3306
  93.         3309 3308
  94.         3312 3311
  95.         3314 3313
  96.         3317 3316
  97.         3319 3318
  98.         3321 3320
  99.         3324 3323
  100.         3326 3325
  101.         3329 3328
  102.         3331 3330
  103.         3333 3332
  104.         3336 3335
  105.         3338 3337
  106.         3340 3339
  107.         3343 3342
  108.         3345 3344
  109.         3348 3347
  110.         3350 3349
  111.         3352 3351
  112.         3355 3354
  113.         3357 3356
  114.         3360 3359
  115.         3362 3361
  116.         3364 3363
  117.         3367 3366
  118.         3369 3368
  119.         3371 3370
  120.         3374 3373
  121.         3376 3375
  122.         3379 3378
  123.         3381 3380
  124.         3383 3382
  125.         3386 3385
  126.         3388 3387
  127.         3391 3390
  128.         3393 3392
  129.         3395 3394
  130.         3398 3397
  131.         3400 3399
  132.         3402 3401
  133.         3702 3701
  134.         3703 3704
  135.         3706 3707
  136.         3708 3709
  137.         3711 3712
  138.         3713 3714
  139.         3716 3717
  140.         3718 3719
  141.         3721 3722
  142.         3723 3724
  143.         3726 3727
  144.         3728 3729
  145.         3731 3732
  146.         3733 3734
  147.         3736 3737
  148.         3738 3739
  149.         3741 3742
  150.         3743 3744
  151.         3746 3747
  152.         3748 3749
  153.         3751 3752
  154.         3753 3754
  155.         3756 3757
  156.         3758 3759
  157.         3761 3762
  158.         3763 3764
  159.         3766 3767
  160.         3768 3769
  161.         3771 3772
  162.         3773 3774
  163.         3776 3777
  164.         3778 3779
  165.         3781 3782
  166.         3783 3784
  167.         3786 3787
  168.         3789 3790
  169.         3791 3792
  170.         3794 3795
  171.         3796 3797
  172.         3799 3800
  173.         3801 3802
  174.         [3804 3806] 3805
  175.         [6375 6376] 6377
  176.         [7753 7938] 7753
  177.         [11223 11229] 11224
  178.         11288 11287
  179.         11293 11292
  180.         11997 11996
  181.         12004 12003
  182.         [13164 13219] 13219
  183.         13249 13248
  184.         [13777 13778] 13779
  185.         13781 13780
  186.         [13782 13783] 13784
  187.         13786 13785
  188.         [13788 13791] 13787
  189.         [13792 13795] 13795
  190.         [13796 13799] 13799
  191.         [13800 13802] 13802
  192.         [13803 13806] 13806
  193.         14840 14839
  194.         [15779 15838] [15779 15838]
  195.         16312 16311
  196.         16316 16315
  197.         16317 16318
  198.         16320 16321
  199.         16324 16325
  200.         16326 16325
  201.         16327 16328
  202.         16329 16330
  203.         16331 16330
  204.         16332 16333
  205.         16334 16335
  206.         16336 16335
  207.         16337 16338
  208.         16339 16338
  209.         17638 17637
  210.         17668 17667
  211.         18529 18530
  212.         20441 20442
  213.         20448 20447
  214.         20451 20452
  215.         20454 20453
  216.         20455 20456
  217.         20457 20458
  218.         20459 20458
  219.         20462 20463
  220.         20489 20488
  221.         20499 20498
  222.         20503 20502
  223.         20504 20505
  224.         20506 20507
  225.         20508 20507
  226.         20511 20512
  227.         20522 20523
  228.         20524 20523
  229.         20527 20528
  230.         20541 20542
  231.         20577 20578
  232.         20579 20578
  233.         20582 20583
  234.         20587 20588
  235.         20589 20588
  236.         20622 20623
  237.         20624 20623
  238.         20632 20633
  239.         20635 20636
  240.         20637 20638
  241.         20764 20763
  242.         20767 20768
  243.         20772 20773
  244.         20809 20808
  245.         20813 20814
  246.         20817 20818
  247.         20820 20819
  248.         20828 20829
  249.         20832 20833
  250.         20835 20836
  251.         20837 20838
  252.         20839 20838
  253.         20840 20841
  254.         20842 20843
  255.         20845 20846
  256.         28137 28136
  257.         28980 28981
  258.         [29408 29482] 29482
  259.         32620 32619
  260.         35435 35436
  261.         35482 35483
  262.         35519 35518
  263.         36091 36092
  264.         36160 36161
  265.         36165 36166
  266.         36170 36171
  267.         36175 36176
  268.         36180 36181
  269.         36185 36186
  270.         36190 36191
  271.         36195 36196
  272.         36200 36201
  273.         36204 36205
  274.         36210 36211
  275.         36214 36215
  276.         36219 36220
  277.         36225 36226
  278.         36229 36230
  279.         36230 36231
  280.         36240 36241
  281.         36242 36243
  282.         36255 36256
  283.         36260 36261
  284.         36269 36268
  285.         36270 36271
  286.         36274 36275
  287.         36285 36286
  288.         36292 36291
  289.         36580 36579
  290.         36600 36601
  291.         36605 36604
  292.         36610 36609
  293.         36620 36621
  294.         36626 36625
  295.         36630 36631
  296.         36640 36641
  297.         36650 36651
  298.         36661 36660
  299.         36670 36671
  300.         36681 36680
  301.         36691 36692
  302.         36701 36700
  303.         36711 36710
  304.         36721 36720
  305.         36731 36730
  306.         36741 36742
  307.         36751 36752
  308.         [36820 36999] 36821
  309.         [37000 37149] 37149
  310.         [37150 37253] 37253
  311.         [37254 37373] 37373
  312.         38403 38404
  313.         38414 38415
  314.         38418 38419
  315.         38429 38430
  316.         38433 38434
  317.         38444 38445
  318.         38448 38449
  319.         38459 38460
  320.         38463 38464
  321.         38474 38475
  322.         38478 38479
  323.         38489 38490
  324.         38493 38494
  325.         [38682 38832] 38832
  326.         39506 39505
  327.         41823 41824
  328.         45303 45304
  329.         45314 45315
  330.         45318 45319
  331.         45329 45330
  332.         45333 45334
  333.         46836 46835
  334.         46839 46838
  335.         46841 46840
  336.         46842 46843
  337.         [46845 46846] 46844
  338.         46848 46849
  339.         46877 46876
  340.         [46878 46879] 46880
  341.         46881 46882
  342.         46887 46886
  343.         46888 46889
  344.         [46890 46891] 46892
  345.         46893 46894
  346.         46896 46895
  347.         46897 46898
  348.         46898 46899
  349.         46901 46900
  350.         46902 46903
  351.         46907 46906
  352.         46909 46910
  353.         [46913 46914] 46912
  354.         46916 46915
  355.         46917 46918
  356.         46919 46920
  357.         46921 46922
  358.         46925 46924
  359.         [46927 46928] 46929
  360.         46930 46929
  361.         [46933 46934] 46932
  362.         [46940 46941] 46939
  363.         46942 46943
  364.         46945 46944
  365.         [46946 46947] 46948
  366.         46950 46949
  367.         [46951 46952] 46953
  368.         46955 46954
  369.         46956 46957
  370.         [46958 46959] 46960
  371.         46962 46961
  372.         [46965 46967] 46966
  373.         46969 46968
  374.         [46970 46971] 46972
  375.         46974 46973
  376.         46976 46975
  377.         [46977 46978] 46979
  378.         46981 46980
  379.         46982 46983
  380.         [46984 46985] 46986
  381.         46988 46989
  382.         46991 46990
  383.         46994 46993
  384.         46996 46997
  385.         46999 47000
  386.         47001 47002
  387.         47005 47004
  388.         47008 47009
  389.         47012 47011
  390.         47014 47015
  391.         47018 47017
  392.         47019 47020
  393.         47022 47023
  394.         47025 47026
  395.         47027 47028
  396.         47031 47030
  397.         47033 47034
  398.         47037 47036
  399.         47038 47039
  400.         47042 47041
  401.         47044 47045
  402.         47048 47047
  403.         47050 47049
  404.         47052 47053
  405.         47056 47055
  406.         47058 47057
  407.         47061 47060
  408.         47063 47064
  409.         47065 47066
  410.         [47067 47068] 47069
  411.         47071 47070
  412.         47073 47072
  413.         47075 47076
  414.         [47078 47080] 47079
  415.         47081 47082
  416.         47083 47084
  417.         47086 47085
  418.         47088 47089
  419.         [47090 47092] 47091
  420.         47093 47094
  421.         47095 47096
  422.         [47097 47099] 47098
  423.         47100 47101
  424.         47103 47102
  425.         47105 47106
  426.         47108 47107
  427.         47110 47109
  428.         47111 47112
  429.         47113 47114
  430.         47117 47116
  431.         47119 47118
  432.         47122 47121
  433.         47124 47125
  434.         47158 47159
  435.         47162 47163
  436.         47167 47168
  437.         47172 47173
  438.         47177 47178
  439.         47182 47183
  440.         47184 47183
  441.         47187 47188
  442.         47192 47193
  443.         47197 47198
  444.         47202 47203
  445.         47204 47203
  446.         47207 47208
  447.         47209 47208
  448.         47212 47213
  449.         47214 47213
  450.         47217 47218
  451.         47219 47218
  452.         47222 47223
  453.         47224 47223
  454.         47227 47228
  455.         47229 47228
  456.         47230 47231
  457.         47232 47233
  458.         47234 47233
  459.         47237 47238
  460.         47239 47238
  461.         47240 47241
  462.         47242 47243
  463.         47244 47243
  464.         47245 47246
  465.         47247 47248
  466.         47249 47248
  467.         47252 47253
  468.         47254 47253
  469.         47257 47258
  470.         47259 47258
  471.         47262 47263
  472.         47264 47263
  473.         47267 47268
  474.         47269 47268
  475.         47272 47273
  476.         47274 47273
  477.         47277 47278
  478.         47279 47278
  479.         47282 47283
  480.         47284 47283
  481.         47287 47288
  482.         47289 47288
  483.         47292 47293
  484.         47294 47293
  485.         47297 47298
  486.         47299 47298
  487.         47302 47303
  488.         47304 47303
  489.         47307 47308
  490.         47309 47308
  491.         47312 47313
  492.         47322 47323
  493.         47327 47328
  494.         47332 47333
  495.         47337 47338
  496.         47339 47338
  497.         47342 47343
  498.         47347 47348
  499.         47349 47348
  500.         47352 47353
  501.         47357 47358
  502.         47359 47358
  503.         47362 47363
  504.         47367 47368
  505.         47372 47373
  506.         47374 47373
  507.         47377 47378
  508.         47379 47378
  509.         47382 47383
  510.         47384 47383
  511.         47387 47388
  512.         47389 47388
  513.         47392 47393
  514.         47397 47398
  515.         47399 47398
  516.         47400 47401
  517.         47402 47403
  518.         47404 47403
  519.         47407 47408
  520.         47409 47408
  521.         47412 47413
  522.         47414 47413
  523.         47415 47416
  524.         47417 47418
  525.         47419 47418
  526.         47420 47421
  527.         47422 47423
  528.         47424 47423
  529.         47427 47428
  530.         47429 47428
  531.         47432 47433
  532.         47434 47433
  533.         47435 47436
  534.         47437 47438
  535.         47442 47443
  536.         47447 47448
  537.         47452 47453
  538.         47454 47453
  539.         47457 47458
  540.         47459 47458
  541.         47460 47461
  542.         47462 47463
  543.         47464 47463
  544.         47467 47468
  545.         47469 47468
  546.         47472 47473
  547.         47474 47473
  548.         47477 47478
  549.         47479 47478
  550.         47482 47483
  551.         47484 47483
  552.         47487 47488
  553.         47489 47488
  554.         47492 47493
  555.         47494 47493
  556.         47497 47498
  557.         47499 47498
  558.         47502 47503
  559.         47504 47503
  560.         47507 47508
  561.         47509 47508
  562.         47512 47513
  563.         47517 47518
  564.         47522 47523
  565.         47524 47523
  566.         47527 47528
  567.         47532 47533
  568.         47537 47538
  569.         47542 47543
  570.         47547 47548
  571.         47549 47548
  572.         47553 47552
  573.         47853 47852
  574.         47858 47857
  575.         47933 47932
  576.         47943 47942
  577.         47976 47975
  578.         47979 47978
  579.         47981 47980
  580.         47986 47985
  581.         47991 47990
  582.         47996 47995
  583.         47997 47998
  584.         48001 48000
  585.         48006 48005
  586.         48011 48010
  587.         [48613 48614] 48615
  588.         48622 48621
  589.         48626 48625
  590.         48627 48628
  591.         48630 48631
  592.         48634 48635
  593.         48641 48640
  594.         48769 48768
  595.         48776 48775
  596.         48777 48778
  597.         48784 48783
  598.         48791 48790
  599.         48792 48793
  600.         48799 48798
  601.         48806 48805
  602.         48807 48808
  603.         48814 48813
  604.         48821 48820
  605.         48822 48823
  606.         48829 48828
  607.         48830 48831
  608.         48837 48838
  609.         48844 48843
  610.         49153 49154
  611.         49156 49157
  612.         49159 49160
  613.         49162 49163
  614.         49165 49166
  615.         49168 49169
  616.         49171 49172
  617.         49174 49175
  618.         49177 49176
  619.         49180 49179
  620.         49183 49182
  621.         49186 49185
  622.         49189 49188
  623.         49192 49191
  624.         49195 49194
  625.         49198 49197
  626.         49201 49200
  627.         49204 49203
  628.         49207 49206
  629.         49209 49210
  630.         49212 49213
  631.         49215 49216
  632.         49254 49255
  633.         49263 49262
  634.         49265 49264
  635.         49267 49266
  636.         49269 49268
  637.         49271 49272
  638.         49273 49274
  639.         49275 49276
  640.         49277 49278
  641.         49391 49392
  642.         49734 49735
  643.         49736 49737
  644.         49741 49742
  645.         49745 49746
  646.         49750 49751
  647.         49753 49754
  648.         49755 49756
  649.         49761 49762
  650.         49765 49766
  651.         49765 49766
  652.         49789 49788
  653.         49799 49798
  654.         49921 49922
  655.         49961 49962
  656.         [50073 50074] 50075
  657.         50078 50077
  658.         50081 50080
  659.         50089 50090
  660.         50093 50094
  661.         50097 50096
  662.         50101 50100
  663.         50109 50110
  664.         50113 50114
  665.         50117 50118
  666.         50121 50120
  667.         50133 50132
  668.         50137 50136
  669.         50141 50140
  670.         50145 50144
  671.         50153 50154
  672.         50157 50156
  673.         50161 50160
  674.         50165 50164
  675.         50176 50177
  676.         50180 50181
  677.         50184 50183
  678.         50384 50385
  679.         50390 50389
  680.         50394 50395
  681.         50401 50402
  682.         50406 50407
  683.         50411 50412
  684.         50414 50413
  685.         50635 50636
  686.         53092 53093
  687.         [54075 54076] 54077
  688.         [55143 55145] 55142
  689.         [55146 55149] 55146
  690.         [55151 55154] 55152
  691.         59809 59808
  692.         59811 59810
  693.         59814 59813
  694.         59816 59815
  695.         59819 59818
  696.         59821 59820
  697.         59824 59823
  698.         59826 59825
  699.         59829 59828
  700.         59831 59830
  701.         59834 59833
  702.         59836 59835
  703.         59838 59837
  704.         59841 59840
  705.         59844 59843
  706.         59846 59845
  707.         59848 59847
  708.         59851 59850
  709.         59852 59850
  710.         59853 59854
  711.         59856 59855
  712.         [59857 59858] 59859
  713.         [59861 59862] 59860
  714.         [59863 59865] 59864
  715.         [59866 59868] 59867
  716.         59871 59870
  717.         [59872 59874] 59872
  718.         [59875 59877] 59877
  719.         59878 59879
  720.         59881 59880
  721.         59883 59882
  722.         59886 59885
  723.         59888 59889
  724.         59891 59892
  725.         59893 59892
  726.         59896 59895
  727.         59898 59897
  728.         59899 59898
  729.         59901 59900
  730.         59903 59904
  731.         59906 59905
  732.         59908 59907
  733.         59911 59910
  734.         59913 59914
  735.         59916 59917
  736.         59918 59917
  737.         59921 59920
  738.         59923 59922
  739.         59926 59925
  740.         59927 59926
  741.         59928 59929
  742.         59931 59930
  743.         59933 59934
  744.         59936 59937
  745.         59938 59939
  746.         59941 59942
  747.         59943 59942
  748.         59946 59945
  749.         59948 59949
  750.         59951 59950
  751.         59953 59954
  752.         59956 59955
  753.         59958 59957
  754.         59961 59960
  755.         59963 59964
  756.         59966 59967
  757.         59968 59967
  758.         59970 59969
  759.         59973 59972
  760.         59975 59976
  761.         59978 59977
  762.         59980 59981
  763.         59983 59982
  764.         59985 59986
  765.         59988 59989
  766.         59990 59989
  767.         59993 59992
  768.         59995 59996
  769.         59998 59997
  770.         60000 60001
  771.         60003 60002
  772.         60005 60004
  773.         60008 60007
  774.         60010 60011
  775.         60013 60014
  776.         60015 60014
  777.         60018 60017
  778.         60020 60019
  779.         60022 60023
  780.         60023 60022
  781.         60025 60026
  782.         60028 60027
  783.         60030 60029
  784.         60033 60032
  785.         60035 60036
  786.         60038 60039
  787.         60040 60039
  788.         60043 60042
  789.         60045 60044
  790.         60048 60047
  791.         60050 60051
  792.         60053 60052
  793.         60055 60054
  794.         60058 60057
  795.         60060 60061
  796.         60063 60064
  797.         60065 60064
  798.         60068 60067
  799.         60070 60071
  800.         60073 60072
  801.         60075 60076
  802.         60078 60077
  803.         60080 60079
  804.         60083 60082
  805.         60085 60086
  806.         60088 60089
  807.         60090 60089
  808.         60093 60092
  809.         60095 60094
  810.         60098 60097
  811.         60100 60101
  812.         60103 60102
  813.         60105 60104
  814.         60107 60108
  815.         60110 60111
  816.         60112 60111
  817.         #[60113 60212] 60113
  818.         36644 36643
  819.         36645 36646
  820.         52520 52519
  821.         68862 68863
  822.         70483 70482
  823.         [70502 70573] 70503
  824.         70902 70903
  825.         70910 70909
  826.         70915 70916
  827.         70920 70921
  828.         70927 70926
  829.         70930 70931
  830.         70939 70938
  831.         70940 70941
  832.         70949 70950
  833.         70952 70953
  834.         70959 70960
  835.         70964 70965
  836.         70969 70970
  837.         70976 70977
  838.         70979 70978
  839.         70989 70988
  840.         77382 77381
  841.         78087 78088
  842.         [78177 78178] 78179
  843.         81754 81755
  844.         82219 82220
  845.         82222 82223
  846.         82224 82225
  847.         82227 82228
  848.         82229 82230
  849.         82232 82233
  850.         82234 82235
  851.         82237 82238
  852.         82239 82240
  853.         82242 82243
  854.         82244 82245
  855.         82247 82248
  856.         82249 82250
  857.         82252 82253
  858.         82254 82255
  859.         82257 82258
  860.         82259 82260
  861.         82262 82263
  862.         82264 82265
  863.         82267 82268
  864.         82269 82270
  865.         82272 82273
  866.         82274 82275
  867.         82277 82278
  868.         82279 82280
  869.         82282 82283
  870.         82284 82285
  871.         82287 82288
  872.         82289 82290
  873.         82292 82293
  874.         82294 82295
  875.         82297 82298
  876.         82299 82300
  877.         82304 82305
  878.         82307 82308
  879.         82309 82310
  880.         82311 82310
  881.         82312 82313
  882.         82314 82315
  883.         82319 82320
  884.         82322 82323
  885.         82324 82325
  886.         82342 82341
  887.         82344 82345
  888.         82347 82348
  889.         82351 82352
  890.         82354 82355
  891.         82356 82357
  892.         82359 82360
  893.         82361 82362
  894.         82364 82365
  895.         82366 82367
  896.         82369 82370
  897.         82371 82372
  898.         82374 82375
  899.         82376 82377
  900.         82379 82380
  901.         82381 82382
  902.         82384 82385
  903.         82386 82387
  904.         82389 82390
  905.         82391 82392
  906.         82394 82395
  907.         82396 82397
  908.         82399 82400
  909.         82401 82402
  910.         82404 82405
  911.         82406 82407
  912.         82409 82410
  913.         82411 82412
  914.         82414 82415
  915.         82416 82417
  916.         82419 82420
  917.         82421 82422
  918.         82424 82425
  919.         82426 82427
  920.         82429 82430
  921.         82431 82432
  922.         82434 82435
  923.         82436 82437
  924.         82439 82440
  925.         82441 82442
  926.         82444 82445
  927.         82446 82447
  928.         82449 82450
  929.         82451 82452
  930.         82454 82455
  931.         82456 82457
  932.         82459 82460
  933.         82461 82462
  934.         82464 82465
  935.         82466 82467
  936.         82469 82470
  937.         82471 82472
  938.         82474 82475
  939.         84573 84574
  940.         84599 84600
  941.         84617 84618
  942.         84621 84622
  943.         84637 84636
  944.         84766 84765
  945.         84767 84768
  946.         84772 84773
  947.         84777 84778
  948.         [84782 84783] 84784
  949.         84787 84786
  950.         84788 84789
  951.         84790 84791
  952.         85106 85107
  953.         85110 85109
  954.         85111 85112
  955.         85116 85117
  956.         85118 85119
  957.         85860 85861
  958.         86774 86775
  959.         1807 1808
  960.         86903 86902
  961.         86906 86907
  962.         86908 86907
  963.         86911 86912
  964.         86913 86912
  965.         86916 86917
  966.         86918 86917
  967.         87443 87444
  968.         89123 89124
  969.         90073 90074
  970.         90549 90550
  971.         90558 90559
  972.         90623 90622
  973.         90631 90632
  974.         90637 90638
  975.         90670 90671
  976.         94568 94567
  977.         94572 94573
  978.         94577 94578
  979.         94582 94583
  980.         94684 94683
  981.         94688 94687
  982.         94699 94698
  983.         94703 94702
  984.         94707 94708
  985.         94711 94712
  986.         94731 94732
  987.         94733 94732
  988.         94734 94735
  989.         94737 94738
  990.         94741 94742
  991.         94744 94743
  992.         94745 94746
  993.         94750 94751
  994.         94769 94768
  995.         94770 94771
  996.         94773 94774
  997.         94777 94778
  998.         94780 94779
  999.         94784 94783
  1000.         96786 96785
  1001.         1407 1408
  1002.         5787 5788
  1003.         11361 11362
  1004.         14786 14787
  1005.         [15779 15780] 15781
  1006.         15879 15880
  1007.         16345 16346
  1008.         16349 16348
  1009.         16350 16351
  1010.         16354 16353
  1011.         16355 16356
  1012.         16360 16361
  1013.         16362 16363
  1014.         16395 16396
  1015.         16414 16415
  1016.         16425 16426
  1017.         26340 26341
  1018.         15957 15958
  1019.         15959 15960
  1020.         16016 16017
  1021.         20497 20498
  1022.         20627 20628
  1023.         [73382 73384] 73381
  1024.         73385 73386
  1025.         [76864 76865] 76863
  1026.         [76866 76867] 76868
  1027.         78265 78264
  1028.         78266 78267
  1029.         ")
  1030. }
  1031.  
  1032. function t_checkmate( clip c, clip "cTFM", string "mappings", int "blksize", bool "showmask")
  1033. {
  1034.     mappings=default(mappings,"")
  1035.     blksize=default(blksize,8)
  1036.     showmask=default(showmask,false)
  1037.  
  1038.     vCM=c.checkmate().repair(c)
  1039.     vMaskSkipCombed=c.mt_lutxy(c.daa(),"x y - abs",chroma="128").coloryuv(autogain=true,autowhite=true)
  1040.     vMaskSkipCombed=vMaskSkipCombed.mt_lutf(vMaskSkipCombed,"avg","x 16 < 255 y - y ?").mt_expand().mt_expand(chroma="128").removegrain(4)
  1041.     vMaskSkipCombed=vMaskSkipCombed.mt_logic(vMaskSkipCombed.trim(1,0),"min")
  1042.     c.mt_merge(vCM,vMaskSkipCombed.mt_lutf(vMaskSkipCombed,"min","x",offx=8,offy=3,w=c.width-16).bilinearresize(c.width,c.height,8,3,c.width-16).mt_binarize(250),true)
  1043.  
  1044.     cTFM=default(cTFM,c.tfm(cthresh=1,mi=100)).crop(16,16,-16,-16).addborders(16,16,16,16)
  1045.     vMA=manalyse(msuper(cTFM),blksize=blksize)
  1046.     vSC=MSCDetection(cTFM,vMA)
  1047.     vMM=cTFM.t_motionmask(2,blksize,MA=vMA)
  1048.     vMMinv=vMM.mt_invert().mt_logic(vMaskSkipCombed,"min").bilinearresize(ceil(float(c.width)/blksize/8)*4,ceil(float(c.height)/blksize/8)*4).mt_inpand().bicubicresize(c.width,c.height)
  1049.  
  1050.     mt_merge(mt_merge(c.checkmate(100,50,50),vMMinv,y=2,u=4,v=4),vMMinv.mt_logic(c.linemask().mt_expand().binomialblur(5,u=1,v=1),"and"),true)
  1051.     mt_merge(trim(1,0),mt_logic(vSC,vMM,"and"),true)
  1052.     mt_merge(trim(0,-1)+last,mt_logic(vSC.trim(1,0),vMM,"and"),true)
  1053.     mappings=="" ? last : c.ReplaceFramesSimple(last,mappings=mappings)
  1054.     showmask ? overlay(mt_lut(y=-255,u=0,v=0),0,0,vMMinv,0.5,mode="chroma") : last
  1055. }
Advertisement
Add Comment
Please, Sign In to add comment