mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Initial import
This commit is contained in:
commit
c91b3c5006
14915 changed files with 590219 additions and 0 deletions
24
dsp/core/twixt8.h
Normal file
24
dsp/core/twixt8.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef COSMOPOLITAN_DSP_CORE_TWIXT8_H_
|
||||
#define COSMOPOLITAN_DSP_CORE_TWIXT8_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/**
|
||||
* 8-bit linear interpolation kernel.
|
||||
*/
|
||||
static inline pureconst artificial unsigned char twixt8(unsigned char al,
|
||||
unsigned char bl,
|
||||
unsigned char p) {
|
||||
short bx;
|
||||
bx = bl;
|
||||
bx -= al;
|
||||
bx *= p;
|
||||
bx >>= 8;
|
||||
bx += al;
|
||||
al = bx;
|
||||
return al;
|
||||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_DSP_CORE_TWIXT8_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue