MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__paeth

Function stbi__paeth

lite/example/cpp_example/mge/cv/stb_image.h:5007–5017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5005 STBI__F_paeth_first};
5006
5007static int stbi__paeth(int a, int b, int c) {
5008 int p = a + b - c;
5009 int pa = abs(p - a);
5010 int pb = abs(p - b);
5011 int pc = abs(p - c);
5012 if (pa <= pb && pa <= pc)
5013 return a;
5014 if (pb <= pc)
5015 return b;
5016 return c;
5017}
5018
5019static const stbi_uc stbi__depth_scale_table[9] = {0, 0xff, 0x55, 0, 0x11,
5020 0, 0, 0, 0x01};

Callers 2

STBI__CASEFunction · 0.85

Calls 1

absFunction · 0.50

Tested by

no test coverage detected