#include <stdint.h>
#include <stddef.h>
#include "attributes.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,
AV_CRC_8_ATM,
AV_CRC_16_ANSI,
AV_CRC_16_CCITT,
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE,
AV_CRC_MAX,
AV_CRC_8_ATM,
AV_CRC_16_ANSI,
AV_CRC_16_CCITT,
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE,
AV_CRC_MAX
} |
Typedef Documentation
Definition at line 28 of file crc.h.
Enumeration Type Documentation
- Enumerator:
AV_CRC_8_ATM |
|
AV_CRC_16_ANSI |
|
AV_CRC_16_CCITT |
|
AV_CRC_32_IEEE |
|
AV_CRC_32_IEEE_LE |
|
AV_CRC_MAX |
|
AV_CRC_8_ATM |
|
AV_CRC_16_ANSI |
|
AV_CRC_16_CCITT |
|
AV_CRC_32_IEEE |
|
AV_CRC_32_IEEE_LE |
|
AV_CRC_MAX |
|
AV_CRC_8_ATM |
|
AV_CRC_16_ANSI |
|
AV_CRC_16_CCITT |
|
AV_CRC_32_IEEE |
|
AV_CRC_32_IEEE_LE |
|
AV_CRC_MAX |
|
Definition at line 30 of file crc.h.
Function Documentation
uint32_t av_crc |
( |
const AVCRC * |
ctx, |
|
|
uint32_t |
crc, |
|
|
const uint8_t * |
buffer, |
|
|
size_t |
length |
|
) |
| |
Calculate the CRC of a block.
- Parameters
-
crc | CRC of previous blocks if any or initial value for CRC |
- Returns
- CRC updated with the data from the given block
- See Also
- av_crc_init() "le" parameter
Definition at line 275 of file crc.c.
Get an initialized standard CRC table.
- Parameters
-
crc_id | ID of a standard CRC |
- Returns
- a pointer to the CRC table or NULL on failure
Definition at line 261 of file crc.c.
int av_crc_init |
( |
AVCRC * |
ctx, |
|
|
int |
le, |
|
|
int |
bits, |
|
|
uint32_t |
poly, |
|
|
int |
ctx_size |
|
) |
| |
Initialize a CRC table.
- Parameters
-
ctx | must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024 |
le | If 1, the lowest bit represents the coefficient for the highest exponent of the 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): av_bswap32(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 |
ctx_size | size of ctx in bytes |
- Returns
- <0 on failure
Definition at line 228 of file crc.c.