#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "internal.h"
#include "put_bits.h"
#include "mpegaudio.h"
#include "mpegaudiodsp.h"
#include "mpegaudiodata.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 | SAMPLES_BUF_SIZE 4096 |
#define | USE_FLOATS |
#define | WSHIFT (WFRAC_BITS + 15 - FRAC_BITS) |
#define | SB_NOTALLOCATED 0 |
#define | SB_ALLOCATED 1 |
#define | SB_NOMORE 2 |
Functions | |
static av_cold int | MPA_encode_init (AVCodecContext *avctx) |
static void | idct32 (int *out, int *tab) |
static void | filter (MpegAudioContext *s, int ch, const 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, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) |
static av_cold int | MPA_encode_close (AVCodecContext *avctx) |
Variables | |
static const AVCodecDefault | mp2_defaults [] |
AVCodec | ff_mp2_encoder |
Definition in file mpegaudioenc.c.
#define FRAC_BITS 15 |
Definition at line 33 of file mpegaudioenc.c.
#define MUL | ( | a, | |||
b | ) | (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) |
#define SAMPLES_BUF_SIZE 4096 |
#define SB_ALLOCATED 1 |
#define SB_NOMORE 2 |
#define SB_NOTALLOCATED 0 |
#define USE_FLOATS |
Definition at line 65 of file mpegaudioenc.c.
#define WFRAC_BITS 14 |
Definition at line 34 of file mpegaudioenc.c.
#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] |
static void encode_frame | ( | MpegAudioContext * | s, | |
unsigned char | bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], | |||
int | padding | |||
) | [static] |
Definition at line 599 of file mpegaudioenc.c.
static void filter | ( | MpegAudioContext * | s, | |
int | ch, | |||
const short * | samples, | |||
int | incr | |||
) | [static] |
Definition at line 318 of file mpegaudioenc.c.
Referenced by av_resample(), avfilter_graph_dump_to_buf(), avfilter_graph_parse2(), avfilter_graph_queue_command(), avfilter_graph_send_command(), configure_input_audio_filter(), configure_input_video_filter(), configure_output_video_filter(), end_frame(), initFilter(), libAVEnumPins_Cleanup(), libAVEnumPins_Clone(), libAVPin_Disconnect(), libAVPin_QueryPinInfo(), libAVPin_ReceiveConnection(), main(), make_filters_from_proto(), MPA_encode_frame(), mpegts_open_pes_filter(), mpegts_open_section_filter(), pick_formats(), ps_hybrid_analysis_c(), put_image(), query_formats(), resample_one(), return_frame(), set_filter(), show_filters(), swri_resample_TMPL(), truespeech_apply_twopoint_filter(), tta_decode_frame(), xa_decode(), and yuv2yuvX_TMPL().
static av_cold int MPA_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 772 of file mpegaudioenc.c.
static int MPA_encode_frame | ( | AVCodecContext * | avctx, | |
AVPacket * | avpkt, | |||
const AVFrame * | frame, | |||
int * | got_packet_ptr | |||
) | [static] |
Definition at line 735 of file mpegaudioenc.c.
static av_cold int MPA_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 70 of file mpegaudioenc.c.
static void psycho_acoustic_model | ( | MpegAudioContext * | s, | |
short | smr[SBLIMIT] | |||
) | [static] |
Initial value:
{ .name = "mp2", .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, .encode2 = MPA_encode_frame, .close = MPA_encode_close, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), .defaults = mp2_defaults, }
Definition at line 785 of file mpegaudioenc.c.
const AVCodecDefault mp2_defaults[] [static] |