mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 20:17:49 +00:00
IMAGE: Inline two simple indeo functions
This commit is contained in:
parent
7fc69ebdea
commit
4ec3c2875b
@ -132,19 +132,5 @@ uint16 invertBits(uint16 val, int nbits) {
|
||||
return res;
|
||||
}
|
||||
|
||||
uint8 avClipUint8(int a) {
|
||||
if (a & (~0xFF))
|
||||
return (-a) >> 31;
|
||||
else
|
||||
return a;
|
||||
}
|
||||
|
||||
unsigned avClipUintp2(int a, int p) {
|
||||
if (a & ~((1 << p) - 1))
|
||||
return -a >> 31 & ((1 << p) - 1);
|
||||
else
|
||||
return a;
|
||||
}
|
||||
|
||||
} // End of namespace Indeo
|
||||
} // End of namespace Image
|
||||
|
@ -82,7 +82,12 @@ extern uint32 bitswap32(uint32 x);
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
extern uint8 avClipUint8(int a);
|
||||
inline uint8 avClipUint8(int a) {
|
||||
if (a & (~0xFF))
|
||||
return (-a) >> 31;
|
||||
else
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer to an unsigned power of two range.
|
||||
@ -90,7 +95,12 @@ extern uint8 avClipUint8(int a);
|
||||
* @param p bit position to clip at
|
||||
* @return clipped value
|
||||
*/
|
||||
extern unsigned avClipUintp2(int a, int p);
|
||||
inline unsigned avClipUintp2(int a, int p) {
|
||||
if (a & ~((1 << p) - 1))
|
||||
return -a >> 31 & ((1 << p) - 1);
|
||||
else
|
||||
return a;
|
||||
}
|
||||
|
||||
extern const uint8 ffZigZagDirect[64];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user