#include "avcodec.h"#include "bitstream.h"#include "mpegaudio.h"#include "mpegaudiotab.h"

Go to the source code of this file.
Data Structures | |
| struct | MpegAudioContext |
Defines | |
| #define | FRAC_BITS 15 |
| #define | WFRAC_BITS 14 |
| #define | MUL(a, b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) |
| #define | FIX(a) ((int)((a) * (1 << FRAC_BITS))) |
| #define | SAMPLES_BUF_SIZE 4096 |
| #define | P 15 |
| #define | WSHIFT (WFRAC_BITS + 15 - FRAC_BITS) |
| #define | SB_NOTALLOCATED 0 |
| #define | SB_ALLOCATED 1 |
| #define | SB_NOMORE 2 |
Functions | |
| static int | MPA_encode_init (AVCodecContext *avctx) |
| static void | idct32 (int *out, int *tab) |
| static void | filter (MpegAudioContext *s, int ch, short *samples, int incr) |
| static void | compute_scale_factors (unsigned char scale_code[SBLIMIT], unsigned char scale_factors[SBLIMIT][3], int sb_samples[3][12][SBLIMIT], int sblimit) |
| static void | psycho_acoustic_model (MpegAudioContext *s, short smr[SBLIMIT]) |
| static void | compute_bit_allocation (MpegAudioContext *s, short smr1[MPA_MAX_CHANNELS][SBLIMIT], unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], int *padding) |
| static void | encode_frame (MpegAudioContext *s, unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], int padding) |
| static int | MPA_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) |
| static int | MPA_encode_close (AVCodecContext *avctx) |
Definition in file mpegaudio.c.
Definition at line 34 of file mpegaudio.c.
| #define FRAC_BITS 15 |
Definition at line 31 of file mpegaudio.c.
Referenced by add_yblock(), add_yblock_buffered(), decode_frame(), decode_init(), encode_frame(), predict_slice(), and predict_slice_buffered().
Definition at line 33 of file mpegaudio.c.
| #define P 15 |
| #define SAMPLES_BUF_SIZE 4096 |
| #define SB_ALLOCATED 1 |
| #define SB_NOMORE 2 |
| #define SB_NOTALLOCATED 0 |
| #define WFRAC_BITS 14 |
Definition at line 32 of file mpegaudio.c.
Referenced by ff_mpa_synth_init(), and MPA_encode_init().
| #define WSHIFT (WFRAC_BITS + 15 - FRAC_BITS) |
| static void compute_bit_allocation | ( | MpegAudioContext * | s, | |
| short | smr1[MPA_MAX_CHANNELS][SBLIMIT], | |||
| unsigned char | bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], | |||
| int * | padding | |||
| ) | [static] |
Definition at line 503 of file mpegaudio.c.
References MpegAudioContext::alloc_table, b, bit_alloc(), MpegAudioContext::do_padding, MpegAudioContext::frame_frac, MpegAudioContext::frame_frac_incr, MpegAudioContext::frame_size, memcpy, MPA_MAX_CHANNELS, MpegAudioContext::nb_channels, nb_scale_factors, quant_snr, SB_ALLOCATED, SB_NOMORE, SB_NOTALLOCATED, MpegAudioContext::sblimit, MpegAudioContext::scale_code, and total_quant_bits.

| static void compute_scale_factors | ( | unsigned char | scale_code[SBLIMIT], | |
| unsigned char | scale_factors[SBLIMIT][3], | |||
| int | sb_samples[3][12][SBLIMIT], | |||
| int | sblimit | |||
| ) | [static] |
Definition at line 367 of file mpegaudio.c.
References scale_diff_table, and scale_factor_table.
Referenced by MPA_encode_frame().
| static void encode_frame | ( | MpegAudioContext * | s, | |
| unsigned char | bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], | |||
| int | padding | |||
| ) | [static] |
Definition at line 608 of file mpegaudio.c.
References a, MpegAudioContext::alloc_table, b, bit_alloc(), MpegAudioContext::bitrate_index, bits, MpegAudioContext::do_padding, e, flush_put_bits(), MpegAudioContext::freq_index, MpegAudioContext::lsf, MPA_MONO, MPA_STEREO, mult(), MpegAudioContext::nb_channels, P, MpegAudioContext::pb, put_bits(), quant_bits, quant_steps, MpegAudioContext::sb_samples, MpegAudioContext::sblimit, MpegAudioContext::scale_code, scale_factor_mult, scale_factor_shift, MpegAudioContext::scale_factors, shift(), and steps.

| static void filter | ( | MpegAudioContext * | s, | |
| int | ch, | |||
| short * | samples, | |||
| int | incr | |||
| ) | [static] |
Definition at line 310 of file mpegaudio.c.
References filter_bank, idct32(), offset, MpegAudioContext::samples_buf, SAMPLES_BUF_SIZE, MpegAudioContext::samples_offset, MpegAudioContext::sb_samples, and WSHIFT.
Referenced by av_resample(), create_ana_filter(), h_resample_fast(), MPA_encode_frame(), and xa_decode().

| static void idct32 | ( | int * | out, | |
| int * | tab | |||
| ) | [static] |
| static int MPA_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 782 of file mpegaudio.c.
References av_freep(), and AVCodecContext::coded_frame.

| static int MPA_encode_frame | ( | AVCodecContext * | avctx, | |
| unsigned char * | frame, | |||
| int | buf_size, | |||
| void * | data | |||
| ) | [static] |
Definition at line 752 of file mpegaudio.c.
References bit_alloc(), PutBitContext::buf, compute_bit_allocation(), compute_scale_factors(), encode_frame(), filter(), init_put_bits(), MPA_FRAME_SIZE, MPA_MAX_CHANNELS, MPA_MAX_CODED_FRAME_SIZE, MpegAudioContext::nb_channels, MpegAudioContext::nb_samples, MpegAudioContext::pb, pbBufPtr(), AVCodecContext::priv_data, psycho_acoustic_model(), s, samples, MpegAudioContext::sb_samples, MpegAudioContext::sblimit, SBLIMIT, MpegAudioContext::scale_code, and MpegAudioContext::scale_factors.

| static int MPA_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 64 of file mpegaudio.c.
References a, MpegAudioContext::alloc_table, alloc_tables, av_log(), AV_LOG_DEBUG, AV_LOG_ERROR, avcodec_alloc_frame(), MpegAudioContext::bit_rate, AVCodecContext::bit_rate, bitrate, MpegAudioContext::bitrate_index, AVCodecContext::channels, AVCodecContext::coded_frame, filter_bank, MpegAudioContext::frame_frac, MpegAudioContext::frame_frac_incr, MpegAudioContext::frame_size, AVCodecContext::frame_size, MpegAudioContext::freq, MpegAudioContext::freq_index, l2_select_table(), MpegAudioContext::lsf, mpa_bitrate_tab, mpa_enwindow, MPA_FRAME_SIZE, mpa_freq_tab, MpegAudioContext::nb_channels, P, AVCodecContext::priv_data, quant_bits, s, AVCodecContext::sample_rate, MpegAudioContext::samples_offset, MpegAudioContext::sblimit, sblimit_table, scale_diff_table, scale_factor_mult, scale_factor_shift, scale_factor_table, total_quant_bits, and WFRAC_BITS.

| static void psycho_acoustic_model | ( | MpegAudioContext * | s, | |
| short | smr[SBLIMIT] | |||
| ) | [static] |
Definition at line 486 of file mpegaudio.c.
References fixed_smr, and MpegAudioContext::sblimit.
Referenced by MPA_encode_frame().
1.5.5