|
|
|
@@ -412,12 +412,14 @@ static inline unsigned pixel_color15(const uint8_t * src) |
|
|
|
|
|
|
|
static inline unsigned int chroma_diff(unsigned int c1, unsigned int c2) |
|
|
|
{ |
|
|
|
#define ABSDIFF(a,b) (abs((int)(a)-(int)(b))) |
|
|
|
|
|
|
|
unsigned int t1 = (c1 & 0x000000ff) + ((c1 & 0x0000ff00) >> 8) + ((c1 & 0x00ff0000) >> 16); |
|
|
|
unsigned int t2 = (c2 & 0x000000ff) + ((c2 & 0x0000ff00) >> 8) + ((c2 & 0x00ff0000) >> 16); |
|
|
|
|
|
|
|
return abs(t1 - t2) + abs((c1 & 0x000000ff) - (c2 & 0x000000ff)) + |
|
|
|
abs(((c1 & 0x0000ff00) >> 8) - ((c2 & 0x0000ff00) >> 8)) + |
|
|
|
abs(((c1 & 0x00ff0000) >> 16) - ((c2 & 0x00ff0000) >> 16)); |
|
|
|
return ABSDIFF(t1, t2) + ABSDIFF(c1 & 0x000000ff, c2 & 0x000000ff) + |
|
|
|
ABSDIFF((c1 & 0x0000ff00) >> 8 , (c2 & 0x0000ff00) >> 8) + |
|
|
|
ABSDIFF((c1 & 0x00ff0000) >> 16, (c2 & 0x00ff0000) >> 16); |
|
|
|
} |
|
|
|
|
|
|
|
static inline int pixel_color7_fast(Palette * palette, unsigned c15) |
|
|
|
|