19 #ifndef AVUTIL_AARCH64_CRC_H
20 #define AVUTIL_AARCH64_CRC_H
36 uint32_t ff_crc32_aarch64(
const AVCRC *
ctx, uint32_t crc,
const uint8_t *
buffer,
41 #if HAVE_PMULL && HAVE_EOR3
45 uint32_t ff_crc_neon_pmull(
const AVCRC *
ctx, uint32_t crc,
const uint8_t *
buffer,
47 uint32_t ff_crc_le_neon_pmull(
const AVCRC *
ctx, uint32_t crc,
const uint8_t *
buffer,
60 0xbc000000, 0x0, 0x32000000, 0x0,
61 0x94000000, 0x0, 0xc4000000, 0x0,
62 0x62000000, 0x0, 0x79000000, 0x0,
63 0x07156a16, 0x1, 0x07000000, 0x1,
67 0xf3000000, 0x0, 0xb5000000, 0x0,
68 0x0d000000, 0x0, 0xfc000000, 0x0,
69 0x6a000000, 0x0, 0x65000000, 0x0,
70 0x1c4b8192, 0x1, 0x1d000000, 0x1,
74 0x807d0000, 0x0, 0xf9e30000, 0x0,
75 0xff830000, 0x0, 0xf9130000, 0x0,
76 0x807b0000, 0x0, 0x86630000, 0x0,
77 0xfffbffe7, 0x1, 0x80050000, 0x1,
81 0x59b00000, 0x0, 0x60190000, 0x0,
82 0x45630000, 0x0, 0xd5f60000, 0x0,
83 0xaa510000, 0x0, 0xeb230000, 0x0,
84 0x11303471, 0x1, 0x10210000, 0x1,
88 0x467d2400, 0x0, 0x1f428700, 0x0,
89 0x64e4d700, 0x0, 0x2c8c9d00, 0x0,
90 0xd9fe8c00, 0x0, 0xfd7e0c00, 0x0,
91 0xf845fe24, 0x1, 0x864cfb00, 0x1,
95 0xe6228b11, 0x0, 0x8833794c, 0x0,
96 0xe8a45605, 0x0, 0xc5b9cd4c, 0x0,
97 0x490d678d, 0x0, 0xf200aa66, 0x0,
98 0x04d101df, 0x1, 0x04c11db7, 0x1,
102 0x54442bd4, 0x1, 0xc6e41596, 0x1,
103 0x751997d0, 0x1, 0xccaa009e, 0x0,
104 0xccaa009e, 0x0, 0x63cd6124, 0x1,
105 0xf7011640, 0x1, 0xdb710641, 0x1,
109 0x1b0c2, 0x0, 0x0000bffa, 0x0,
110 0x1d0c2, 0x0, 0x00018cc2, 0x0,
111 0x00018cc2, 0x0, 0x1bc02, 0x0,
112 0xcfffbffe, 0x1, 0x14003, 0x0,
117 static inline void crc_init_aarch64(
AVCRC *
ctx,
int le,
int bits, uint32_t poly,
int ctx_size)
125 poly_ = ((uint64_t)poly) << (32 -
bits);
128 uint8_t *
dst = (uint8_t*)(
ctx + 1);
133 uint64_t
tmp =
xnmodp(128 - 32, poly_, 32, &div, le);
156 #if HAVE_PMULL && HAVE_EOR3
160 crc_init_aarch64(
ctx, le,
bits, poly, ctx_size);
168 const uint8_t *
buffer,
size_t length)
171 #if HAVE_PMULL && HAVE_EOR3
172 case PMULL_BE:
return ff_crc_neon_pmull(
ctx, crc,
buffer, length);
173 case PMULL_LE:
return ff_crc_le_neon_pmull(
ctx, crc,
buffer, length);
178 default:
av_unreachable(
"AARCH64 has PMULL_LE, PMULL_BE and AV_CRC_32_IEEE_LE arch-specific CRC code");
186 #if HAVE_PMULL && HAVE_EOR3
188 return crc_table_pmull[crc_id];
192 static const AVCRC crc32_ieee_le_ctx[] = {
200 return crc32_ieee_le_ctx;