zachsaw / MPDN_Extensions

Media Player .Net (MPDN) Open Source Extensions
Other
58 stars 18 forks source link

Performance regression with Deband and Resizer #152

Closed zachsaw closed 9 years ago

zachsaw commented 9 years ago

There's a performance regression if Deband is used as a standalone script due to the changes in the framework to accommodate chroma scaling.

Optimization opportunities: Optimize out ChromaSourceFilter creation in ChromaFilter if ChromaScaler is null. There should be no need for the DefaultChromaScaler class.

Shiandow commented 9 years ago

You're still going to need the DefaultChromaScaler class when chroma-scaling anything other than the initial input.

In fact I was planning to let Deband modify the original Luma and Chroma filters; doing so might improve image quality slightly. It also avoids some problems with the chroma limiter.

Is there any way we could make the "DefaultChromaScaler" as fast as MPDN's internal chroma scaler?

Shiandow commented 9 years ago

Oh, by the way, I think I'd forgotten to fix a bug that made "DefaultChromaScaler" use the luma scalers. Fixing that might help a bit with performance.

Shiandow commented 9 years ago

Ah, it was a different bug I'd forgotten to fix apparently. Should be fixed now though.

zachsaw commented 9 years ago

I'm not convinced "DefaultChromaScaler" is slow. The performance regression was due to the split and merge that is should've been a no-op. If we only make sure we split and merge when necessary, it would seem what DefaultChromaScaler is doing cannot be avoided. We could combine chroma scale with merge but I doubt that would give us much performance benefits.

Shiandow commented 9 years ago

Well at any rate it's now not doing any splits or merges if it can avoid them.

It might be worth a try to see if some merges could be avoided, but performance wise it doesn't seem to make too much of a difference.