mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2025-12-26 14:18:36 +00:00
lz: Inline GET_{r,g,b} macros
With last changes are just used once and are straight forward. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
70aa6d39b6
commit
5312ea3f35
@ -134,9 +134,7 @@
|
||||
|
||||
#if defined(LZ_RGB24) || defined(LZ_RGB32)
|
||||
#define ENCODE_PIXEL(e, pix) {encode(e, (pix).b); encode(e, (pix).g); encode(e, (pix).r);}
|
||||
#define GET_r(pix) ((pix).r)
|
||||
#define GET_g(pix) ((pix).g)
|
||||
#define GET_b(pix) ((pix).b)
|
||||
#define SAME_PIXEL(p1, p2) ((p1).r == (p2).r && (p1).g == (p2).g && (p1).b == (p2).b)
|
||||
#define HASH_FUNC(v, p) { \
|
||||
v = DJB2_START; \
|
||||
DJB2_HASH(v, p[0].r); \
|
||||
@ -152,12 +150,6 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LZ_RGB24) || defined(LZ_RGB32)
|
||||
#define SAME_PIXEL(p1, p2) (GET_r(p1) == GET_r(p2) && GET_g(p1) == GET_g(p2) && \
|
||||
GET_b(p1) == GET_b(p2))
|
||||
|
||||
#endif
|
||||
|
||||
#define PIXEL_ID(pix_ptr, seg_ptr) (pix_ptr - ((PIXEL *)seg_ptr->lines) + seg_ptr->size_delta)
|
||||
|
||||
// when encoding, the ref can be in previous segment, and we should check that it doesn't
|
||||
@ -521,9 +513,6 @@ static void FNAME(compress)(Encoder *encoder)
|
||||
#undef HASH_FUNC
|
||||
#undef BYTES_TO_16
|
||||
#undef HASH_FUNC_16
|
||||
#undef GET_r
|
||||
#undef GET_g
|
||||
#undef GET_b
|
||||
#undef GET_rgb
|
||||
#undef GET_CODE
|
||||
#undef LZ_PLT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user