Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
3rd July 2021, 11:16 | #81 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
I checked it yesterday and didn't find an issue. I tested null resize with both default b and c, with 0 and 0.5, and raw source and got no differences.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
3rd July 2021, 12:46 | #82 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
Quote:
Last edited by wonkey_monkey; 3rd July 2021 at 13:09. |
|
4th July 2021, 17:24 | #83 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
I still don't understand, yes, adding a minimal shift shows a difference, it's blurrier:
bicubicresize(1920, 1036, src_left=0.00001, src_top = 0.00001) If I add catrom coeffs as you suggest it's no blurrier anymore: bicubicresize(1920, 1036, 0, 0.5, src_left=0.00001, src_top = 0.00001) But that matches a simple null resize with default values: bicubicresize(1920, 1036)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
4th July 2021, 17:50 | #84 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,018
|
Wonkey,
Didn't you post some example which clearly showed the problem and which stood out like "a sore thumb". .
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
4th July 2021, 18:57 | #85 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,593
|
what about z_BicubicResize ?
__________________
See My Avisynth Stuff |
4th July 2021, 19:01 | #86 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
Quote:
Code:
version animate(0,16, "bicubicresize", width,height,4,4,-16.0,-16.0, width,height,4,4,16.0,16.0) Anyway I really just wanted to make sure you were aware that by using BicubicResize with the default parameters you will (unless your resize happens to be a null one) induce a slight, possibly unwanted, blur. Last edited by wonkey_monkey; 4th July 2021 at 19:08. |
|
8th July 2021, 13:00 | #87 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Continuing from this post:
@wonkey_monkey: So this is my last attempt at the ternary method. What is wrong about it? The ternary chooses either one or the other, A or C based on the previous comparison which I stored on Q, so I have still 3 elements in the second rightmost comparison. Code:
+"A C < Q@ A AA@ C CC@ ? Q C CC@ A AA@ ? + Z^ " +"B D < Q@ B BB@ D DD@ ? Q D DD@ B BB@ ? + Z^ " +"E G < Q@ E EE@ G GG@ ? Q G GG@ E EE@ ? + Z^ " +"F H < Q@ F FF@ H HH@ ? Q H HH@ F FF@ ? + Z^ " +"AA EE < Q@ AA A@ EE E@ ? Q EE E@ AA A@ ? + Z^ " +"BB FF < Q@ BB B@ FF F@ ? Q FF F@ BB B@ ? + Z^ " +"CC GG < Q@ CC C@ GG G@ ? Q GG G@ CC C@ ? + Z^ " +"DD HH < Q@ DD D@ HH H@ ? Q HH H@ DD D@ ? + Z^ " +"A B < Q@ A AA@ B BB@ ? Q B BB@ A AA@ ? + Z^ " +"C D < Q@ C CC@ D DD@ ? Q D DD@ C CC@ ? + Z^ " +"E F < Q@ E EE@ F FF@ ? Q F FF@ E EE@ ? + Z^ " +"G H < Q@ G GG@ H HH@ ? Q H HH@ G GG@ ? + Z^ " +"CC EE < Q@ CC CC@ EE E@ ? Q EE E@ CC C@ ? + Z^ " +"DD FF < Q@ DD D@ FF F@ ? Q FF F@ DD D@ ? + Z^ " +"BB E < Q@ BB B@ E EE@ ? Q E EE@ BB B@ ? + Z^ " +"D GG < Q@ D DD@ GG G@ ? Q GG G@ D DD@ ? + Z^ " +"B C < Q@ B BB@ C CC@ ? Q C CC@ B BB@ ? + Z^ " +"DD EE < Q@ DD D@ EE E@ ? Q EE E@ DD D@ ? + Z^ " +"F G < Q@ F FF@ G GG@ ? Q G GG@ F FF@ ? + Z^ "
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
8th July 2021, 13:15 | #88 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
Code:
A C < Q@ A AA@ C CC@ ? Q C CC@ A AA@ ? + Z^ The stack goes: Code:
A A, C (A<C) (followed by a store to Q which does nothing to the stack) (A<C), A (followed by store to AA which does nothing to the stack) (A<C), A, C (followed by store to CC which does nothing to the stack) (A or C) <- result of first "?" (A or C), Q (A or C), Q, C (followed by store to CC, does nothing) (A or C), Q, C, A (followed by store to AA, does nothing) (A or C), (C or A) So that code simplifies to Code:
A @AA C @CC |
8th July 2021, 13:34 | #89 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
As I see it, it was a matter of swap:
Code:
A C < Q@ A AA@ C CC@ ? Q C AA@ A CC@ ? + test this and you will get an error: Code:
"A C < A C ? A C < C A ?" EDIT: I saw it. Code:
A C < Q@ A C ? AA@ Q C A ? CC@
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 8th July 2021 at 13:39. |
8th July 2021, 13:41 | #90 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
Quote:
All suggestions leave the values of both A and C on the stack in order. |
|
8th July 2021, 13:55 | #91 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
That only answers an ideal test scenario of 2 inputs (no need for a sort algo actually) and not what I asked which was a very well defined sorting network of 8 inputs.
One output needs to feed the next and so on in order to work. In your example you are not popping anything, if you did the assumed benefit of Q@ (or R@ in your case) wouldn't work. This works (very slow): Code:
+"A C < A C ? AA^ A C < C A ? CC^ " +"B D < B D ? BB^ B D < D B ? DD^ " +"E G < E G ? EE^ E G < G E ? GG^ " +"F H < F H ? FF^ F H < H F ? HH^ " +"AA EE < AA EE ? A^ AA EE < EE AA ? E^ " +"BB FF < BB FF ? B^ BB FF < FF BB ? F^ " +"CC GG < CC GG ? C^ CC GG < GG CC ? G^ " +"DD HH < DD HH ? D^ DD HH < HH DD ? H^ " +"A B < A B ? AA^ A B < B A ? BB^ " +"C D < C D ? CC^ C D < D C ? DD^ " +"E F < E F ? EE^ E F < F E ? FF^ " +"G H < G H ? GG^ G H < H G ? HH^ " +"CC EE < CC EE ? CC^ CC EE < EE CC ? E^ " +"DD FF < DD FF ? D^ DD FF < FF DD ? F^ " +"BB E < BB E ? B^ BB E < E BB ? EE^ " +"D GG < D GG ? DD^ D GG < GG D ? G^ " +"B C < B C ? BB^ B C < C B ? CC^ " +"DD EE < DD EE ? D^ DD EE < EE DD ? E^ " +"F G < F G ? FF^ F G < G F ? GG^ " There's no way to reuse the comparison output of R@ or your other optimization suggestions.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
8th July 2021, 20:38 | #92 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
Quote:
Code:
A C < R@ A C ? AA^ R C A ? CC^ Code:
A C < dup A C ? AA^ C A ? CC^ Code:
A C min AA^ A C max CC^ Code:
A C dup1 dup1 min AA^ max CC^ |
|
11th July 2021, 00:17 | #93 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Yes, I don't remember how I tested but it wasn't working at that point. Another option would be to pop out the comparison "A C < R^" but in any case I benchmarked it and barely improved the performance so I went with your min max suggestion. I use dup occasionally but never used dupn, it's not explained in the docs, my guess is it duplicates the n previous element in the stack but this is a guess. Not sure why but it improves performance by 5% so very nice.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
11th July 2021, 13:47 | #94 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
dup or dup0 copies the top item, dup1 copies the second (zero-indexed) item. It saves Expr from loading the variable from memory again - the value is already in a register because it's on the stack, so it just copies it to another register. "dup0 dup2" would be equally valid in place of "dup1 dup1" because it doesn't matter which order you copy A and C in; I just thought "dup1 dup1" looked nicer, and could be a tiny bit faster (edit: actually it's surprising a lot quicker).
By using swap (which is a free operation) and carefully tracking what's on the stack, you can eliminate the use of variables entirely and get another 4% speedup* (this assumes you're using pinterf's latest test which allows newlines within Expr): Code:
Expr(" x[-1,1] x[1,1] dup1 dup1 min swap2 max x[0,1] x[-1,0] dup1 dup1 min swap2 max x[1,0] x[0,-1] dup1 dup1 min swap2 max x[-1,-1] x[1,-1] dup1 dup1 min swap2 max swap7 swap1 swap3 dup1 dup1 min swap2 max swap5 swap1 swap3 dup1 dup1 min swap2 max swap6 swap1 swap2 dup1 dup1 min swap2 max swap4 swap1 swap7 dup1 dup1 min swap2 max swap3 swap1 swap2 dup1 dup1 min swap2 max swap7 swap1 swap2 dup1 dup1 min swap2 max swap5 swap1 swap6 dup1 dup1 min swap2 max swap4 swap1 swap3 dup1 dup1 min swap2 max swap6 swap1 swap3 dup1 dup1 min swap2 max swap5 swap1 swap4 dup1 dup1 min swap2 max swap7 swap1 swap5 dup1 dup1 min swap2 max swap5 swap1 swap3 dup1 dup1 min swap2 max swap3 swap1 swap4 dup1 dup1 min swap2 max swap4 swap1 swap5 dup1 dup1 min swap2 max swap7 swap1 swap3 dup1 dup1 min swap2 max swap7 Z^ Z^ Z^ Z^ Z^ swap1 Z^ x swap2 clip ") No doubt this will give some people conniptions but there's nothing I can do about that. A further optimisation would be to delete some of the calculations that don't end up getting used at all, depending on the particular algorithm you're implementing at the time (edit: I orginally wrote 7% speedup above because that was the result of deleting one of the superfluous - for this algorithm - calculations). Last edited by wonkey_monkey; 11th July 2021 at 15:07. |
11th July 2021, 15:30 | #97 | Link | |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Quote:
About your last suggestion, I'm already doing that, removing the last unneeded operations (didn't find much of a benefit though), or for example remove the final division in variances since it doesn't change the comparison output. I just updated ExTools with new modes. Fixed bokeh which now is a real ring kernel, I tried to create a new mode to sample a bokeh image values, but this would require absolute coordinates, I tried with resizing to kernel size and then stacking (StackVert/Hor limit seems to be 506) but wasn't what I was expecting. Will think about it in the future. Added removegrain 17 and 18 to ex_median(), weighted median and weighted percentile, median 5x5, and kuwahara mode. I'm also trying to implement Retinex and a corner detection algo.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
|
11th July 2021, 15:45 | #98 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,529
|
Quote:
Last edited by wonkey_monkey; 11th July 2021 at 15:58. |
|
11th July 2021, 16:12 | #99 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Yes, I eliminated those 2 days ago. I might be able to remove more but I have been more involved in adding new modes and bugfixing. Next versions will be mainly optimizations I guess.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
Tags |
avisynth, dogway, filters, hbd, packs |
Thread Tools | Search this Thread |
Display Modes | |
|
|