ALAC (Apple Lossless Audio Codec) decoder. More...
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "unary.h"
#include "mathops.h"
Go to the source code of this file.
Data Structures | |
struct | ALACContext |
Defines | |
#define | ALAC_EXTRADATA_SIZE 36 |
#define | MAX_CHANNELS 2 |
Functions | |
static void | allocate_buffers (ALACContext *alac) |
static int | alac_set_info (ALACContext *alac) |
static int | decode_scalar (GetBitContext *gb, int k, int limit, int readsamplesize) |
static void | bastardized_rice_decompress (ALACContext *alac, int32_t *output_buffer, int output_size, int readsamplesize, int rice_initialhistory, int rice_kmodifier, int rice_historymult, int rice_kmodifier_mask) |
static int | sign_only (int v) |
static void | predictor_decompress_fir_adapt (int32_t *error_buffer, int32_t *buffer_out, int output_size, int readsamplesize, int16_t *predictor_coef_table, int predictor_coef_num, int predictor_quantitization) |
static void | reconstruct_stereo_16 (int32_t *buffer[MAX_CHANNELS], int16_t *buffer_out, int numchannels, int numsamples, uint8_t interlacing_shift, uint8_t interlacing_leftweight) |
static void | decorrelate_stereo_24 (int32_t *buffer[MAX_CHANNELS], int32_t *buffer_out, int32_t *wasted_bits_buffer[MAX_CHANNELS], int wasted_bits, int numchannels, int numsamples, uint8_t interlacing_shift, uint8_t interlacing_leftweight) |
static int | alac_decode_frame (AVCodecContext *avctx, void *outbuffer, int *outputsize, AVPacket *avpkt) |
static av_cold int | alac_decode_init (AVCodecContext *avctx) |
static av_cold int | alac_decode_close (AVCodecContext *avctx) |
Variables | |
AVCodec | alac_decoder |
ALAC (Apple Lossless Audio Codec) decoder.
For more information on the ALAC format, visit: http://crazney.net/programs/itunes/alac.html
Note: This decoder expects a 36- (0x24-)byte QuickTime atom to be passed through the extradata[_size] fields. This atom is tacked onto the end of an 'alac' stsd atom and has the following format: bytes 0-3 atom size (0x24), big-endian bytes 4-7 atom type ('alac', not the 'alac' tag from start of stsd) bytes 8-35 data bytes needed by decoder
Extradata: 32bit size 32bit tag (=alac) 32bit zero? 32bit max sample per frame 8bit ?? (zero?) 8bit sample size 8bit history mult 8bit initial history 8bit kmodifier 8bit channels? 16bit ?? 32bit max coded frame size 32bit bitrate? 32bit samplerate
Definition in file alac.c.
#define ALAC_EXTRADATA_SIZE 36 |
Definition at line 61 of file alac.c.
Referenced by alac_decode_frame().
#define MAX_CHANNELS 2 |
Definition at line 62 of file alac.c.
Referenced by alac_decode_frame().
static av_cold int alac_decode_close | ( | AVCodecContext * | avctx | ) | [static] |
static int alac_decode_frame | ( | AVCodecContext * | avctx, | |
void * | outbuffer, | |||
int * | outputsize, | |||
AVPacket * | avpkt | |||
) | [static] |
static av_cold int alac_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static int alac_set_info | ( | ALACContext * | alac | ) | [static] |
Definition at line 107 of file alac.c.
Referenced by alac_decode_frame().
static void allocate_buffers | ( | ALACContext * | alac | ) | [static] |
Definition at line 93 of file alac.c.
Referenced by alac_set_info().
static void bastardized_rice_decompress | ( | ALACContext * | alac, | |
int32_t * | output_buffer, | |||
int | output_size, | |||
int | readsamplesize, | |||
int | rice_initialhistory, | |||
int | rice_kmodifier, | |||
int | rice_historymult, | |||
int | rice_kmodifier_mask | |||
) | [static] |
Definition at line 169 of file alac.c.
Referenced by alac_decode_frame().
static int decode_scalar | ( | GetBitContext * | gb, | |
int | k, | |||
int | limit, | |||
int | readsamplesize | |||
) | [inline, static] |
Definition at line 142 of file alac.c.
Referenced by bastardized_rice_decompress().
static void decorrelate_stereo_24 | ( | int32_t * | buffer[MAX_CHANNELS], | |
int32_t * | buffer_out, | |||
int32_t * | wasted_bits_buffer[MAX_CHANNELS], | |||
int | wasted_bits, | |||
int | numchannels, | |||
int | numsamples, | |||
uint8_t | interlacing_shift, | |||
uint8_t | interlacing_leftweight | |||
) | [static] |
Definition at line 406 of file alac.c.
Referenced by alac_decode_frame().
static void predictor_decompress_fir_adapt | ( | int32_t * | error_buffer, | |
int32_t * | buffer_out, | |||
int | output_size, | |||
int | readsamplesize, | |||
int16_t * | predictor_coef_table, | |||
int | predictor_coef_num, | |||
int | predictor_quantitization | |||
) | [static] |
Definition at line 243 of file alac.c.
Referenced by alac_decode_frame().
static void reconstruct_stereo_16 | ( | int32_t * | buffer[MAX_CHANNELS], | |
int16_t * | buffer_out, | |||
int | numchannels, | |||
int | numsamples, | |||
uint8_t | interlacing_shift, | |||
uint8_t | interlacing_leftweight | |||
) | [static] |
Definition at line 366 of file alac.c.
Referenced by alac_decode_frame().
static int sign_only | ( | int | v | ) | [inline, static] |
Definition at line 238 of file alac.c.
Referenced by predictor_decompress_fir_adapt().
{ "alac", AVMEDIA_TYPE_AUDIO, CODEC_ID_ALAC, sizeof(ALACContext), alac_decode_init, NULL, alac_decode_close, alac_decode_frame, .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), }