# HG changeset patch # User lorenm # Date 1203699206 0 # Node ID 922774d1fb9c4014119243b4c7e6cd69f5bc3668 # Parent 8b570faa9a8d5b98b6d4239a8ba2795c6e03f33d cleaner way of writing packed-byte constants. suggested by Uoti Urpala diff -r 8b570faa9a8d -r 922774d1fb9c dsputil.c --- a/dsputil.c Thu Feb 21 07:55:42 2008 +0000 +++ b/dsputil.c Fri Feb 22 16:53:26 2008 +0000 @@ -50,8 +50,9 @@ uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, }; uint32_t ff_squareTbl[512] = {0, }; -static const unsigned long pb_7f = 0x7f7f7f7f7f7f7f7fUL; -static const unsigned long pb_80 = 0x8080808080808080UL; +// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size +#define pb_7f (~0UL/255 * 0x7f) +#define pb_80 (~0UL/255 * 0x80) const uint8_t ff_zigzag_direct[64] = { 0, 1, 8, 16, 9, 2, 3, 10,