Commit 5b9b4543 authored by dscho's avatar dscho

ZYWRLE brown paper bag fix

While adjusting the coding style, three stupid mistakes happened.  The
quality is _not_ just 1, 2, 3, but really 1, 3, 2.  And the macros
ZYWRLE_PACK_COEFF() and ZYWRLE_UNPACK_COEFF() expand to more than one
statement, which means that we need curly brackets around them when they
are in an if clause.
Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent ecc9d49f
...@@ -116,9 +116,9 @@ rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h) ...@@ -116,9 +116,9 @@ rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h)
if (cl->tightQualityLevel < 0) { if (cl->tightQualityLevel < 0) {
zywrle_level = 1; zywrle_level = 1;
} else if (cl->tightQualityLevel < 3) { } else if (cl->tightQualityLevel < 3) {
zywrle_level = 2;
} else if (cl->tightQualityLevel < 6) {
zywrle_level = 3; zywrle_level = 3;
} else if (cl->tightQualityLevel < 6) {
zywrle_level = 2;
} else { } else {
zywrle_level = 1; zywrle_level = 1;
} }
......
...@@ -766,8 +766,9 @@ PIXEL_T* ZYWRLE_ANALYZE (PIXEL_T* dst, PIXEL_T* src, int w, int h, int scanline, ...@@ -766,8 +766,9 @@ PIXEL_T* ZYWRLE_ANALYZE (PIXEL_T* dst, PIXEL_T* src, int w, int h, int scanline,
ZYWRLE_PACK_COEFF(pBuf, dst, 3, w, h, l); ZYWRLE_PACK_COEFF(pBuf, dst, 3, w, h, l);
ZYWRLE_PACK_COEFF(pBuf, dst, 2, w, h, l); ZYWRLE_PACK_COEFF(pBuf, dst, 2, w, h, l);
ZYWRLE_PACK_COEFF(pBuf, dst, 1, w, h, l); ZYWRLE_PACK_COEFF(pBuf, dst, 1, w, h, l);
if (l == level-1) if (l == level-1) {
ZYWRLE_PACK_COEFF(pBuf, dst, 0, w, h, l); ZYWRLE_PACK_COEFF(pBuf, dst, 0, w, h, l);
}
} }
ZYWRLE_SAVE_UNALIGN(dst,*dst=*(PIXEL_T*)pTop;) ZYWRLE_SAVE_UNALIGN(dst,*dst=*(PIXEL_T*)pTop;)
return dst; return dst;
...@@ -797,8 +798,9 @@ PIXEL_T* ZYWRLE_SYNTHESIZE(PIXEL_T* dst, PIXEL_T* src, int w, int h, int scanlin ...@@ -797,8 +798,9 @@ PIXEL_T* ZYWRLE_SYNTHESIZE(PIXEL_T* dst, PIXEL_T* src, int w, int h, int scanlin
ZYWRLE_UNPACK_COEFF(pBuf, src, 3, w, h, l); ZYWRLE_UNPACK_COEFF(pBuf, src, 3, w, h, l);
ZYWRLE_UNPACK_COEFF(pBuf, src, 2, w, h, l); ZYWRLE_UNPACK_COEFF(pBuf, src, 2, w, h, l);
ZYWRLE_UNPACK_COEFF(pBuf, src, 1, w, h, l); ZYWRLE_UNPACK_COEFF(pBuf, src, 1, w, h, l);
if (l == level-1) if (l == level-1) {
ZYWRLE_UNPACK_COEFF(pBuf, src, 0, w, h, l); ZYWRLE_UNPACK_COEFF(pBuf, src, 0, w, h, l);
}
} }
ZYWRLE_SAVE_UNALIGN(src,*(PIXEL_T*)pTop=*src;) ZYWRLE_SAVE_UNALIGN(src,*(PIXEL_T*)pTop=*src;)
InvWavelet(pBuf, w, h, level); InvWavelet(pBuf, w, h, level);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment