hvirtual/quicktime/ffmpeg/libavcodec/pcm.c File Reference

#include "avcodec.h"

Include dependency graph for pcm.c:

Go to the source code of this file.

Data Structures

struct  PCMDecode

Defines

#define SIGN_BIT   (0x80)
#define QUANT_MASK   (0xf)
#define NSEGS   (8)
#define SEG_SHIFT   (4)
#define SEG_MASK   (0x70)
#define BIAS   (0x84)
#define PCM_CODEC(id, name)

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 int pcm_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static int pcm_decode_init (AVCodecContext *avctx)
static int pcm_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
 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)

Variables

static uint8_t * linear_to_alaw = NULL
static int linear_to_alaw_ref = 0
static uint8_t * linear_to_ulaw = NULL
static int linear_to_ulaw_ref = 0


Define Documentation

#define BIAS   (0x84)

Definition at line 35 of file pcm.c.

#define NSEGS   (8)

Definition at line 31 of file pcm.c.

#define PCM_CODEC ( id,
name   ) 

Value:

AVCodec name ## _encoder = {                    \
    #name,                                      \
    CODEC_TYPE_AUDIO,                           \
    id,                                         \
    0,                                          \
    pcm_encode_init,                            \
    pcm_encode_frame,                           \
    pcm_encode_close,                           \
    NULL,                                       \
};                                              \
AVCodec name ## _decoder = {                    \
    #name,                                      \
    CODEC_TYPE_AUDIO,                           \
    id,                                         \
    sizeof(PCMDecode),                          \
    pcm_decode_init,                            \
    NULL,                                       \
    NULL,                                       \
    pcm_decode_frame,                           \
}

Definition at line 363 of file pcm.c.

#define QUANT_MASK   (0xf)

Definition at line 30 of file pcm.c.

Referenced by alaw2linear(), and ulaw2linear().

#define SEG_MASK   (0x70)

Definition at line 33 of file pcm.c.

Referenced by alaw2linear().

#define SEG_SHIFT   (4)

Definition at line 32 of file pcm.c.

Referenced by alaw2linear(), and ulaw2linear().

#define SIGN_BIT   (0x80)

Definition at line 29 of file pcm.c.

Referenced by alaw2linear(), and ulaw2linear().


Function Documentation

static int alaw2linear ( unsigned char  a_val  )  [static]

Definition at line 41 of file pcm.c.

References QUANT_MASK, SEG_MASK, SEG_SHIFT, SIGN_BIT, and t.

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 80 of file pcm.c.

Referenced by pcm_encode_init().

PCM_CODEC ( CODEC_ID_PCM_MULAW  ,
pcm_mulaw   
)

PCM_CODEC ( CODEC_ID_PCM_ALAW  ,
pcm_alaw   
)

PCM_CODEC ( CODEC_ID_PCM_U8  ,
pcm_u8   
)

PCM_CODEC ( CODEC_ID_PCM_S8  ,
pcm_s8   
)

PCM_CODEC ( CODEC_ID_PCM_U16BE  ,
pcm_u16be   
)

PCM_CODEC ( CODEC_ID_PCM_U16LE  ,
pcm_u16le   
)

PCM_CODEC ( CODEC_ID_PCM_S16BE  ,
pcm_s16be   
)

PCM_CODEC ( CODEC_ID_PCM_S16LE  ,
pcm_s16le   
)

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

static int pcm_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 270 of file pcm.c.

References alaw2linear(), AVCodecContext::codec, CODEC_ID_PCM_ALAW, CODEC_ID_PCM_MULAW, AVCodec::id, AVCodecContext::priv_data, s, PCMDecode::table, and ulaw2linear().

Here is the call graph for this function:

static int pcm_encode_close ( AVCodecContext avctx  )  [static]

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

static int pcm_encode_init ( AVCodecContext avctx  )  [static]

static int ulaw2linear ( unsigned char  u_val  )  [static]

Definition at line 56 of file pcm.c.

References BIAS, QUANT_MASK, SEG_SHIFT, SIGN_BIT, and t.

Referenced by pcm_decode_init(), and pcm_encode_init().


Variable Documentation

uint8_t* linear_to_alaw = NULL [static]

Definition at line 74 of file pcm.c.

Referenced by pcm_encode_close(), pcm_encode_frame(), and pcm_encode_init().

int linear_to_alaw_ref = 0 [static]

Definition at line 75 of file pcm.c.

Referenced by pcm_encode_close(), and pcm_encode_init().

uint8_t* linear_to_ulaw = NULL [static]

Definition at line 77 of file pcm.c.

Referenced by pcm_encode_close(), pcm_encode_frame(), and pcm_encode_init().

int linear_to_ulaw_ref = 0 [static]

Definition at line 78 of file pcm.c.

Referenced by pcm_encode_close(), and pcm_encode_init().


Generated on Mon Apr 28 13:58:42 2008 for Cinelerra by  doxygen 1.5.5