|
FFmpeg
|
MPEG Audio decoder. More...
#include <math.h>#include "config_components.h"#include "libavutil/attributes.h"#include "libavutil/avassert.h"#include "libavutil/channel_layout.h"#include "libavutil/crc.h"#include "libavutil/float_dsp.h"#include "libavutil/mem.h"#include "libavutil/mem_internal.h"#include "libavutil/thread.h"#include "avcodec.h"#include "decode.h"#include "get_bits.h"#include "mathops.h"#include "mpegaudiodsp.h"#include "mpegaudio.h"#include "mpegaudiodecheader.h"#include "mpegaudiodata.h"#include "mpegaudio_tablegen.h"Go to the source code of this file.
Data Structures | |
| struct | GranuleDef |
| struct | MPADecodeContext |
Macros | |
| #define | BACKSTEP_SIZE 512 |
| #define | EXTRABYTES 24 |
| #define | LAST_BUF_SIZE 2 * BACKSTEP_SIZE + EXTRABYTES |
| #define | HEADER_SIZE 4 |
| #define | SCALE_GEN(v) |
| #define | C3 FIXHR(0.86602540378443864676/2) |
| #define | C4 FIXHR(0.70710678118654752439/2) |
| #define | C5 FIXHR(0.51763809020504152469/2) |
| #define | C6 FIXHR(1.93185165257813657349/4) |
| #define | SPLIT(dst, sf, n) |
| #define | READ_FLIP_SIGN(dst, src) |
| #define | ISQRT2 FIXR(0.70710678118654752440) |
| #define | AA(j) |
Functions | |
| static void | region_offset2size (GranuleDef *g) |
| Convert region offsets to region sizes and truncate size to big_values. | |
| static void | init_short_region (MPADecodeContext *s, GranuleDef *g) |
| static void | init_long_region (MPADecodeContext *s, GranuleDef *g, int ra1, int ra2) |
| static void | compute_band_indexes (MPADecodeContext *s, GranuleDef *g) |
| static int | l1_unscale (int n, int mant, int scale_factor) |
| static int | l2_unscale_group (int steps, int mant, int scale_factor) |
| static int | l3_unscale (int value, int exponent) |
| static av_cold void | decode_init_static (void) |
| static av_cold int | decode_ctx_init (AVCodecContext *avctx, MPADecodeContext *s) |
| static av_cold int | decode_init (AVCodecContext *avctx) |
| static void | imdct12 (INTFLOAT *out, SUINTFLOAT *in) |
| static int | handle_crc (MPADecodeContext *s, int sec_len) |
| static int | mp_decode_layer1 (MPADecodeContext *s) |
| static int | mp_decode_layer2 (MPADecodeContext *s) |
| static av_always_inline void | lsf_sf_expand (int *slen, int sf, int n1, int n2, int n3) |
| static void | exponents_from_scale_factors (MPADecodeContext *s, GranuleDef *g, int16_t *exponents) |
| static void | switch_buffer (MPADecodeContext *s, int *pos, int *end_pos, int *end_pos2) |
| static int | huffman_decode (MPADecodeContext *s, GranuleDef *g, int16_t *exponents, int end_pos2) |
| static void | reorder_block (MPADecodeContext *s, GranuleDef *g) |
| static void | compute_stereo (MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1) |
| static void | compute_antialias (MPADecodeContext *s, GranuleDef *g) |
| static void | compute_imdct (MPADecodeContext *s, GranuleDef *g, INTFLOAT *sb_samples, INTFLOAT *mdct_buf) |
| static int | mp_decode_layer3 (MPADecodeContext *s) |
| static int | mp_decode_frame (MPADecodeContext *s, OUT_INT **samples, const uint8_t *buf, int buf_size) |
| static int | seek_preroll (const MPADecodeHeader2 *hdr) |
| Samples a decoder started inside the stream outputs before its output is exact: the synthesis history, then for layer III the IMDCT overlap and the granules whose main data begins before the first frame decoded. | |
| static int | decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) |
| static av_cold void | mp_flush (MPADecodeContext *ctx) |
| static av_cold void | flush (AVCodecContext *avctx) |
Variables | |
| static INTFLOAT | is_table_lsf [2][2][16] |
| static int32_t | scale_factor_mult [15][3] |
| static const int32_t | scale_factor_mult2 [3][3] |
MPEG Audio decoder.
Definition in file mpegaudiodec_template.c.
| #define BACKSTEP_SIZE 512 |
Definition at line 54 of file mpegaudiodec_template.c.
Referenced by mp_decode_frame().
| #define EXTRABYTES 24 |
Definition at line 55 of file mpegaudiodec_template.c.
| #define LAST_BUF_SIZE 2 * BACKSTEP_SIZE + EXTRABYTES |
Definition at line 56 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
| #define HEADER_SIZE 4 |
Definition at line 102 of file mpegaudiodec_template.c.
| #define SCALE_GEN | ( | v | ) |
Definition at line 114 of file mpegaudiodec_template.c.
| #define C3 FIXHR(0.86602540378443864676/2) |
Definition at line 323 of file mpegaudiodec_template.c.
Referenced by idct4col_add(), imdct12(), imdct36(), and lbr_bank_c().
| #define C4 FIXHR(0.70710678118654752439/2) |
Definition at line 324 of file mpegaudiodec_template.c.
Referenced by imdct12(), imdct36(), lbr_bank_c(), and xbr_filter().
| #define C5 FIXHR(0.51763809020504152469/2) |
Definition at line 325 of file mpegaudiodec_template.c.
| #define C6 FIXHR(1.93185165257813657349/4) |
Definition at line 326 of file mpegaudiodec_template.c.
Referenced by imdct12().
| #define SPLIT | ( | dst, | |
| sf, | |||
| n ) |
Definition at line 660 of file mpegaudiodec_template.c.
Referenced by lsf_sf_expand().
| #define ISQRT2 FIXR(0.70710678118654752440) |
Definition at line 942 of file mpegaudiodec_template.c.
Referenced by compute_stereo().
| #define AA | ( | j | ) |
Definition at line 1093 of file mpegaudiodec_template.c.
Referenced by compute_antialias().
|
static |
Convert region offsets to region sizes and truncate size to big_values.
Definition at line 127 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 138 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 156 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 166 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
inlinestatic |
Definition at line 193 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer1(), and mp_decode_layer2().
|
inlinestatic |
Definition at line 207 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer2().
|
inlinestatic |
Definition at line 223 of file mpegaudiodec_template.c.
Referenced by huffman_decode().
|
static |
Definition at line 242 of file mpegaudiodec_template.c.
|
static |
Definition at line 284 of file mpegaudiodec_template.c.
Referenced by decode_init().
|
static |
Definition at line 318 of file mpegaudiodec_template.c.
|
static |
Definition at line 330 of file mpegaudiodec_template.c.
Referenced by compute_imdct().
|
static |
Definition at line 371 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer1(), mp_decode_layer2(), and mp_decode_layer3().
|
static |
Definition at line 398 of file mpegaudiodec_template.c.
Referenced by mp_decode_frame().
|
static |
Definition at line 468 of file mpegaudiodec_template.c.
Referenced by mp_decode_frame().
|
static |
Definition at line 680 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 689 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 726 of file mpegaudiodec_template.c.
Referenced by huffman_decode().
|
static |
Definition at line 757 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 909 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 944 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 1102 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 1133 of file mpegaudiodec_template.c.
Referenced by mp_decode_layer3().
|
static |
Definition at line 1213 of file mpegaudiodec_template.c.
Referenced by mp_decode_frame().
|
static |
Definition at line 1472 of file mpegaudiodec_template.c.
Referenced by decode_frame().
|
static |
Samples a decoder started inside the stream outputs before its output is exact: the synthesis history, then for layer III the IMDCT overlap and the granules whose main data begins before the first frame decoded.
The bit reservoir reach is bounded for the smallest frames this stream format allows, as an encoder may use all of it.
Definition at line 1568 of file mpegaudiodec_template.c.
|
static |
Definition at line 1590 of file mpegaudiodec_template.c.
|
static |
Definition at line 1662 of file mpegaudiodec_template.c.
Referenced by flush().
|
static |
Definition at line 1670 of file mpegaudiodec_template.c.
|
static |
Definition at line 108 of file mpegaudiodec_template.c.
Referenced by compute_stereo(), and decode_init_static().
|
static |
Definition at line 111 of file mpegaudiodec_template.c.
Referenced by decode_init_static(), and l1_unscale().
|
static |
Definition at line 117 of file mpegaudiodec_template.c.
Referenced by l2_unscale_group().