#include "avcodec.h"

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 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, \ }
| #define QUANT_MASK (0xf) |
| #define SEG_MASK (0x70) |
| #define SEG_SHIFT (4) |
| #define SIGN_BIT (0x80) |
| 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] |
| 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] |
Definition at line 290 of file pcm.c.
References AVCODEC_MAX_AUDIO_FRAME_SIZE, AVCodecContext::codec, CODEC_ID_PCM_ALAW, CODEC_ID_PCM_MULAW, CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE, CODEC_ID_PCM_S8, CODEC_ID_PCM_U16BE, CODEC_ID_PCM_U16LE, CODEC_ID_PCM_U8, AVCodec::id, AVCodecContext::priv_data, s, samples, src, and PCMDecode::table.
| 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().

| static int pcm_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 153 of file pcm.c.
References av_free(), av_freep(), AVCodecContext::codec, CODEC_ID_PCM_ALAW, CODEC_ID_PCM_MULAW, AVCodecContext::coded_frame, AVCodec::id, linear_to_alaw, linear_to_alaw_ref, linear_to_ulaw, and linear_to_ulaw_ref.

| static int pcm_encode_frame | ( | AVCodecContext * | avctx, | |
| unsigned char * | frame, | |||
| int | buf_size, | |||
| void * | data | |||
| ) | [static] |
Definition at line 173 of file pcm.c.
References AVCodecContext::codec, CODEC_ID_PCM_ALAW, CODEC_ID_PCM_MULAW, CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE, CODEC_ID_PCM_S8, CODEC_ID_PCM_U16BE, CODEC_ID_PCM_U16LE, CODEC_ID_PCM_U8, AVCodec::id, linear_to_alaw, linear_to_ulaw, and samples.
| static int pcm_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 104 of file pcm.c.
References alaw2linear(), av_malloc(), avcodec_alloc_frame(), AVCodecContext::block_align, build_xlaw_table(), AVCodecContext::channels, AVCodecContext::codec, CODEC_ID_PCM_ALAW, CODEC_ID_PCM_MULAW, CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE, CODEC_ID_PCM_S8, CODEC_ID_PCM_U16BE, CODEC_ID_PCM_U16LE, CODEC_ID_PCM_U8, AVCodecContext::coded_frame, AVCodecContext::frame_size, AVCodec::id, linear_to_alaw, linear_to_alaw_ref, linear_to_ulaw, linear_to_ulaw_ref, and ulaw2linear().

| 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().
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] |
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] |
1.5.5