FFmpeg
Loading...
Searching...
No Matches
crc.c File Reference
#include "config.h"
#include "thread.h"
#include "avassert.h"
#include "bswap.h"
#include "crc.h"
#include "error.h"

Go to the source code of this file.

Macros

#define CRC_TABLE_SIZE   1024
 
#define DECLARE_CRC_INIT_TABLE_ONCE(id, le, bits, poly)
 
#define CRC_INIT_TABLE_ONCE(id)
 

Functions

int av_crc_init (AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
 Initialize a CRC table.
 
const AVCRCav_crc_get_table (AVCRCId crc_id)
 Get an initialized standard CRC table.
 
uint32_t av_crc (const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
 Calculate the CRC of a block.
 

Variables

static AVCRC av_crc_table [AV_CRC_MAX][CRC_TABLE_SIZE]
 

Macro Definition Documentation

◆ CRC_TABLE_SIZE

#define CRC_TABLE_SIZE   1024

Definition at line 323 of file crc.c.

◆ DECLARE_CRC_INIT_TABLE_ONCE

#define DECLARE_CRC_INIT_TABLE_ONCE ( id,
le,
bits,
poly )
Value:
static AVOnce id ## _once_control = AV_ONCE_INIT; \
static void id ## _init_table_once(void) \
{ \
av_assert0(av_crc_init(av_crc_table[id], le, bits, poly, sizeof(av_crc_table[id])) >= 0); \
}
static const uint8_t bits[8]
Definition fastaudio.c:100
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
Initialize a CRC table.
Definition crc.c:346
static AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE]
Definition crc.c:325
#define AVOnce
Definition thread.h:202
#define AV_ONCE_INIT
Definition thread.h:203

Definition at line 327 of file crc.c.

◆ CRC_INIT_TABLE_ONCE

#define CRC_INIT_TABLE_ONCE ( id)
Value:
ff_thread_once(&id ## _once_control, id ## _init_table_once)
static int ff_thread_once(char *control, void(*routine)(void))
Definition thread.h:205

Definition at line 334 of file crc.c.

Referenced by av_crc_get_table().

Variable Documentation

◆ av_crc_table

AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE]
static

Definition at line 325 of file crc.c.

Referenced by av_crc_get_table().