crc.h File Reference

Go to the source code of this file.

Typedefs

typedef uint32_t AVCRC

Functions

int av_crc_init (AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
 Inits a 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.

Variables

AVCRCav_crcEDB88320
AVCRCav_crc04C11DB7
AVCRCav_crc8005
AVCRCav_crc07


Typedef Documentation

typedef uint32_t AVCRC

Definition at line 27 of file crc.h.


Function Documentation

int av_crc_init ( AVCRC ctx,
int  le,
int  bits,
uint32_t  poly,
int  ctx_size 
)

Inits a crc table.

Parameters:
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
Returns:
<0 on failure

Definition at line 51 of file crc.c.

Referenced by init_crcs(), and main().

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 89 of file crc.c.

Referenced by ac3_decode_frame(), PESPacket::CalcCRC(), decode_frame(), ff_crc04C11DB7_update(), main(), mpegts_write_section(), output_frame_end(), output_frame_footer(), output_frame_header(), and write_section_data().


Variable Documentation

Definition at line 42 of file crc.h.

Definition at line 44 of file crc.h.

Referenced by ac3_decode_frame(), init_crcs(), output_frame_end(), and output_frame_footer().

Definition at line 45 of file crc.h.

Referenced by decode_frame(), init_crcs(), and output_frame_header().


Generated on Sat Dec 18 05:15:51 2010 for MythTV by  doxygen 1.5.5