mpeg.h File Reference

Go to the source code of this file.

Data Structures

struct  mpeg

Defines

#define MPEG_VERSION_1   3
#define MPEG_VERSION_2   2
#define MPEG_VERSION_2_5   0
#define LAYER_VERSION_1   3
#define LAYER_VERSION_2   2
#define LAYER_VERSION_3   1
#define CMODE_STEREO   0
#define CMODE_JOINT_STEREO   1
#define CMODE_DUAL_CHANNEL   2
#define CMODE_SINGLE_CHANNEL   3
#define FRAME_SIZE_LAYER_1   384
#define FRAME_SIZE_LAYER_2   1152
#define FRAME_SIZE_LAYER_3   1152
#define MASK_SYNC   0xFFE00000
#define SHIFT_SYNC   21
#define MASK_MPEG   0x180000
#define SHIFT_MPEG   19
#define MASK_LAYER   0x60000
#define SHIFT_LAYER   17
#define MASK_PROT   0x10000
#define SHIFT_PROT   16
#define MASK_BITRATE   0xF000
#define SHIFT_BITRATE   12
#define MASK_FREQ   0xC00
#define SHIFT_FREQ   10
#define MASK_PADDING   0x200
#define SHIFT_PADDING   9
#define MASK_PRIV   0x100
#define SHIFT_PRIV   8
#define MASK_CHAN   0xC0
#define SHIFT_CHAN   6
#define MASK_MODE_EXT   0x30
#define SHIFT_MODE_EXT   4
#define MASK_COPYRIGHT   0x8
#define SHIFT_COPYRIGHT   3
#define MASK_ORIG   0x4
#define SHIFT_ORIG   2
#define MASK_EMPHASIS   0x3
#define SHIFT_EMPHASIS   0

Functions

int mpeg_read (const char *_path, struct mpeg *_mpeg)
unsigned long int mpeg_seek_next_header (FILE *_fp)
int mpeg_extract_info (unsigned long int _header, struct mpeg *_mpeg)
size_t mpeg_frame_length (struct mpeg *_mpeg)
size_t mpeg_frame_bytes (struct mpeg *_mpeg)
void mpeg_print (struct mpeg *_mpeg)


Define Documentation

#define MPEG_VERSION_1   3

Definition at line 35 of file mpeg.h.

Referenced by mpeg_extract_info(), and mpeg_print().

#define MPEG_VERSION_2   2

Definition at line 36 of file mpeg.h.

Referenced by mpeg_extract_info(), and mpeg_print().

#define MPEG_VERSION_2_5   0

Definition at line 37 of file mpeg.h.

Referenced by mpeg_extract_info(), and mpeg_print().

#define LAYER_VERSION_1   3

Definition at line 39 of file mpeg.h.

Referenced by mpeg_frame_length(), and mpeg_print().

#define LAYER_VERSION_2   2

Definition at line 40 of file mpeg.h.

Referenced by mpeg_print().

#define LAYER_VERSION_3   1

Definition at line 41 of file mpeg.h.

Referenced by mpeg_print().

#define CMODE_STEREO   0

Definition at line 43 of file mpeg.h.

#define CMODE_JOINT_STEREO   1

Definition at line 44 of file mpeg.h.

Referenced by mpeg_print().

#define CMODE_DUAL_CHANNEL   2

Definition at line 45 of file mpeg.h.

#define CMODE_SINGLE_CHANNEL   3

Definition at line 46 of file mpeg.h.

#define FRAME_SIZE_LAYER_1   384

Definition at line 49 of file mpeg.h.

#define FRAME_SIZE_LAYER_2   1152

Definition at line 50 of file mpeg.h.

#define FRAME_SIZE_LAYER_3   1152

Definition at line 51 of file mpeg.h.

#define MASK_SYNC   0xFFE00000

Definition at line 53 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_SYNC   21

Definition at line 54 of file mpeg.h.

#define MASK_MPEG   0x180000

Definition at line 56 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_MPEG   19

Definition at line 57 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_LAYER   0x60000

Definition at line 59 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_LAYER   17

Definition at line 60 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_PROT   0x10000

Definition at line 62 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_PROT   16

Definition at line 63 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_BITRATE   0xF000

