FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
crc.c File Reference
#include "config.h"
#include "thread.h"
#include "avassert.h"
#include "bswap.h"
#include "common.h"
#include "crc.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)   ff_thread_once(&id ## _once_control, id ## _init_table_once)
 

Functions

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

Variables

static AVCRC av_crc_table [AV_CRC_MAX][CRC_TABLE_SIZE]
 

Macro Definition Documentation

#define CRC_TABLE_SIZE   1024

Definition at line 318 of file crc.c.

#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); \
}
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
Initialize a CRC table.
Definition: crc.c:341
#define AVOnce
Definition: thread.h:159
#define AV_ONCE_INIT
Definition: thread.h:160
static AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE]
Definition: crc.c:320

Definition at line 322 of file crc.c.

#define CRC_INIT_TABLE_ONCE (   id)    ff_thread_once(&id ## _once_control, id ## _init_table_once)

Definition at line 329 of file crc.c.

Referenced by av_crc_get_table().

Variable Documentation

AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE]
static

Definition at line 320 of file crc.c.

Referenced by av_crc_get_table().