#include <limits.h>#include "avcodec.h"#include "bitstream.h"#include "golomb.h"

Go to the source code of this file.
Data Structures | |
| struct | ShortenContext |
Defines | |
| #define | DEBUG |
| #define | MAX_CHANNELS 8 |
| #define | MAX_BLOCKSIZE 65535 |
| #define | OUT_BUFFER_SIZE 16384 |
| #define | ULONGSIZE 2 |
| #define | WAVE_FORMAT_PCM 0x0001 |
| #define | DEFAULT_BLOCK_SIZE 256 |
| #define | TYPESIZE 4 |
| #define | CHANSIZE 0 |
| #define | LPCQSIZE 2 |
| #define | ENERGYSIZE 3 |
| #define | BITSHIFTSIZE 2 |
| #define | TYPE_S16HL 3 |
| #define | TYPE_S16LH 5 |
| #define | NWRAP 3 |
| #define | NSKIPSIZE 1 |
| #define | LPCQUANT 5 |
| #define | V2LPCQOFFSET (1 << LPCQUANT) |
| #define | FNSIZE 2 |
| #define | FN_DIFF0 0 |
| #define | FN_DIFF1 1 |
| #define | FN_DIFF2 2 |
| #define | FN_DIFF3 3 |
| #define | FN_QUIT 4 |
| #define | FN_BLOCKSIZE 5 |
| #define | FN_BITSHIFT 6 |
| #define | FN_QLPC 7 |
| #define | FN_ZERO 8 |
| #define | FN_VERBATIM 9 |
| #define | VERBATIM_CKSIZE_SIZE 5 |
| #define | VERBATIM_BYTE_SIZE 8 |
| #define | CANONICAL_HEADER_SIZE 44 |
Functions | |
| static int | shorten_decode_init (AVCodecContext *avctx) |
| static void | allocate_buffers (ShortenContext *s) |
| static unsigned int | get_uint (ShortenContext *s, int k) |
| static void | fix_bitshift (ShortenContext *s, int32_t *buffer) |
| static void | init_offset (ShortenContext *s) |
| static int | get_le32 (GetBitContext *gb) |
| static short | get_le16 (GetBitContext *gb) |
| static int | decode_wave_header (AVCodecContext *avctx, uint8_t *header, int header_size) |
| static int16_t * | interleave_buffer (int16_t *samples, int nchan, int blocksize, int32_t **buffer) |
| static void | decode_subframe_lpc (ShortenContext *s, int channel, int residual_size, int pred_order) |
| static int | shorten_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) |
| static int | shorten_decode_close (AVCodecContext *avctx) |
| static void | shorten_flush (AVCodecContext *avctx) |
Variables | |
| AVCodec | shorten_decoder |
Definition in file shorten.c.
| #define BITSHIFTSIZE 2 |
| #define CANONICAL_HEADER_SIZE 44 |
| #define CHANSIZE 0 |
| #define DEFAULT_BLOCK_SIZE 256 |
| #define ENERGYSIZE 3 |
| #define FN_BITSHIFT 6 |
| #define FN_BLOCKSIZE 5 |
| #define FN_DIFF0 0 |
| #define FN_DIFF1 1 |
| #define FN_DIFF2 2 |
| #define FN_DIFF3 3 |
| #define FN_QLPC 7 |
| #define FN_QUIT 4 |
| #define FN_VERBATIM 9 |
| #define FN_ZERO 8 |
| #define FNSIZE 2 |
| #define LPCQSIZE 2 |
| #define LPCQUANT 5 |
| #define NSKIPSIZE 1 |
| #define NWRAP 3 |
| #define OUT_BUFFER_SIZE 16384 |
| #define TYPE_S16HL 3 |
| #define TYPE_S16LH 5 |
| #define TYPESIZE 4 |
| #define ULONGSIZE 2 |
| #define V2LPCQOFFSET (1 << LPCQUANT) |
| #define VERBATIM_BYTE_SIZE 8 |
| #define VERBATIM_CKSIZE_SIZE 5 |
| #define WAVE_FORMAT_PCM 0x0001 |
| static void allocate_buffers | ( | ShortenContext * | s | ) | [static] |
Definition at line 109 of file shorten.c.
References av_realloc(), ShortenContext::blocksize, ShortenContext::channels, ShortenContext::decoded, ShortenContext::nmean, ShortenContext::nwrap, and ShortenContext::offset.

| static void decode_subframe_lpc | ( | ShortenContext * | s, | |
| int | channel, | |||
| int | residual_size, | |||
| int | pred_order | |||
| ) | [static] |
Definition at line 241 of file shorten.c.
References ShortenContext::blocksize, ShortenContext::decoded, ShortenContext::gb, get_sr_golomb_shorten(), ShortenContext::lpcqoffset, and LPCQUANT.

