Initial import

This commit is contained in:
Justine Tunney 2020-06-15 07:18:57 -07:00
commit c91b3c5006
14915 changed files with 590219 additions and 0 deletions

30
dsp/core/c331.h Normal file
View file

@ -0,0 +1,30 @@
#ifndef COSMOPOLITAN_DSP_CORE_C331_H_
#define COSMOPOLITAN_DSP_CORE_C331_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/**
* Fixed-point 8-bit magic edge resampling kernel.
*
* @define (3*a + 3*b + 1*c) / 7
* @see C1331()
*/
static inline pureconst artificial unsigned char C331(unsigned char al,
unsigned char bl,
unsigned char cl) {
unsigned eax, ebx, ecx;
eax = al;
ebx = bl;
ecx = cl;
eax += ebx;
eax *= 3 * 2350;
ecx *= 1 * 2350;
eax += ecx;
eax >>= 14;
al = eax;
return al;
}
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_CORE_C331_H_ */