#include "avcodec.h"#include "bitstream.h"

Go to the source code of this file.
Data Structures | |
| struct | ALACContext |
Defines | |
| #define | ALAC_EXTRADATA_SIZE 36 |
| #define | SIGN_EXTENDED32(val, bits) ((val << (32 - bits)) >> (32 - bits)) |
| #define | SIGN_ONLY(v) |
Functions | |
| static void | allocate_buffers (ALACContext *alac) |
| void | alac_set_info (ALACContext *alac) |
| static int | count_leading_zeros (int32_t input) |
| 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 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) |
| void | deinterlace_16 (int32_t *buffer_a, int32_t *buffer_b, int16_t *buffer_out, int numchannels, int numsamples, uint8_t interlacing_shift, uint8_t interlacing_leftweight) |
| static int | alac_decode_frame (AVCodecContext *avctx, void *outbuffer, int *outputsize, uint8_t *inbuffer, int input_buffer_size) |
| static int | alac_decode_init (AVCodecContext *avctx) |
| static int | alac_decode_close (AVCodecContext *avctx) |
Variables | |
| AVCodec | alac_decoder |
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
Definition in file alac.c.
| #define ALAC_EXTRADATA_SIZE 36 |
Definition at line 255 of file alac.c.
Referenced by alac_decode_frame(), and predictor_decompress_fir_adapt().
| #define SIGN_ONLY | ( | v | ) |
Value:
((v < 0) ? (-1) : \
((v > 0) ? (1) : \
(0)))
Definition at line 257 of file alac.c.
Referenced by predictor_decompress_fir_adapt().
| static int alac_decode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 811 of file alac.c.
References av_free(), ALACContext::outputsamples_buffer_a, ALACContext::outputsamples_buffer_b, ALACContext::predicterror_buffer_a, ALACContext::predicterror_buffer_b, and AVCodecContext::priv_data.

| static int alac_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | outbuffer, | |||
| int * | outputsize, | |||
| uint8_t * | inbuffer, | |||
| int | input_buffer_size | |||
| ) | [static] |
Definition at line 431 of file alac.c.
References ALAC_EXTRADATA_SIZE, alac_set_info(), av_log(), AV_LOG_ERROR, ALACContext::avctx, bastardized_rice_decompress(), be2me_16, ALACContext::bytespersample, ALACContext::context_initialized, deinterlace_16(), AVCodecContext::extradata_size, ALACContext::gb, get_bits(), init_get_bits(), NULL, ALACContext::numchannels, ALACContext::outputsamples_buffer_a, ALACContext::outputsamples_buffer_b, ALACContext::predicterror_buffer_a, ALACContext::predicterror_buffer_b, predictor_decompress_fir_adapt(), AVCodecContext::priv_data, ALACContext::setinfo_max_samples_per_frame, ALACContext::setinfo_rice_historymult, ALACContext::setinfo_rice_initialhistory, ALACContext::setinfo_rice_kmodifier, ALACContext::setinfo_sample_size, and SIGN_EXTENDED32.

| static int alac_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 798 of file alac.c.
References ALACContext::avctx, AVCodecContext::bits_per_sample, ALACContext::bytespersample, AVCodecContext::channels, ALACContext::context_initialized, ALACContext::numchannels, AVCodecContext::priv_data, and ALACContext::samplesize.
| void alac_set_info | ( | ALACContext * | alac | ) |
Definition at line 87 of file alac.c.
References allocate_buffers(), ALACContext::avctx, BE_16, BE_32, AVCodecContext::extradata, ALACContext::setinfo_7a, ALACContext::setinfo_7f, ALACContext::setinfo_80, ALACContext::setinfo_82, ALACContext::setinfo_86, ALACContext::setinfo_8a_rate, ALACContext::setinfo_max_samples_per_frame, ALACContext::setinfo_rice_historymult, ALACContext::setinfo_rice_initialhistory, ALACContext::setinfo_rice_kmodifier, and ALACContext::setinfo_sample_size.
Referenced by alac_decode_frame().

| static void allocate_buffers | ( | ALACContext * | alac | ) | [static] |
Definition at line 78 of file alac.c.
References av_malloc(), ALACContext::outputsamples_buffer_a, ALACContext::outputsamples_buffer_b, ALACContext::predicterror_buffer_a, ALACContext::predicterror_buffer_b, and ALACContext::setinfo_max_samples_per_frame.
Referenced by alac_set_info(), metadata_streaminfo(), and shorten_decode_frame().

| 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 | |||
| ) |
Definition at line 128 of file alac.c.
References count_leading_zeros(), ALACContext::gb, get_bits(), get_bits1(), and show_bits().
Referenced by alac_decode_frame().

| static int count_leading_zeros | ( | int32_t | input | ) | [static] |
| void deinterlace_16 | ( | int32_t * | buffer_a, | |
| int32_t * | buffer_b, | |||
| int16_t * | buffer_out, | |||
| int | numchannels, | |||
| int | numsamples, | |||
| uint8_t | interlacing_shift, | |||
| uint8_t | interlacing_leftweight | |||
| ) |
| 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 262 of file alac.c.
References memcpy, SIGN_EXTENDED32, and SIGN_ONLY.
Referenced by alac_decode_frame().
Initial value:
{
"alac",
CODEC_TYPE_AUDIO,
CODEC_ID_ALAC,
sizeof(ALACContext),
alac_decode_init,
NULL,
alac_decode_close,
alac_decode_frame,
}
Definition at line 824 of file alac.c.
Referenced by avcodec_register_all().
1.5.5