FFmpeg
Macros | Functions | Variables
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)   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

◆ CRC_TABLE_SIZE

#define CRC_TABLE_SIZE   1024

Definition at line 318 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); \
}

Definition at line 322 of file crc.c.

◆ CRC_INIT_TABLE_ONCE

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

Definition at line 329 of file crc.c.

Variable Documentation

◆ av_crc_table

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().

av_crc_init
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
Initialize a CRC table.
Definition: crc.c:341
bits
uint8_t bits
Definition: vp3data.h:128
AV_ONCE_INIT
#define AV_ONCE_INIT
Definition: thread.h:201
AVOnce
#define AVOnce
Definition: thread.h:200
av_crc_table
static AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE]
Definition: crc.c:320