diff options
author | James Almer <jamrial@gmail.com> | 2017-02-06 19:57:30 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-02-19 12:27:06 -0300 |
commit | 21d25da18025856bb30d80173174bb4218a91f82 (patch) | |
tree | e6c6766e1e4b1fcfbd41f7391852873e2be78ed2 | |
parent | 12eebb845a7fe1ced91606547352cbdd93a2726d (diff) | |
download | ffmpeg-21d25da18025856bb30d80173174bb4218a91f82.tar.gz |
avcodec/huffyuvdsp: use an actual unsigned long constant
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/huffyuvdsp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/huffyuvdsp.c b/libavcodec/huffyuvdsp.c index 759ffda0b8..e770923bb2 100644 --- a/libavcodec/huffyuvdsp.c +++ b/libavcodec/huffyuvdsp.c @@ -23,10 +23,13 @@ #include "mathops.h" #include "huffyuvdsp.h" +// 0x00010001 or 0x0001000100010001 or whatever, depending on the cpu's native arithmetic size +#define pw_1 (ULONG_MAX / UINT16_MAX) + static void add_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, int w){ long i; - unsigned long pw_lsb = (mask >> 1) * 0x0001000100010001ULL; - unsigned long pw_msb = pw_lsb + 0x0001000100010001ULL; + unsigned long pw_lsb = (mask >> 1) * pw_1; + unsigned long pw_msb = pw_lsb + pw_1; for (i = 0; i <= w - (int)sizeof(long)/2; i += sizeof(long)/2) { long a = *(long*)(src+i); long b = *(long*)(dst+i); |