mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-27 15:52:28 +00:00
Initial import
This commit is contained in:
commit
c91b3c5006
14915 changed files with 590219 additions and 0 deletions
28
dsp/core/c1331s.h
Normal file
28
dsp/core/c1331s.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef COSMOPOLITAN_DSP_CORE_C1331S_H_
|
||||
#define COSMOPOLITAN_DSP_CORE_C1331S_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Byte sized kernel for resampling difference samples in half.
|
||||
*
|
||||
* @define (1*(a-128)+3*(a-128)+3*(a-128)+1*(a-128))/(1+3+3+1)+128
|
||||
* @see C1331(), Y420CbCr2RgbScale()
|
||||
*/
|
||||
forceinline pureconst artificial signed char C1331S(signed char al,
|
||||
signed char bl,
|
||||
signed char cl,
|
||||
signed char dl) {
|
||||
short ax, bx;
|
||||
bx = bl;
|
||||
bx += cl;
|
||||
bx *= 3;
|
||||
ax = al;
|
||||
ax += dl;
|
||||
ax += bx;
|
||||
ax += 4;
|
||||
ax >>= 3;
|
||||
return ax;
|
||||
}
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_DSP_CORE_C1331S_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue