Lines Matching defs:buf
98 uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
102 crc = av_crc(crc_2D, 0, buf, buf_size - 2);
103 crc ^= AV_RL16(buf + buf_size - 2);
107 uint8_t ff_mlp_checksum8(const uint8_t *buf, unsigned int buf_size)
109 uint8_t checksum = av_crc(crc_63, 0x3c, buf, buf_size - 1); // crc_63[0xa2] == 0x3c
110 checksum ^= buf[buf_size-1];
114 uint8_t ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size)
119 int crc = crc_1D[buf[0] & 0x3f];
120 crc = av_crc(crc_1D, crc, buf + 1, num_bytes - 2);
121 crc ^= buf[num_bytes - 1];
127 crc ^= (buf[num_bytes] >> (7 - i)) & 1;
133 uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size)
136 const uint8_t *buf_end = buf + buf_size;
138 for (; ((intptr_t) buf & 3) && buf < buf_end; buf++)
139 scratch ^= *buf;
140 for (; buf < buf_end - 3; buf += 4)
141 scratch ^= *((const uint32_t*)buf);
145 for (; buf < buf_end; buf++)
146 scratch ^= *buf;