| static int decode_wave_header | ( | AVCodecContext * | avctx, | |
| uint8_t * | header, | |||
| int | header_size | |||
| ) | [static] |
Definition at line 174 of file shorten.c.
References av_log(), AV_LOG_ERROR, AV_LOG_INFO, AVCodecContext::bit_rate, AVCodecContext::bits_per_sample, AVCodecContext::block_align, AVCodecContext::channels, get_le16(), get_le32(), init_get_bits(), AVCodecContext::sample_rate, skip_bits(), and WAVE_FORMAT_PCM.
Referenced by shorten_decode_frame().

| static void fix_bitshift | ( | ShortenContext * | s, | |
| int32_t * | buffer | |||
| ) | [static] |
Definition at line 132 of file shorten.c.
References ShortenContext::bitshift, ShortenContext::blocksize, and ShortenContext::nwrap.
Referenced by shorten_decode_frame().
| static short get_le16 | ( | GetBitContext * | gb | ) | [inline, static] |
Definition at line 169 of file shorten.c.
References bswap_16(), and get_bits_long().
Referenced by decode_wave_header().

| static int get_le32 | ( | GetBitContext * | gb | ) | [inline, static] |
Definition at line 164 of file shorten.c.
References bswap_32(), and get_bits_long().
Referenced by decode_wave_header().

| static unsigned int get_uint | ( | ShortenContext * | s, | |
| int | k | |||
| ) | [inline, static] |
Definition at line 124 of file shorten.c.
References ShortenContext::gb, get_ur_golomb_shorten(), ULONGSIZE, and ShortenContext::version.
Referenced by shorten_decode_frame().

| static void init_offset | ( | ShortenContext * | s | ) | [static] |
Definition at line 142 of file shorten.c.
References av_log(), AV_LOG_ERROR, ShortenContext::avctx, ShortenContext::channels, ShortenContext::internal_ftype, ShortenContext::nmean, ShortenContext::offset, TYPE_S16HL, and TYPE_S16LH.
Referenced by shorten_decode_frame().

| static int16_t* interleave_buffer | ( | int16_t * | samples, | |
| int | nchan, | |||
| int | blocksize, | |||
| int32_t ** | buffer | |||
| ) | [static] |
| static int shorten_decode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 490 of file shorten.c.
References av_freep(), ShortenContext::bitstream, ShortenContext::channels, ShortenContext::decoded, ShortenContext::nwrap, ShortenContext::offset, AVCodecContext::priv_data, and s.

| static int shorten_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 258 of file shorten.c.
References allocate_buffers(), ShortenContext::allocated_bitstream_size, av_fast_realloc(), av_log(), AV_LOG_ERROR, ShortenContext::avctx, ShortenContext::bitindex, ShortenContext::bitshift, BITSHIFTSIZE, ShortenContext::bitstream, ShortenContext::bitstream_index, ShortenContext::bitstream_size, ShortenContext::blocksize, bswap_32(), CANONICAL_HEADER_SIZE, ShortenContext::channels, CHANSIZE, ShortenContext::cur_chan, decode_subframe_lpc(), decode_wave_header(), ShortenContext::decoded, DEFAULT_BLOCK_SIZE, ENERGYSIZE, fix_bitshift(), FN_BITSHIFT, FN_BLOCKSIZE, FN_DIFF0, FN_DIFF1, FN_DIFF2, FN_DIFF3, FN_QLPC, FN_QUIT, FN_VERBATIM, FN_ZERO, FNSIZE, ShortenContext::gb, get_bits(), get_bits_count(), get_bits_long(), get_sr_golomb_shorten(), get_uint(), get_ur_golomb_shorten(), ShortenContext::header, ShortenContext::header_size, init_get_bits(), init_offset(), interleave_buffer(), ShortenContext::internal_ftype, ShortenContext::lpcqoffset, LPCQSIZE, MAX_CHANNELS, ShortenContext::max_framesize, memcpy, ShortenContext::nmean, NSKIPSIZE, NWRAP, ShortenContext::nwrap, ShortenContext::offset, OUT_BUFFER_SIZE, AVCodecContext::priv_data, s, samples, skip_bits(), TYPESIZE, V2LPCQOFFSET, VERBATIM_BYTE_SIZE, VERBATIM_CKSIZE_SIZE, and ShortenContext::version.

| static int shorten_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 101 of file shorten.c.
References ShortenContext::avctx, AVCodecContext::priv_data, and s.
| static void shorten_flush | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 504 of file shorten.c.
References ShortenContext::bitstream_index, ShortenContext::bitstream_size, AVCodecContext::priv_data, and s.
Initial value:
{
"shorten",
CODEC_TYPE_AUDIO,
CODEC_ID_SHORTEN,
sizeof(ShortenContext),
shorten_decode_init,
NULL,
shorten_decode_close,
shorten_decode_frame,
.flush= shorten_flush,
}
Definition at line 511 of file shorten.c.
Referenced by avcodec_register_all().
1.5.5