Optimisation for integral factors: favour shrink over affine

This commit is contained in:
Lovell Fuller 2016-01-26 18:25:23 +00:00
parent 5c9c17f1f6
commit b3d6e94984
2 changed files with 1 additions and 1 deletions

View File

@ -925,7 +925,7 @@ class PipelineWorker : public AsyncWorker {
*/ */
int CalculateShrink(double factor, int interpolatorWindowSize) { int CalculateShrink(double factor, int interpolatorWindowSize) {
int shrink = 1; int shrink = 1;
if (factor >= 2 && interpolatorWindowSize > 3) { if (factor >= 2.0 && trunc(factor) != factor && interpolatorWindowSize > 3) {
// Shrink less, affine more with interpolators that use at least 4x4 pixel window, e.g. bicubic // Shrink less, affine more with interpolators that use at least 4x4 pixel window, e.g. bicubic
shrink = static_cast<int>(floor(factor * 3.0 / interpolatorWindowSize)); shrink = static_cast<int>(floor(factor * 3.0 / interpolatorWindowSize));
} else { } else {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 359 B