Merge pull request #2 from ptitSeb/master

Fixed a portable C dithering option, fixing the red artifacts on shadows for some configurations
This commit is contained in:
ptitSeb 2017-07-24 13:25:30 +02:00 committed by GitHub
commit 18a59c0bba

View File

@ -882,7 +882,7 @@ nextRowO:
#else #else
union uConv union uConv
{ {
ULONG val; __int64 val;
DWORD dwords[2]; DWORD dwords[2];
UWORD words[4]; UWORD words[4];
WORD iwords[4]; WORD iwords[4];
@ -891,7 +891,8 @@ nextRowO:
for (int i=0; i<pixHeight; i++) { for (int i=0; i<pixHeight; i++) {
int idx = i&3; int idx = i&3;
uConv dith; uConv dith;
dith.val = pulDitherTable[idx]; dith.dwords[0] = pulDitherTable[idx];
dith.dwords[1] = pulDitherTable[idx+1];
for (int j=0; j<4; j++) { dith.words[j] >>= mmShifter; } for (int j=0; j<4; j++) { dith.words[j] >>= mmShifter; }
dith.val &= mmMask; dith.val &= mmMask;
uConv* src = (uConv*)(pulSrc+i*pixWidth); uConv* src = (uConv*)(pulSrc+i*pixWidth);