#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 | ENCODE(type, endian, src, dst, n, shift, offset) |
Write PCM samples macro. | |
#define | DECODE(type, endian, src, dst, n, shift, offset) |
Read PCM samples macro. | |
#define | PCM_ENCODER(id, sample_fmt_, name, long_name_) |
#define | PCM_DECODER(id, sample_fmt_, name, long_name_) |
#define | PCM_CODEC(id, sample_fmt_, name, long_name_) PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,sample_fmt_,name,long_name_) |
Functions | |
static av_cold int | alaw2linear (unsigned char a_val) |
static av_cold int | ulaw2linear (unsigned char u_val) |
static av_cold void | build_xlaw_table (uint8_t *linear_to_xlaw, int(*xlaw2linear)(unsigned char), int mask) |
static av_cold int | pcm_encode_init (AVCodecContext *avctx) |
static av_cold int | pcm_encode_close (AVCodecContext *avctx) |
static int | pcm_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) |
static av_cold int | pcm_decode_init (AVCodecContext *avctx) |
static int | pcm_decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) |
PCM_CODEC (CODEC_ID_PCM_ALAW, SAMPLE_FMT_S16, pcm_alaw,"PCM A-law") | |
PCM_CODEC (CODEC_ID_PCM_DVD, SAMPLE_FMT_S32, pcm_dvd,"PCM signed 20|24-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be,"PCM 32-bit floating point big-endian") | |
PCM_CODEC (CODEC_ID_PCM_F32LE, SAMPLE_FMT_FLT, pcm_f32le,"PCM 32-bit floating point little-endian") | |
PCM_CODEC (CODEC_ID_PCM_F64BE, SAMPLE_FMT_DBL, pcm_f64be,"PCM 64-bit floating point big-endian") | |
PCM_CODEC (CODEC_ID_PCM_F64LE, SAMPLE_FMT_DBL, pcm_f64le,"PCM 64-bit floating point little-endian") | |
PCM_CODEC (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw,"PCM mu-law") | |
PCM_CODEC (CODEC_ID_PCM_S8, SAMPLE_FMT_U8, pcm_s8,"PCM signed 8-bit") | |
PCM_CODEC (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be,"PCM signed 16-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le,"PCM signed 16-bit little-endian") | |
PCM_DECODER (CODEC_ID_PCM_S16LE_PLANAR, SAMPLE_FMT_S16, pcm_s16le_planar,"PCM 16-bit little-endian planar") | |
PCM_CODEC (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S32, pcm_s24be,"PCM signed 24-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16, pcm_s24daud,"PCM D-Cinema audio signed 24-bit") | |
PCM_CODEC (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S32, pcm_s24le,"PCM signed 24-bit little-endian") | |
PCM_CODEC (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S32, pcm_s32be,"PCM signed 32-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S32, pcm_s32le,"PCM signed 32-bit little-endian") | |
PCM_CODEC (CODEC_ID_PCM_U8, SAMPLE_FMT_U8, pcm_u8,"PCM unsigned 8-bit") | |
PCM_CODEC (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be,"PCM unsigned 16-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le,"PCM unsigned 16-bit little-endian") | |
PCM_CODEC (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S32, pcm_u24be,"PCM unsigned 24-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S32, pcm_u24le,"PCM unsigned 24-bit little-endian") | |
PCM_CODEC (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S32, pcm_u32be,"PCM unsigned 32-bit big-endian") | |
PCM_CODEC (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S32, pcm_u32le,"PCM unsigned 32-bit little-endian") | |
PCM_CODEC (CODEC_ID_PCM_ZORK, SAMPLE_FMT_S16, 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) |
Value:
dst_##type = (type*)dst; \ for(;n>0;n--) { \ register type v = bytestream_get_##endian(&src); \ *dst_##type++ = (v - offset) << shift; \ } \ dst = (short*)dst_##type;
type | Datatype of native machine format | |
endian | bytestream_get_xxx() endian suffix | |
src | Source pointer (variable name) | |
dst | Destination pointer (variable name) | |
n | Total number of samples (variable name) | |
shift | Bitshift (bits) | |
offset | Sample value offset |
Definition at line 316 of file pcm.c.
Referenced by pcm_decode_frame().
Value:
samples_##type = (type*)src; \ for(;n>0;n--) { \ register type v = (*samples_##type++ >> shift) + offset; \ bytestream_put_##endian(&dst, v); \ }
type | Datatype of native machine format | |
endian | bytestream_put_xxx() suffix | |
src | Source pointer (variable name) | |
dst | Destination pointer (variable name) | |
n | Total number of samples (variable name) | |
shift | Bitshift (bits) | |
offset | Sample value offset |
Definition at line 146 of file pcm.c.
Referenced by pcm_encode_frame().
#define QUANT_MASK (0xf) |
#define SEG_MASK (0x70) |
#define SEG_SHIFT (4) |
#define SIGN_BIT (0x80) |
static av_cold int alaw2linear | ( | unsigned char | a_val | ) | [static] |
static av_cold void build_xlaw_table | ( | uint8_t * | linear_to_xlaw, | |
int(*)(unsigned char) | xlaw2linear, | |||
int | mask | |||
) | [static] |
PCM_CODEC | ( | CODEC_ID_PCM_ZORK | , | |
SAMPLE_FMT_S16 | , | |||
pcm_zork | , | |||
"PCM Zork" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U32LE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_u32le | , | |||
"PCM unsigned 32-bit little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U32BE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_u32be | , | |||
"PCM unsigned 32-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U24LE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_u24le | , | |||
"PCM unsigned 24-bit little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U24BE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_u24be | , | |||
"PCM unsigned 24-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U16LE | , | |
SAMPLE_FMT_S16 | , | |||
pcm_u16le | , | |||
"PCM unsigned 16-bit little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U16BE | , | |
SAMPLE_FMT_S16 | , | |||
pcm_u16be | , | |||
"PCM unsigned 16-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_U8 | , | |
SAMPLE_FMT_U8 | , | |||
pcm_u8 | , | |||
"PCM unsigned 8-bit" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S32LE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_s32le | , | |||
"PCM signed 32-bit little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S32BE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_s32be | , | |||
"PCM signed 32-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S24LE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_s24le | , | |||
"PCM signed 24-bit little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S24DAUD | , | |
SAMPLE_FMT_S16 | , | |||
pcm_s24daud | , | |||
"PCM D-Cinema audio signed 24-bit" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S24BE | , | |
SAMPLE_FMT_S32 | , | |||
pcm_s24be | , | |||
"PCM signed 24-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S16LE | , | |
SAMPLE_FMT_S16 | , | |||
pcm_s16le | , | |||
"PCM signed 16-bit little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S16BE | , | |
SAMPLE_FMT_S16 | , | |||
pcm_s16be | , | |||
"PCM signed 16-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_S8 | , | |
SAMPLE_FMT_U8 | , | |||
pcm_s8 | , | |||
"PCM signed 8-bit" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_MULAW | , | |
SAMPLE_FMT_S16 | , | |||
pcm_mulaw | , | |||
"PCM mu-law" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_F64LE | , | |
SAMPLE_FMT_DBL | , | |||
pcm_f64le | , | |||
"PCM 64-bit floating point little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_F64BE | , | |
SAMPLE_FMT_DBL | , | |||
pcm_f64be | , | |||
"PCM 64-bit floating point big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_F32LE | , | |
SAMPLE_FMT_FLT | , | |||
pcm_f32le | , | |||
"PCM 32-bit floating point little-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_F32BE | , | |
SAMPLE_FMT_FLT | , | |||
pcm_f32be | , | |||
"PCM 32-bit floating point big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_DVD | , | |
SAMPLE_FMT_S32 | , | |||
pcm_dvd | , | |||
"PCM signed 20|24-bit big-endian" | ||||
) |
PCM_CODEC | ( | CODEC_ID_PCM_ALAW | , | |
SAMPLE_FMT_S16 | , | |||
pcm_alaw | , | |||
"PCM A-law" | ||||
) |
static int pcm_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
static av_cold int pcm_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
PCM_DECODER | ( | CODEC_ID_PCM_S16LE_PLANAR | , | |
SAMPLE_FMT_S16 | , | |||
pcm_s16le_planar | , | |||
"PCM 16-bit little-endian planar" | ||||
) |
static av_cold int pcm_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
static int pcm_encode_frame | ( | AVCodecContext * | avctx, | |
unsigned char * | frame, | |||
int | buf_size, | |||
void * | data | |||
) | [static] |
static av_cold int pcm_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
static av_cold int ulaw2linear | ( | unsigned char | u_val | ) | [static] |
uint8_t linear_to_alaw[16384] [static] |
uint8_t linear_to_ulaw[16384] [static] |