Definition at line 65 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_BITRATE   12

Definition at line 66 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_FREQ   0xC00

Definition at line 68 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_FREQ   10

Definition at line 69 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_PADDING   0x200

Definition at line 71 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_PADDING   9

Definition at line 72 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_PRIV   0x100

Definition at line 74 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_PRIV   8

Definition at line 75 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_CHAN   0xC0

Definition at line 77 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_CHAN   6

Definition at line 78 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_MODE_EXT   0x30

Definition at line 80 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_MODE_EXT   4

Definition at line 81 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_COPYRIGHT   0x8

Definition at line 83 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_COPYRIGHT   3

Definition at line 84 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_ORIG   0x4

Definition at line 86 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_ORIG   2

Definition at line 87 of file mpeg.h.

Referenced by mpeg_extract_info().

#define MASK_EMPHASIS   0x3

Definition at line 89 of file mpeg.h.

Referenced by mpeg_extract_info().

#define SHIFT_EMPHASIS   0

Definition at line 90 of file mpeg.h.

Referenced by mpeg_extract_info().


Function Documentation

int mpeg_read ( const char *  _path,
struct mpeg _mpeg 
)

Definition at line 118 of file mpeg.c.

References mpeg_extract_info(), and mpeg_seek_next_header().

Referenced by main().

unsigned long int mpeg_seek_next_header ( FILE *  _fp  ) 

Definition at line 139 of file mpeg.c.

References ntohl.

Referenced by mpeg_read().

int mpeg_extract_info ( unsigned long int  _header,
struct mpeg _mpeg 
)

Definition at line 156 of file mpeg.c.

References mpeg::bit_copyright, mpeg::bit_orig, mpeg::bit_padding, mpeg::bit_priv, mpeg::bit_prot, mpeg::bitrate, bitrates, mpeg::chan, mpeg::emphasis, mpeg::freq, freqs, mpeg::layer_desc, MASK_BITRATE, MASK_CHAN, MASK_COPYRIGHT, MASK_EMPHASIS, MASK_FREQ, MASK_LAYER, MASK_MODE_EXT, MASK_MPEG, MASK_ORIG, MASK_PADDING, MASK_PRIV, MASK_PROT, MASK_SYNC, mpeg::mode_ext, mpeg::mpeg_version, MPEG_VERSION_1, MPEG_VERSION_2, MPEG_VERSION_2_5, SHIFT_BITRATE, SHIFT_CHAN, SHIFT_COPYRIGHT, SHIFT_EMPHASIS, SHIFT_FREQ, SHIFT_LAYER, SHIFT_MODE_EXT, SHIFT_MPEG, SHIFT_ORIG, SHIFT_PADDING, SHIFT_PRIV, and SHIFT_PROT.

Referenced by mpeg_read().

size_t mpeg_frame_length ( struct mpeg _mpeg  ) 

Definition at line 200 of file mpeg.c.

References mpeg::bit_padding, mpeg::bitrate, mpeg::freq, mpeg::layer_desc, and LAYER_VERSION_1.

Referenced by mpeg_frame_bytes(), and mpeg_print().

size_t mpeg_frame_bytes ( struct mpeg _mpeg  ) 

Definition at line 207 of file mpeg.c.

References mpeg_frame_length().

Referenced by mpeg_print().

void mpeg_print ( struct mpeg _mpeg  ) 

Definition at line 212 of file mpeg.c.

References mpeg::bit_copyright, mpeg::bit_orig, mpeg::bit_padding, mpeg::bit_priv, mpeg::bit_prot, mpeg::bitrate, mpeg::chan, CMODE_JOINT_STEREO, mpeg::emphasis, mpeg::freq, mpeg::layer_desc, LAYER_VERSION_1, LAYER_VERSION_2, LAYER_VERSION_3, mpeg::mode_ext, mpeg_frame_bytes(), mpeg_frame_length(), mpeg::mpeg_version, MPEG_VERSION_1, MPEG_VERSION_2, and MPEG_VERSION_2_5.

Referenced by main().


Generated on Thu Jul 19 13:36:09 2007 for libv by  doxygen 1.5.1-p1. Thank you, SourceForge.net Logo