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 int | decode_scalar (GetBitContext *gb, int k, int limit, int readsamplesize) |
static int | 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 | decorrelate_stereo (int32_t *buffer[MAX_CHANNELS], int numsamples, uint8_t interlacing_shift, uint8_t interlacing_leftweight) |
static void | append_extra_bits (int32_t *buffer[MAX_CHANNELS], int32_t *extra_bits_buffer[MAX_CHANNELS], int extra_bits, int numchannels, int numsamples) |
static void | interleave_stereo_16 (int32_t *buffer[MAX_CHANNELS], int16_t *buffer_out, int numsamples) |
static void | interleave_stereo_24 (int32_t *buffer[MAX_CHANNELS], int32_t *buffer_out, int numsamples) |
static void | interleave_stereo_32 (int32_t *buffer[MAX_CHANNELS], int32_t *buffer_out, int numsamples) |
static int | alac_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) |
static av_cold int | alac_decode_close (AVCodecContext *avctx) |
static int | allocate_buffers (ALACContext *alac) |
static int | alac_set_info (ALACContext *alac) |
static av_cold int | alac_decode_init (AVCodecContext *avctx) |
Variables | |
AVCodec | ff_alac_decoder |
ALAC (Apple Lossless Audio Codec) decoder.
Note: This decoder expects a 36-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:
32bit atom size 32bit tag ("alac") 32bit tag version (0) 32bit samples per frame (used when not set explicitly in the frames) 8bit compatible version (0) 8bit sample size 8bit history mult (40) 8bit initial history (14) 8bit kmodifier (10) 8bit channels 16bit maxRun (255) 32bit max coded frame size (0 means unknown) 32bit average bitrate (0 means unknown) 32bit samplerate
Definition in file alac.c.
#define ALAC_EXTRADATA_SIZE 36 |
Definition at line 55 of file alac.c.
Referenced by alac_decode_init().
#define MAX_CHANNELS 2 |
Definition at line 56 of file alac.c.
Referenced by alac_decode_frame(), and alac_decode_init().
static av_cold int alac_decode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 568 of file alac.c.
Referenced by allocate_buffers().
static int alac_decode_frame | ( | AVCodecContext * | avctx, |
void * | data, | ||
int * | got_frame_ptr, | ||
AVPacket * | avpkt | ||
) | [static] |
static av_cold int alac_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static int alac_set_info | ( | ALACContext * | alac | ) | [static] |
Definition at line 603 of file alac.c.
Referenced by alac_decode_init().
static int allocate_buffers | ( | ALACContext * | alac | ) | [static] |
Definition at line 582 of file alac.c.
Referenced by alac_decode_init().
static void append_extra_bits | ( | int32_t * | buffer[MAX_CHANNELS], |
int32_t * | extra_bits_buffer[MAX_CHANNELS], | ||
int | extra_bits, | ||
int | numchannels, | ||
int | numsamples | ||
) | [static] |
Definition at line 321 of file alac.c.
Referenced by alac_decode_frame().
static int 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 111 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 84 of file alac.c.
Referenced by bastardized_rice_decompress().
static void decorrelate_stereo | ( | int32_t * | buffer[MAX_CHANNELS], |
int | numsamples, | ||
uint8_t | interlacing_shift, | ||
uint8_t | interlacing_leftweight | ||
) | [static] |
Definition at line 301 of file alac.c.
Referenced by alac_decode_frame().
static void interleave_stereo_16 | ( | int32_t * | buffer[MAX_CHANNELS], |
int16_t * | buffer_out, | ||
int | numsamples | ||
) | [static] |
Definition at line 332 of file alac.c.
Referenced by alac_decode_frame().
static void interleave_stereo_24 | ( | int32_t * | buffer[MAX_CHANNELS], |
int32_t * | buffer_out, | ||
int | numsamples | ||
) | [static] |
Definition at line 343 of file alac.c.
Referenced by alac_decode_frame().
static void interleave_stereo_32 | ( | int32_t * | buffer[MAX_CHANNELS], |
int32_t * | buffer_out, | ||
int | numsamples | ||
) | [static] |
Definition at line 354 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 189 of file alac.c.
Referenced by alac_decode_frame().
static int sign_only | ( | int | v | ) | [inline, static] |
Definition at line 184 of file alac.c.
Referenced by predictor_decompress_fir_adapt().
{ .name = "alac", .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_ALAC, .priv_data_size = sizeof(ALACContext), .init = alac_decode_init, .close = alac_decode_close, .decode = alac_decode_frame, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), }