cosmopolitan/dsp/core/c11.h
Justine Tunney fa20edc44d
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs
- Rename libc/intrin/bits.h to libc/serialize.h
- Block pthread cancelation in fchmodat() polyfill
- Remove `clang-format off` statements in third_party
2023-11-28 14:39:42 -08:00

19 lines
343 B
C

#ifndef COSMOPOLITAN_DSP_CORE_C11_H_
#define COSMOPOLITAN_DSP_CORE_C11_H_
/**
* Fixed-point 8-bit rounded mean kernel.
*
* @define (a + b) / 2
*/
__funline unsigned char C11(unsigned char al, unsigned char bl) {
short ax;
ax = al;
ax += bl;
ax += 1;
ax /= 2;
al = ax;
return al;
}
#endif /* COSMOPOLITAN_DSP_CORE_C11_H_ */