diff options
author | James Almer <jamrial@gmail.com> | 2017-02-06 19:57:53 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-02-19 12:27:12 -0300 |
commit | b921b3b42b61a3dff19157bf3eec1f6f38a2cae7 (patch) | |
tree | 28baf3bf4a67837b01478b9e26ae2e0756e31939 /libavcodec/huffyuvencdsp.c | |
parent | 21d25da18025856bb30d80173174bb4218a91f82 (diff) | |
download | ffmpeg-b921b3b42b61a3dff19157bf3eec1f6f38a2cae7.tar.gz |
avcodec/huffyuvencdsp: use an actual unsigned long constant
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/huffyuvencdsp.c')
-rw-r--r-- | libavcodec/huffyuvencdsp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/huffyuvencdsp.c b/libavcodec/huffyuvencdsp.c index 7edcce872b..427d118be4 100644 --- a/libavcodec/huffyuvencdsp.c +++ b/libavcodec/huffyuvencdsp.c @@ -21,6 +21,9 @@ #include "huffyuvencdsp.h" #include "mathops.h" +// 0x00010001 or 0x0001000100010001 or whatever, depending on the cpu's native arithmetic size +#define pw_1 (ULONG_MAX / UINT16_MAX) + static void diff_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w){ long i; #if !HAVE_FAST_UNALIGNED @@ -34,8 +37,8 @@ static void diff_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *sr }else #endif { - 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*)(src1+i); |