pcm.c File Reference


Detailed Description

PCM codecs.

Definition in file pcm.c.

Go to the source code of this file.

Classes

struct  PCMDecode

Functions

static int alaw2linear (unsigned char a_val)
static int ulaw2linear (unsigned char u_val)
static void build_xlaw_table (uint8_t *linear_to_xlaw, int(*xlaw2linear)(unsigned char), int mask)
static int pcm_encode_init (AVCodecContext *avctx)
static int pcm_encode_close (AVCodecContext *avctx)
static void encode_from16 (int bps, int le, int us, short **samples, uint8_t **dst, int n)
 convert samples from 16 bit
static int pcm_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static int pcm_decode_init (AVCodecContext *avctx)
static void decode_to16 (int bps, int le, int us, uint8_t **src, short **samples, int src_len)
 convert samples to 16 bit
static int pcm_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
 PCM_CODEC (CODEC_ID_PCM_S32LE, pcm_s32le)
 PCM_CODEC (CODEC_ID_PCM_S32BE, pcm_s32be)
 PCM_CODEC (CODEC_ID_PCM_U32LE, pcm_u32le)
 PCM_CODEC (CODEC_ID_PCM_U32BE, pcm_u32be)
 PCM_CODEC (CODEC_ID_PCM_S24LE, pcm_s24le)
 PCM_CODEC (CODEC_ID_PCM_S24BE, pcm_s24be)
 PCM_CODEC (CODEC_ID_PCM_U24LE, pcm_u24le)
 PCM_CODEC (CODEC_ID_PCM_U24BE, pcm_u24be)
 PCM_CODEC (CODEC_ID_PCM_S24DAUD, pcm_s24daud)
 PCM_CODEC (CODEC_ID_PCM_S16LE, pcm_s16le)
 PCM_CODEC (CODEC_ID_PCM_S16BE, pcm_s16be)
 PCM_CODEC (CODEC_ID_PCM_U16LE, pcm_u16le)
 PCM_CODEC (CODEC_ID_PCM_U16BE, pcm_u16be)
 PCM_CODEC (CODEC_ID_PCM_S8, pcm_s8)
 PCM_CODEC (CODEC_ID_PCM_U8, pcm_u8)
 PCM_CODEC (CODEC_ID_PCM_ALAW, pcm_alaw)
 PCM_CODEC (CODEC_ID_PCM_MULAW, pcm_mulaw)
 PCM_CODEC (CODEC_ID_PCM_ZORK, pcm_zork)

Variables

static uint8_t linear_to_alaw [16384]
static uint8_t linear_to_ulaw [16384]


Function Documentation

static int alaw2linear ( unsigned char  a_val  )  [static]

Definition at line 45 of file pcm.c.

Referenced by pcm_decode_init(), and pcm_encode_init().

static int ulaw2linear ( unsigned char  u_val  )  [static]

Definition at line 60 of file pcm.c.

Referenced by pcm_decode_init(), and pcm_encode_init().

static void build_xlaw_table ( uint8_t *  linear_to_xlaw,
int(*)(unsigned char)  xlaw2linear,
int  mask 
) [static]

Definition at line 81 of file pcm.c.

Referenced by pcm_encode_init().

static int pcm_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 105 of file pcm.c.

static int pcm_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 155 of file pcm.c.

static void encode_from16 ( int  bps,
int  le,
int  us,
short **  samples,
uint8_t **  dst,
int  n 
) [inline, static]

convert samples from 16 bit

Parameters:
bps byte per sample for the destination format, must be >= 2
le 0 for big-, 1 for little-endian
us 0 for signed, 1 for unsigned output
samples input samples
dst output samples
n number of samples in samples buffer.

Definition at line 171 of file pcm.c.

Referenced by pcm_encode_frame().

static int pcm_encode_frame ( AVCodecContext avctx,
unsigned char *  frame,
int  buf_size,
void *  data 
) [static]

Definition at line 187 of file pcm.c.

static int pcm_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 326 of file pcm.c.

static void decode_to16 ( int  bps,
int  le,
int  us,
uint8_t **  src,
short **  samples,
int  src_len 
) [inline, static]

convert samples to 16 bit

Parameters:
bps byte per sample for the source format, must be >= 2
le 0 for big-, 1 for little-endian
us 0 for signed, 1 for unsigned input
src input samples
samples output samples
src_len number of bytes in src

Definition at line 355 of file pcm.c.

Referenced by pcm_decode_frame().

static int pcm_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 372 of file pcm.c.

PCM_CODEC ( CODEC_ID_PCM_S32LE  ,
pcm_s32le   
)

PCM_CODEC ( CODEC_ID_PCM_S32BE  ,
pcm_s32be   
)

PCM_CODEC ( CODEC_ID_PCM_U32LE  ,
pcm_u32le   
)

PCM_CODEC ( CODEC_ID_PCM_U32BE  ,
pcm_u32be   
)

PCM_CODEC ( CODEC_ID_PCM_S24LE  ,
pcm_s24le   
)

PCM_CODEC ( CODEC_ID_PCM_S24BE  ,
pcm_s24be   
)

PCM_CODEC ( CODEC_ID_PCM_U24LE  ,
pcm_u24le   
)

PCM_CODEC ( CODEC_ID_PCM_U24BE  ,
pcm_u24be   
)

PCM_CODEC ( CODEC_ID_PCM_S24DAUD  ,
pcm_s24daud   
)

PCM_CODEC ( CODEC_ID_PCM_S16LE  ,
pcm_s16le   
)

PCM_CODEC ( CODEC_ID_PCM_S16BE  ,
pcm_s16be   
)

PCM_CODEC ( CODEC_ID_PCM_U16LE  ,
pcm_u16le   
)

PCM_CODEC ( CODEC_ID_PCM_U16BE  ,
pcm_u16be   
)

PCM_CODEC ( CODEC_ID_PCM_S8  ,
pcm_s8   
)

PCM_CODEC ( CODEC_ID_PCM_U8  ,
pcm_u8   
)

PCM_CODEC ( CODEC_ID_PCM_ALAW  ,
pcm_alaw   
)

PCM_CODEC ( CODEC_ID_PCM_MULAW  ,
pcm_mulaw   
)

PCM_CODEC ( CODEC_ID_PCM_ZORK  ,
pcm_zork   
)


Variable Documentation

uint8_t linear_to_alaw[16384] [static]

Definition at line 78 of file pcm.c.

Referenced by pcm_encode_frame(), and pcm_encode_init().

uint8_t linear_to_ulaw[16384] [static]

Definition at line 79 of file pcm.c.

Referenced by pcm_encode_frame(), and pcm_encode_init().


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