Vorbis I decoder. More...
#include <inttypes.h>#include <math.h>#include "avcodec.h"#include "get_bits.h"#include "dsputil.h"#include "fft.h"#include "fmtconvert.h"#include "vorbis.h"#include "xiph.h"#include <assert.h>Go to the source code of this file.
Data Structures | |
| struct | vorbis_codebook |
| struct | vorbis_floor |
| union | vorbis_floor::vorbis_floor_u |
| struct | vorbis_floor::vorbis_floor_u::vorbis_floor0_s |
| struct | vorbis_floor::vorbis_floor_u::vorbis_floor1_s |
| struct | vorbis_residue |
| struct | vorbis_mapping |
| struct | vorbis_mode |
| struct | vorbis_context_s |
Defines | |
| #define | BITSTREAM_READER_LE |
| #define | V_NB_BITS 8 |
| #define | V_NB_BITS2 11 |
| #define | V_MAX_VLCS (1 << 16) |
| #define | V_MAX_PARTITIONS (1 << 20) |
| #define | BARK(x) (13.1f * atan(0.00074f * (x)) + 2.24f * atan(1.85e-8f * (x) * (x)) + 1e-4f * (x)) |
| #define | VALIDATE_INDEX(idx, limit) |
| #define | GET_VALIDATED_INDEX(idx, bits, limit) |
Typedefs | |
| typedef union vorbis_floor_u | vorbis_floor_data |
| typedef struct vorbis_floor0_s | vorbis_floor0 |
| typedef struct vorbis_floor1_s | vorbis_floor1 |
| typedef int(* | vorbis_floor_decode_func )(struct vorbis_context_s *, vorbis_floor_data *, float *) |
| typedef struct vorbis_context_s | vorbis_context |
Functions | |
| static float | vorbisfloat2float (unsigned val) |
| 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_floor0_decode (vorbis_context *vc, vorbis_floor_data *vfu, float *vec) |
| static void | create_map (vorbis_context *vc, unsigned floor_number) |
| static int | vorbis_floor1_decode (vorbis_context *vc, vorbis_floor_data *vfu, float *vec) |
| 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 av_cold int | vorbis_decode_init (AVCodecContext *avccontext) |
| static av_always_inline int | vorbis_residue_decode_internal (vorbis_context *vc, vorbis_residue *vr, unsigned ch, uint8_t *do_not_decode, float *vec, unsigned vlen, unsigned ch_left, int vr_type) |
| static int | vorbis_residue_decode (vorbis_context *vc, vorbis_residue *vr, unsigned ch, uint8_t *do_not_decode, float *vec, unsigned vlen, unsigned ch_left) |
| void | vorbis_inverse_coupling (float *mag, float *ang, int blocksize) |
| static int | vorbis_parse_audio_packet (vorbis_context *vc) |
| static int | vorbis_decode_frame (AVCodecContext *avccontext, void *data, int *got_frame_ptr, AVPacket *avpkt) |
| static av_cold int | vorbis_decode_close (AVCodecContext *avccontext) |
Variables | |
| static const char | idx_err_str [] = "Index value %d out of range (0 - %d) for %s at %s:%i\n" |
| AVCodec | ff_vorbis_decoder |
Vorbis I decoder.
Definition in file vorbisdec.c.
| #define BARK | ( | x | ) | (13.1f * atan(0.00074f * (x)) + 2.24f * atan(1.85e-8f * (x) * (x)) + 1e-4f * (x)) |
Definition at line 159 of file vorbisdec.c.
Referenced by create_map().
| #define BITSTREAM_READER_LE |
Definition at line 28 of file vorbisdec.c.
| #define GET_VALIDATED_INDEX | ( | idx, | ||
| bits, | ||||
| limit | ||||
| ) |
{\
idx = get_bits(gb, bits);\
VALIDATE_INDEX(idx, limit)\
}
Definition at line 170 of file vorbisdec.c.
Referenced by vorbis_parse_audio_packet(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), vorbis_parse_setup_hdr_modes(), and vorbis_parse_setup_hdr_residues().
| #define V_MAX_PARTITIONS (1 << 20) |
Definition at line 41 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr_residues().
| #define V_MAX_VLCS (1 << 16) |
Definition at line 40 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr_codebooks().
| #define V_NB_BITS 8 |
Definition at line 38 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr_codebooks().
| #define V_NB_BITS2 11 |
Definition at line 39 of file vorbisdec.c.
| #define VALIDATE_INDEX | ( | idx, | ||
| limit | ||||
| ) |
if (idx >= limit) {\ av_log(vc->avccontext, AV_LOG_ERROR,\ idx_err_str,\ (int)(idx), (int)(limit - 1), #idx, __FILE__, __LINE__);\ return AVERROR_INVALIDDATA;\ }
Definition at line 163 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr_floors().
| typedef struct vorbis_context_s vorbis_context |
| typedef struct vorbis_floor0_s vorbis_floor0 |
Definition at line 56 of file vorbisdec.c.
| typedef struct vorbis_floor1_s vorbis_floor1 |
Definition at line 57 of file vorbisdec.c.
| typedef union vorbis_floor_u vorbis_floor_data |
Definition at line 55 of file vorbisdec.c.
| typedef int(* vorbis_floor_decode_func)(struct vorbis_context_s *, vorbis_floor_data *, float *) |
Definition at line 61 of file vorbisdec.c.
| static void create_map | ( | vorbis_context * | vc, | |
| unsigned | floor_number | |||
| ) | [static] |
Definition at line 810 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr_floors().
| static av_cold int vorbis_decode_close | ( | AVCodecContext * | avccontext | ) | [static] |
Definition at line 1701 of file vorbisdec.c.
| static int vorbis_decode_frame | ( | AVCodecContext * | avccontext, | |
| void * | data, | |||
| int * | got_frame_ptr, | |||
| AVPacket * | avpkt | |||
| ) | [static] |
Definition at line 1643 of file vorbisdec.c.
| static av_cold int vorbis_decode_init | ( | AVCodecContext * | avccontext | ) | [static] |
Definition at line 979 of file vorbisdec.c.
| static int vorbis_floor0_decode | ( | vorbis_context * | vc, | |
| vorbis_floor_data * | vfu, | |||
| float * | vec | |||
| ) | [static] |
Definition at line 1055 of file vorbisdec.c.
| static int vorbis_floor1_decode | ( | vorbis_context * | vc, | |
| vorbis_floor_data * | vfu, | |||
| float * | vec | |||
| ) | [static] |
Definition at line 1161 of file vorbisdec.c.
| static void vorbis_free | ( | vorbis_context * | vc | ) | [static] |
Definition at line 188 of file vorbisdec.c.
Referenced by vorbis_decode_close(), and vorbis_decode_init().
| void vorbis_inverse_coupling | ( | float * | mag, | |
| float * | ang, | |||
| int | blocksize | |||
| ) |
Definition at line 1459 of file vorbisdec.c.
| static int vorbis_parse_audio_packet | ( | vorbis_context * | vc | ) | [static] |
Definition at line 1485 of file vorbisdec.c.
Referenced by vorbis_decode_frame().
| static int vorbis_parse_id_hdr | ( | vorbis_context * | vc | ) | [static] |
Definition at line 914 of file vorbisdec.c.
Referenced by vorbis_decode_init().
| static int vorbis_parse_setup_hdr | ( | vorbis_context * | vc | ) | [static] |
Definition at line 868 of file vorbisdec.c.
Referenced by vorbis_decode_init().
| static int vorbis_parse_setup_hdr_codebooks | ( | vorbis_context * | vc | ) | [static] |
Definition at line 234 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr().
| static int vorbis_parse_setup_hdr_floors | ( | vorbis_context * | vc | ) | [static] |
Definition at line 483 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr().
| static int vorbis_parse_setup_hdr_mappings | ( | vorbis_context * | vc | ) | [static] |
Definition at line 743 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr().
| static int vorbis_parse_setup_hdr_modes | ( | vorbis_context * | vc | ) | [static] |
Definition at line 841 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr().
| static int vorbis_parse_setup_hdr_residues | ( | vorbis_context * | vc | ) | [static] |
Definition at line 663 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr().
| static int vorbis_parse_setup_hdr_tdtransforms | ( | vorbis_context * | vc | ) | [static] |
Definition at line 457 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr().
| static int vorbis_residue_decode | ( | vorbis_context * | vc, | |
| vorbis_residue * | vr, | |||
| unsigned | ch, | |||
| uint8_t * | do_not_decode, | |||
| float * | vec, | |||
| unsigned | vlen, | |||
| unsigned | ch_left | |||
| ) | [inline, static] |
Definition at line 1441 of file vorbisdec.c.
Referenced by vorbis_parse_audio_packet().
| static av_always_inline int vorbis_residue_decode_internal | ( | vorbis_context * | vc, | |
| vorbis_residue * | vr, | |||
| unsigned | ch, | |||
| uint8_t * | do_not_decode, | |||
| float * | vec, | |||
| unsigned | vlen, | |||
| unsigned | ch_left, | |||
| int | vr_type | |||
| ) | [static] |
Definition at line 1287 of file vorbisdec.c.
Referenced by vorbis_residue_decode().
| static float vorbisfloat2float | ( | unsigned | val | ) | [static] |
Definition at line 176 of file vorbisdec.c.
Referenced by vorbis_parse_setup_hdr_codebooks().
{
.name = "vorbis",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_VORBIS,
.priv_data_size = sizeof(vorbis_context),
.init = vorbis_decode_init,
.close = vorbis_decode_close,
.decode = vorbis_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
.channel_layouts = ff_vorbis_channel_layouts,
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
}
Definition at line 1710 of file vorbisdec.c.
const char idx_err_str[] = "Index value %d out of range (0 - %d) for %s at %s:%i\n" [static] |
Definition at line 162 of file vorbisdec.c.