#include <math.h>#include "avcodec.h"#include "bitstream.h"#include "dsputil.h"#include "vorbis.h"#include <assert.h>

Go to the source code of this file.
Defines | |
| #define | ALT_BITSTREAM_READER_LE |
| #define | V_NB_BITS 8 |
| #define | V_NB_BITS2 11 |
| #define | V_MAX_VLCS (1<<16) |
| #define | AV_DEBUG(...) |
| #define | ilog(i) av_log2(2*(i)) |
| #define | BIAS 385 |
Functions | |
| unsigned int | get_bits_long_le (GetBitContext *s, int n) |
| static unsigned int | nth_root (unsigned int x, unsigned int n) |
| static float | vorbisfloat2float (uint_fast32_t val) |
| static int | vorbis_len2vlc (vorbis_context *vc, uint_fast8_t *bits, uint_fast32_t *codes, uint_fast32_t num) |
| static void | vorbis_free (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr_codebooks (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr_tdtransforms (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr_floors (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr_residues (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr_mappings (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr_modes (vorbis_context *vc) |
| static int | vorbis_parse_setup_hdr (vorbis_context *vc) |
| static int | vorbis_parse_id_hdr (vorbis_context *vc) |
| static int | vorbis_decode_init (AVCodecContext *avccontext) |
| static uint_fast8_t | vorbis_floor1_decode (vorbis_context *vc, vorbis_floor *vf, float *vec) |
| static int | vorbis_residue_decode (vorbis_context *vc, vorbis_residue *vr, uint_fast8_t ch, uint_fast8_t *do_not_decode, float *vec, uint_fast16_t vlen) |
| static int | vorbis_parse_audio_packet (vorbis_context *vc) |
| static int | vorbis_decode_frame (AVCodecContext *avccontext, void *data, int *data_size, uint8_t *buf, int buf_size) |
| static int | vorbis_decode_close (AVCodecContext *avccontext) |
Variables | |
| AVCodec | vorbis_decoder |
| #define AV_DEBUG | ( | ... | ) |
Definition at line 38 of file vorbis.c.
Referenced by vorbis_decode_frame(), vorbis_floor1_decode(), vorbis_parse_audio_packet(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), vorbis_parse_setup_hdr_modes(), vorbis_parse_setup_hdr_residues(), vorbis_parse_setup_hdr_tdtransforms(), and vorbis_residue_decode().
| #define ilog | ( | i | ) | av_log2(2*(i)) |
Definition at line 57 of file vorbis.c.
Referenced by vorbis_floor1_decode(), vorbis_parse_audio_packet(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_mappings(), and vorbis_parse_setup_hdr_residues().
| #define V_MAX_VLCS (1<<16) |
| #define V_NB_BITS 8 |
| #define V_NB_BITS2 11 |
| unsigned int get_bits_long_le | ( | GetBitContext * | s, | |
| int | n | |||
| ) |
reads 0-32 bits when using the ALT_BITSTREAM_READER_LE bitstream reader
Definition at line 49 of file vorbis.c.
References get_bits().
Referenced by vorbis_parse_id_hdr(), and vorbis_parse_setup_hdr_codebooks().

| static unsigned int nth_root | ( | unsigned int | x, | |
| unsigned int | n | |||
| ) | [static] |
| static int vorbis_decode_close | ( | AVCodecContext * | avccontext | ) | [static] |
Definition at line 1453 of file vorbis.c.
References AVCodecContext::priv_data, and vorbis_free().

| static int vorbis_decode_frame | ( | AVCodecContext * | avccontext, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 1404 of file vorbis.c.
References AV_DEBUG, vorbis_context::first_frame, vorbis_context::gb, get_bits_count(), init_get_bits(), AVCodecContext::priv_data, vorbis_context::ret, and vorbis_parse_audio_packet().

| static int vorbis_decode_init | ( | AVCodecContext * | avccontext | ) | [static] |
Definition at line 784 of file vorbis.c.
References vorbis_context::audio_channels, vorbis_context::audio_samplerate, av_log(), AV_LOG_ERROR, vorbis_context::avccontext, AVCodecContext::channels, AVCodecContext::extradata, AVCodecContext::extradata_size, vorbis_context::gb, get_bits(), init_get_bits(), AVCodecContext::priv_data, AVCodecContext::sample_rate, vorbis_free(), vorbis_parse_id_hdr(), and vorbis_parse_setup_hdr().

| static uint_fast8_t vorbis_floor1_decode | ( | vorbis_context * | vc, | |
| vorbis_floor * | vf, | |||
| float * | vec | |||
| ) | [static] |
Definition at line 864 of file vorbis.c.
References ABS, AV_DEBUG, vorbis_floor::class_dimensions, vorbis_floor::class_masterbook, vorbis_floor::class_subclasses, vorbis_context::codebooks, floor1_inverse_db_table, vorbis_context::gb, get_bits(), get_bits1(), get_bits_count(), get_vlc2(), vorbis_floor::high_neighbour, ilog, vorbis_floor::low_neighbour, vorbis_floor::multiplier, vorbis_codebook::nb_bits, offset, vorbis_floor::partition_class, vorbis_floor::partitions, vorbis_floor::subclass_books, VLC::table, vorbis_codebook::vlc, vorbis_floor::x_list, vorbis_floor::x_list_dim, and vorbis_floor::x_list_order.
Referenced by vorbis_parse_audio_packet().

| static void vorbis_free | ( | vorbis_context * | vc | ) | [static] |
Definition at line 146 of file vorbis.c.
References vorbis_mapping::angle, av_free(), av_freep(), vorbis_context::buf, vorbis_context::buf_tmp, vorbis_context::channel_floors, vorbis_context::channel_residues, vorbis_context::codebook_count, vorbis_context::codebooks, vorbis_codebook::codevectors, ff_mdct_end(), vorbis_context::floor_count, vorbis_context::floors, free_vlc(), vorbis_floor::high_neighbour, vorbis_floor::low_neighbour, vorbis_mapping::magnitude, vorbis_context::mapping_count, vorbis_context::mappings, vorbis_context::mdct0, vorbis_context::mdct1, vorbis_context::modes, vorbis_mapping::mux, vorbis_context::residues, vorbis_context::ret, vorbis_context::saved, vorbis_codebook::vlc, vorbis_floor::x_list, and vorbis_floor::x_list_order.
Referenced by vorbis_decode_close(), and vorbis_decode_init().

| static int vorbis_len2vlc | ( | vorbis_context * | vc, | |
| uint_fast8_t * | bits, | |||
| uint_fast32_t * | codes, | |||
| uint_fast32_t | num | |||
| ) | [static] |
Definition at line 80 of file vorbis.c.
References av_log(), AV_LOG_INFO, vorbis_context::avccontext, get_bits1(), and init_get_bits().
Referenced by vorbis_parse_setup_hdr_codebooks().

| static int vorbis_parse_audio_packet | ( | vorbis_context * | vc | ) | [static] |
Definition at line 1197 of file vorbis.c.
References vorbis_mapping::angle, audio_channels, vorbis_context::audio_channels, AV_DEBUG, av_log(), AV_LOG_ERROR, vorbis_context::avccontext, BIAS, vorbis_mode::blockflag, vorbis_context::blocksize_0, vorbis_context::blocksize_1, vorbis_context::buf, buf, vorbis_context::buf_tmp, vorbis_context::channel_floors, vorbis_context::channel_residues, vorbis_mapping::coupling_steps, ff_imdct_calc(), vorbis_context::floors, vorbis_context::gb, get_bits(), get_bits1(), ilog, vorbis_context::lwin, vorbis_mapping::magnitude, vorbis_mode::mapping, vorbis_context::mappings, vorbis_context::mdct0, vorbis_context::mdct1, vorbis_context::mode_count, vorbis_context::modes, vorbis_mapping::mux, vorbis_context::residues, vorbis_context::ret, vorbis_context::saved, vorbis_context::saved_start, step, vorbis_mapping::submap_floor, vorbis_mapping::submap_residue, vorbis_mapping::submaps, vorbis_context::swin, vorbis_floor1_decode(), and vorbis_residue_decode().
Referenced by vorbis_decode_frame().

| static int vorbis_parse_id_hdr | ( | vorbis_context * | vc | ) | [static] |
Definition at line 724 of file vorbis.c.
References vorbis_context::audio_channels, vorbis_context::audio_samplerate, AV_DEBUG, av_log(), AV_LOG_ERROR, av_malloc(), vorbis_context::avccontext, vorbis_context::bitrate_maximum, vorbis_context::bitrate_minimum, vorbis_context::bitrate_nominal, vorbis_context::blocksize_0, vorbis_context::blocksize_1, vorbis_context::buf, vorbis_context::buf_tmp, vorbis_context::channel_floors, vorbis_context::channel_residues, ff_mdct_init(), vorbis_context::gb, get_bits(), get_bits1(), get_bits_long_le(), vorbis_context::lwin, vorbis_context::mdct0, vorbis_context::mdct1, vorbis_context::ret, vorbis_context::saved, vorbis_context::saved_start, vorbis_context::swin, vorbis_context::version, vwin1024, vwin128, vwin2048, vwin256, vwin4096, vwin512, vwin64, and vwin8192.
Referenced by vorbis_decode_init().

| static int vorbis_parse_setup_hdr | ( | vorbis_context * | vc | ) | [static] |
Definition at line 680 of file vorbis.c.
References av_log(), AV_LOG_ERROR, vorbis_context::avccontext, vorbis_context::gb, get_bits(), get_bits1(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), vorbis_parse_setup_hdr_modes(), vorbis_parse_setup_hdr_residues(), and vorbis_parse_setup_hdr_tdtransforms().
Referenced by vorbis_decode_init().

| static int vorbis_parse_setup_hdr_codebooks | ( | vorbis_context * | vc | ) | [static] |
Definition at line 188 of file vorbis.c.
References AV_DEBUG, av_free(), av_log(), AV_LOG_ERROR, AV_LOG_INFO, av_mallocz(), vorbis_context::avccontext, cb, vorbis_context::codebook_count, vorbis_context::codebooks, vorbis_codebook::codevectors, vorbis_codebook::dimensions, error(), vorbis_context::gb, get_bits(), get_bits1(), get_bits_long_le(), ilog, init_vlc(), INIT_VLC_LE, vorbis_codebook::lookup_type, vorbis_codebook::maxdepth, vorbis_codebook::nb_bits, nth_root(), t, V_MAX_VLCS, V_NB_BITS, V_NB_BITS2, vorbis_codebook::vlc, vorbis_len2vlc(), and vorbisfloat2float().
Referenced by vorbis_parse_setup_hdr().

| static int vorbis_parse_setup_hdr_floors | ( | vorbis_context * | vc | ) | [static] |
Definition at line 409 of file vorbis.c.
References AV_DEBUG, av_log(), AV_LOG_ERROR, av_mallocz(), vorbis_context::avccontext, vorbis_floor::class_dimensions, vorbis_floor::class_masterbook, vorbis_floor::class_subclasses, vorbis_context::floor_count, vorbis_floor::floor_type, vorbis_context::floors, vorbis_context::gb, get_bits(), vorbis_floor::high_neighbour, vorbis_floor::low_neighbour, vorbis_floor::maximum_class, vorbis_floor::multiplier, vorbis_floor::partition_class, vorbis_floor::partitions, vorbis_floor::subclass_books, vorbis_floor::x_list, vorbis_floor::x_list_dim, and vorbis_floor::x_list_order.
Referenced by vorbis_parse_setup_hdr().

| static int vorbis_parse_setup_hdr_mappings | ( | vorbis_context * | vc | ) | [static] |
Definition at line 594 of file vorbis.c.
References vorbis_mapping::angle, vorbis_context::audio_channels, AV_DEBUG, av_log(), AV_LOG_ERROR, av_mallocz(), vorbis_context::avccontext, vorbis_mapping::coupling_steps, vorbis_context::gb, get_bits(), get_bits1(), ilog, vorbis_mapping::magnitude, vorbis_context::mapping_count, vorbis_context::mappings, vorbis_mapping::mux, vorbis_mapping::submap_floor, vorbis_mapping::submap_residue, and vorbis_mapping::submaps.
Referenced by vorbis_parse_setup_hdr().

| static int vorbis_parse_setup_hdr_modes | ( | vorbis_context * | vc | ) | [static] |
Definition at line 656 of file vorbis.c.
References AV_DEBUG, av_mallocz(), vorbis_mode::blockflag, vorbis_context::gb, get_bits(), vorbis_mode::mapping, vorbis_context::mode_count, vorbis_context::modes, vorbis_mode::transformtype, and vorbis_mode::windowtype.
Referenced by vorbis_parse_setup_hdr().

| static int vorbis_parse_setup_hdr_residues | ( | vorbis_context * | vc | ) | [static] |
Definition at line 533 of file vorbis.c.
References AV_DEBUG, av_mallocz(), vorbis_residue::begin, vorbis_residue::books, vorbis_residue::classbook, vorbis_residue::classifications, vorbis_residue::end, vorbis_context::gb, get_bits(), get_bits1(), ilog, vorbis_residue::maxpass, vorbis_residue::partition_size, vorbis_context::residue_count, vorbis_context::residues, and vorbis_residue::type.
Referenced by vorbis_parse_setup_hdr().

| static int vorbis_parse_setup_hdr_tdtransforms | ( | vorbis_context * | vc | ) | [static] |
Definition at line 389 of file vorbis.c.
References AV_DEBUG, av_log(), AV_LOG_ERROR, vorbis_context::avccontext, vorbis_context::gb, and get_bits().
Referenced by vorbis_parse_setup_hdr().

| static int vorbis_residue_decode | ( | vorbis_context * | vc, | |
| vorbis_residue * | vr, | |||
| uint_fast8_t | ch, | |||
| uint_fast8_t * | do_not_decode, | |||
| float * | vec, | |||
| uint_fast16_t | vlen | |||
| ) | [static] |
Definition at line 1069 of file vorbis.c.
References vorbis_context::audio_channels, AV_DEBUG, av_log(), AV_LOG_ERROR, vorbis_context::avccontext, vorbis_residue::begin, vorbis_residue::books, vorbis_residue::classbook, vorbis_residue::classifications, vorbis_context::codebooks, vorbis_codebook::codevectors, vorbis_codebook::dimensions, vorbis_residue::end, vorbis_context::gb, get_vlc2(), inverse, vorbis_residue::maxpass, vorbis_codebook::nb_bits, vorbis_residue::partition_size, step, VLC::table, vorbis_residue::type, and vorbis_codebook::vlc.
Referenced by vorbis_parse_audio_packet().

| static float vorbisfloat2float | ( | uint_fast32_t | val | ) | [static] |
Initial value:
{
"vorbis",
CODEC_TYPE_AUDIO,
CODEC_ID_VORBIS,
sizeof(vorbis_context),
vorbis_decode_init,
NULL,
vorbis_decode_close,
vorbis_decode_frame,
}
Definition at line 1461 of file vorbis.c.
Referenced by avcodec_register_all().
1.5.5