diff options
Diffstat (limited to 'common/scaler.cpp')
-rw-r--r-- | common/scaler.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp index 1252a61866..cea445466e 100644 --- a/common/scaler.cpp +++ b/common/scaler.cpp @@ -666,6 +666,19 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1 } #else // Not fully accurate, but a bit faster + + if (width & 1) { + // For efficency reasons we normally blit two pixels at a time; but if the + // width is odd, we first blit a single pixel. + width--; + if (scale == 1) { + uint32 B = *srcB++; + *dst++ = (uint16)Q_INTERPOLATE(*srcA++, B, B, B); + } else { + *dst++ = (uint16)INTERPOLATE(*srcA++, *srcB++); + } + } + width /= 2; const uint32 *sA = (const uint32 *)srcA; const uint32 *sB = (const uint32 *)srcB; |