Closed Shiandow closed 7 years ago
I'll give this a final check some time tomorrow.
Whoa! Massive improvements!
I'll give it a quick test tonight!
On 29 Aug. 2017 8:33 am, "Shiandow" notifications@github.com wrote:
Framework Changes
New method for chroma scaling (doesn't require too many changes to existing chroma scalers). Allows filters to treat Luma and Chroma channels separately if so desired (see DebandExperimental).
Tag system: changed, again. This time to a more foolproof system.
Filter: Disposing accidentally took exponential time, fixed to linear time.
TextureSize: Add comparison methods, remove IsUpscalingFrom, IsDownscalignFrom in favour of more explicit inequality operators. Operators return true when inequality is true for all dimensions. Audio/Video Scripts
DebandExperimental: tweaks, allow debanding to be done before chroma scaling, improving quality.
SSIMdownscaling: minor tweak
Crossfeed: new audio crossfeed. More of an experiment, and to demonstrate the relative ease with which you can process audio (although actually producing good sounding audio is obviously still black magic).
You can view, comment on, or merge this pull request online at:
https://github.com/zachsaw/MPDN_Extensions/pull/238 Commit Summary
- [Framework] Split AudioFilter into separate classes
- [Framework] Add Size and Format helper functions
- [Refactoring] Cleanup
- Ignore VS 2017 temp files
- [Framework] Complete rewrite of Tag system
- [Framework] SetSize: check if resize is necessary
- [Framework] ExtensionUI: add SettingsChanged event
- [Framework] Filter: Speed up Disposing
- [Framework] Add comparison methods for sizes
- [Framework] Chroma Scaling: Rework chroma filter, allow acces to YUV and Luma planes.
- DebandExperimental: Handle Luma and Chroma separately.
- SSIMDownscaler: Small tweak, update scalers
- Crossfeed: Work in Progress
File Changes
- M .gitignore https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-0 (3)
- M Examples/AudioScripts/Example.Gargle.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-1 (7)
- M Examples/AudioScripts/Example.Silencer.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-2 (7)
- M Examples/RenderScripts/Example.DirectCompute.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-3 (4)
- M Examples/RenderScripts/Example.OpenCl.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-4 (2)
- M Extensions/AudioScripts/Mpdn.Reclock.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-5 (9)
- A Extensions/AudioScripts/Shiandow.Crossfeed.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-6 (191)
- M Extensions/Framework/AudioChain/AudioFilter.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-7 (248)
- M Extensions/Framework/Chain/ChainUi.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-8 (6)
- M Extensions/Framework/Chain/Dialogs/ScriptChain.ConfigDialog.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-9 (4)
- M Extensions/Framework/Chain/Dialogs/ScriptGroup.ConfigDialog.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-10 (4)
- M Extensions/Framework/Chain/FilterChain.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-11 (2)
- M Extensions/Framework/Chain/FilterChainScript.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-12 (49)
- M Extensions/Framework/Chain/Preset.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-13 (15)
- M Extensions/Framework/Chain/PresetCollections.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-14 (26)
- M Extensions/Framework/Config/ExtensionsUi.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-15 (17)
- M Extensions/Framework/Filter/Filter.Meta.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-16 (32)
- M Extensions/Framework/Filter/Filter.Sources.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-17 (4)
- M Extensions/Framework/Filter/Filter.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-18 (27)
- M Extensions/Framework/RenderChain/ChromaScalerPreset.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-19 (6)
- M Extensions/Framework/RenderChain/RenderChain.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-20 (37)
- M Extensions/Framework/RenderChain/RenderChainScript.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-21 (4)
- M Extensions/Framework/RenderChain/Shader/ShaderFilter.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-22 (2)
- M Extensions/Framework/RenderChain/TextureFilter/Chroma.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-23 (81)
- M Extensions/Framework/RenderChain/TextureFilter/Interface.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-24 (61)
- M Extensions/Framework/RenderChain/TextureFilter/Shaders.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-25 (4)
- M Extensions/Framework/RenderChain/TextureFilter/Sources.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-26 (18)
- M Extensions/Framework/RenderChain/TextureFilter/Transformation.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-27 (4)
- M Extensions/Framework/RenderChain/Textures.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-28 (56)
- M Extensions/Framework/Tag.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-29 (378)
- M Extensions/PlayerExtensions/DisplayChanger.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-30 (1)
- M Extensions/PlayerExtensions/ScriptChainOsdPainter.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-31 (4)
- M Extensions/RenderScripts/Custom.MyRenderScript.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-32 (4)
- M Extensions/RenderScripts/DebandExperimental/Deband.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-33 (133)
- M Extensions/RenderScripts/DebandExperimental/Downscale.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-34 (25)
- A Extensions/RenderScripts/DebandExperimental/DownscaleLuma.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-35 (30)
- M Extensions/RenderScripts/Hylian.Super-xBR.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-36 (5)
- M Extensions/RenderScripts/Mpdn.DxvaHd.Scaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-37 (4)
- M Extensions/RenderScripts/Mpdn.EwaChromaScaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-38 (25)
- M Extensions/RenderScripts/Mpdn.EwaScaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-39 (4)
- M Extensions/RenderScripts/Mpdn.OclNnedi3.Chroma.Nnedi3Scaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-40 (29)
- M Extensions/RenderScripts/Mpdn.OclNnedi3.Nnedi3Scaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-41 (14)
- M Extensions/RenderScripts/SSimDownscaler/CalcR.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-42 (8)
- M Extensions/RenderScripts/SSimDownscaler/Scalers/Downscaler.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-43 (20)
- M Extensions/RenderScripts/SSimDownscaler/Scalers/Upscaler.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-44 (20)
- M Extensions/RenderScripts/SSimDownscaler/SinglePassConvolver.hlsl https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-45 (4)
- M Extensions/RenderScripts/Shiandow.Bilateral.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-46 (30)
- M Extensions/RenderScripts/Shiandow.Chroma.ChromaScaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-47 (22)
- M Extensions/RenderScripts/Shiandow.Deband.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-48 (2)
- M Extensions/RenderScripts/Shiandow.DebandExperimental.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-49 (51)
- M Extensions/RenderScripts/Shiandow.Nedi.NediScaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-50 (2)
- M Extensions/RenderScripts/Shiandow.Nnedi3.Chroma.Scaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-51 (29)
- M Extensions/RenderScripts/Shiandow.Nnedi3.Scaler.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-52 (8)
- M Extensions/RenderScripts/Shiandow.SSSR.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-53 (4)
- M Extensions/RenderScripts/Shiandow.SSimDownscaling.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-54 (2)
- M Extensions/RenderScripts/Shiandow.SuperChromaRes.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-55 (26)
- M Extensions/RenderScripts/Shiandow.SuperRes.cs https://github.com/zachsaw/MPDN_Extensions/pull/238/files#diff-56 (8)
Patch Links:
- https://github.com/zachsaw/MPDN_Extensions/pull/238.patch
- https://github.com/zachsaw/MPDN_Extensions/pull/238.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zachsaw/MPDN_Extensions/pull/238, or mute the thread https://github.com/notifications/unsubscribe-auth/ACqEcLq-G1KOSrLrry0ZltV_KAsejyH9ks5sc0A_gaJpZM4PFJzI .
By the way, it might not seem like much, but by far the most noticeable feature is the fix that made disposing filters faster. It makes a very noticeable difference when you toggle renderscripts on/off using hotkeys.
For whatever reason I'm getting problems when I try to let MPDN compile the extensions (using "Validate Release.bat"), but manual compilation seems to work fine (even when targetting C# 5.0), weird.
I actually wondered about that. What class would be need to prevent C# from actually storing anything? If you return an enumerator it just generates the results on the fly, but I couldn't figure out what class to extend to make that happen.
IEnumerable would be the bare minimum. GetEnumerator would simply just yield return each comparison result.
In fact if you implement it as a simple IEnumerable
IEnumerable
Buggery GitHub doesn't like IEnumerable < bool > without the spaces!
Not sure if I like "All(true)". Or rather I don't like "All(false)", and if we don't allow that then the "true" is redundant.
There's also the fact that All(x=>x) is the same length...
And yeah you need to write IEnumerable\\<bool\> for some reason.
Let me quickly do it and push the changes
I think the following syntax is pretty easy to understand,
if ((a<b).All(false)) ...
Any particular reason why you don't like it?
I don't mind lengthy code, as long as the intent is clear.
At this point I'm starting to doubt if the extra code is actually clarifying anything.
I mean yes it is explicit, but if you add too many ways of saying the same thing you could end up with code like "!(a < b).Any(false) == true". Now obviously this could be simplified, but I'm just using it to demonstrate that being explicit and being easy to read aren't the same thing. Unless you can claim you immediately saw that that code was equivalent to "a < b" in the old syntax.
Just to be clear, I'm not in favour of being explicit - I only want the code to express intent clearly.
My only problem with (a<b).Any() is that it hides the .Net implementation of IEnumerable
Hmm I can see why you implemented Any and All as properties - that would actually be quite enough to differentiate between the extension method and one that is for ListOfBools.
It is a bit of a compromise, but it's the best I could come up with.
There's also no risk of accidentally calling the wrong Any() on an IEnumerable\<bool>.
I even added summaries, just in case someone wonders what the difference between Any and Any() is ;-).
There's some syntax that is newer than C# 5 that the pre-Roslyn compiler doesn't like. I can't seem to be able to find a convenient way of making the IDE tell us which is the offending syntax though...
EDIT: This is not true. I forced the IDE to allow C#5 syntax only and the validation still fails...
For whatever reason I don't get any errors if I manually tell VS it is C# 5.0.
I suppose adding / removing parts of the code should at least allow us to figure out where the problem is, I'll give that a try.
Well, it's somewhere in the framework apparently.
Ah, there are problems in Tag.cs.
And I just found out we had a debug dialog, that actually said what the error was. Probably not a good sign if we both forgot. Maybe we should just always enable it, no point in hiding errors.
Yikes! We have a debug dialog? Lol. Right. Absolutely no recollection of it.
Yeah...
I actually had to load the code of MPDN itself into the debugger before I discovered that bit of useful information.
Now, maybe we should just polish the dialog it a bit and make it the default? I don't see the point of ever throwing away the exception message. Even if people don't understand a word of it, it at least we won't have to bother explaining how to get useful error messages.
Yeah absolutely. Never hide exceptions.
I think enabling that debug dialog causes all exceptions to be shown in a non user friendly way though.
Yeah I think the user friendliness could take some work, but keep in mind that we're likely to get screenshots of whatever we end up choosing, so we should make sure it contains at least some useful information.
Perhaps it would be a good idea to show the debug dialog only when scripts fail to load?
Well, I don't mind if some types of exceptions are caught elsewhere and use their own, more user friendly, dialog. But anything that slips through should be displayed fully.
The uninformative error message the debug dialog adds could probably be removed though.
What we could do is keep the debug setting (but rename it), and use it to decide whether to wrap the exception in a more user friendly one, or keep it as is. And maybe limit the number of levels of additional information the exception dialog displays when "debug information" is turned off.
Yeah I agree with showing debug info when it's an unhandled exception while showing user friendly ones where it's caught.
From memory I think that's what I've done. That's always been my way of exception handling. It's just in this case I opted to catch the exception and show a user friendly dialog. But that's just from my very vague memory.
The main problem was that it was shown in a regular MessageBox, as opposed to an ExceptionMessageBox. So there's no way to access the inner exceptions.
I think displaying them like this is probably not a bad choice. The dialog should only ever be used when MPDN itself causes an exception, or the extensions throw an unhandled exception at MPDN. Both aren't really supposed to happen.
Framework Changes
New method for chroma scaling (doesn't require too many changes to existing chroma scalers). Allows filters to treat Luma and Chroma channels separately if so desired (see DebandExperimental).
Tag system: changed, again. This time to a more foolproof system.
Filter: Disposing accidentally took exponential time, fixed to linear time.
TextureSize: Add comparison methods, remove IsUpscalingFrom, IsDownscalignFrom in favour of more explicit inequality operators. Operators return true when inequality is true for all dimensions.
Audio/Video Scripts
DebandExperimental: tweaks, allow debanding to be done before chroma scaling, improving quality.
SSIMdownscaling: minor tweak
Crossfeed: new audio crossfeed. More of an experiment, and to demonstrate the relative ease with which you can process audio (although actually producing good sounding audio is obviously still black magic).