#include "avcodec.h"
#include "bitstream.h"
#include "bytestream.h"
Go to the source code of this file.
Data Structures | |
struct | PCMDecode |
Defines | |
#define | MAX_CHANNELS 64 |
#define | SIGN_BIT (0x80) |
#define | QUANT_MASK (0xf) |
#define | NSEGS (8) |
#define | SEG_SHIFT (4) |
#define | SEG_MASK (0x70) |
#define | BIAS (0x84) |
#define | PCM_ENCODER(id, name) |
#define | PCM_DECODER(id, name) |
#define | PCM_CODEC(id, name) PCM_ENCODER(id,name) PCM_DECODER(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 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, const 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, const 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_DECODER (CODEC_ID_PCM_S16LE_PLANAR, pcm_s16le_planar) | |
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] |
Definition in file pcm.c.
#define BIAS (0x84) |
#define QUANT_MASK (0xf) |
#define SEG_MASK (0x70) |
#define SEG_SHIFT (4) |
#define SIGN_BIT (0x80) |
static int alaw2linear | ( | unsigned char | a_val | ) | [static] |
static void build_xlaw_table | ( | uint8_t * | linear_to_xlaw, | |
int(*)(unsigned char) | xlaw2linear, | |||
int | mask | |||
) | [static] |
static void decode_to16 | ( | int | bps, | |
int | le, | |||
int | us, | |||
const uint8_t ** | src, | |||
short ** | samples, | |||
int | src_len | |||
) | [inline, static] |
convert samples to 16 bit
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 357 of file pcm.c.
Referenced by pcm_decode_frame().
static void encode_from16 | ( | int | bps, | |
int | le, | |||
int | us, | |||
short ** | samples, | |||
uint8_t ** | dst, | |||
int | n | |||
) | [inline, static] |
convert samples from 16 bit
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 173 of file pcm.c.
Referenced by pcm_encode_frame().
PCM_CODEC | ( | CODEC_ID_PCM_ZORK | , | |
pcm_zork | ||||
) |
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 | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S24DAUD | , | |
pcm_s24daud | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U24BE | , | |
pcm_u24be | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U24LE | , | |
pcm_u24le | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S24BE | , | |
pcm_s24be | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S24LE | , | |
pcm_s24le | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U32BE | , | |
pcm_u32be | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U32LE | , | |
pcm_u32le | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S32BE | , | |
pcm_s32be | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S32LE | , | |
pcm_s32le | ||||
) |
static int pcm_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
static int pcm_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
PCM_DECODER | ( | CODEC_ID_PCM_S16LE_PLANAR | , | |
pcm_s16le_planar | ||||
) |
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] |
uint8_t linear_to_alaw[16384] [static] |
uint8_t linear_to_ulaw[16384] [static] |