MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__paeth

Function stbi__paeth

include/stb/stb_image.h:4657–4668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4655};
4656
4657static int stbi__paeth(int a, int b, int c)
4658{
4659 // This formulation looks very different from the reference in the PNG spec, but is
4660 // actually equivalent and has favorable data dependencies and admits straightforward
4661 // generation of branch-free code, which helps performance significantly.
4662 int thresh = c*3 - (a + b);
4663 int lo = a < b ? a : b;
4664 int hi = a < b ? b : a;
4665 int t0 = (hi <= thresh) ? lo : c;
4666 int t1 = (thresh <= lo) ? hi : t0;
4667 return t1;
4668}
4669
4670static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };
4671

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected