#include <stdint.h>
#include <sys/types.h>
Go to the source code of this file.
Typedefs | |
typedef uint32_t | AVCRC |
Enumerations | |
enum | AVCRCId { AV_CRC_8_ATM, AV_CRC_16_ANSI, AV_CRC_16_CCITT, AV_CRC_32_IEEE, AV_CRC_32_IEEE_LE, AV_CRC_MAX } |
Functions | |
int | av_crc_init (AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size) |
Inits a crc table. | |
const AVCRC * | av_crc_get_table (AVCRCId crc_id) |
Get an initialized standard CRC table. | |
uint32_t | av_crc (const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) |
Calculate the CRC of a block. |
enum AVCRCId |
Calculate the CRC of a block.
crc | CRC of previous blocks if any or initial value for CRC. |
Definition at line 112 of file crc.c.
Referenced by ac3_decode_frame(), decode_frame(), ff_crc04C11DB7_update(), mlp_checksum16(), mpegts_write_section(), output_frame_end(), output_frame_footer(), output_frame_header(), and write_section_data().
Get an initialized standard CRC table.
crc_id | ID of a standard CRC |
Definition at line 92 of file crc.c.
Referenced by ac3_decode_frame(), decode_frame(), ff_crc04C11DB7_update(), mpegts_write_section(), output_frame_end(), output_frame_footer(), output_frame_header(), and write_section_data().
int av_crc_init | ( | AVCRC * | ctx, | |
int | le, | |||
int | bits, | |||
uint32_t | poly, | |||
int | ctx_size | |||
) |
Inits a crc table.
ctx | must be an array of sizeof(AVCRC)*257 or sizeof(AVCRC)*1024 | |
cts_size | size of ctx in bytes | |
le | if 1, lowest bit represents coefficient for highest exponent of corresponding polynomial (both for poly and actual CRC). If 0, you must swap the crc parameter and the result of av_crc if you need the standard representation (can be simplified in most cases to e.g. bswap16): bswap_32(crc << (32-bits)) | |
bits | number of bits for the CRC | |
poly | generator polynomial without the x**bits coefficient, in the representation as specified by le |
Definition at line 56 of file crc.c.
Referenced by av_crc_get_table(), and mlp_checksum16().