The simplest mpeg audio layer 2 encoder. More...
#include "avcodec.h"
#include "put_bits.h"
#include "mpegaudio.h"
#include "mpegaudiodata.h"
#include "mpegaudiotab.h"
Go to the source code of this file.
Data Structures | |
struct | MpegAudioContext |
Defines | |
#define | CONFIG_MPEGAUDIO_HP 0 |
#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 |
Typedefs | |
typedef struct MpegAudioContext | MpegAudioContext |
Functions | |
static av_cold 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 av_cold int | MPA_encode_close (AVCodecContext *avctx) |
Variables | |
AVCodec | mp2_encoder |
The simplest mpeg audio layer 2 encoder.
Definition in file mpegaudioenc.c.
#define CONFIG_MPEGAUDIO_HP 0 |
Definition at line 31 of file mpegaudioenc.c.
#define MUL | ( | a, | ||
b | ||||
) | (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) |
Definition at line 36 of file mpegaudioenc.c.
Referenced by idct32().
#define SAMPLES_BUF_SIZE 4096 |
Definition at line 38 of file mpegaudioenc.c.
Referenced by filter().
#define SB_ALLOCATED 1 |
Definition at line 500 of file mpegaudioenc.c.
#define SB_NOMORE 2 |
Definition at line 501 of file mpegaudioenc.c.
Referenced by compute_bit_allocation().
#define SB_NOTALLOCATED 0 |
Definition at line 499 of file mpegaudioenc.c.
Referenced by compute_bit_allocation().
#define USE_FLOATS |
Definition at line 62 of file mpegaudioenc.c.
#define WSHIFT (WFRAC_BITS + 15 - FRAC_BITS) |
Definition at line 311 of file mpegaudioenc.c.
typedef struct MpegAudioContext MpegAudioContext |
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 506 of file mpegaudioenc.c.
Referenced by MPA_encode_frame().
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 370 of file mpegaudioenc.c.
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 611 of file mpegaudioenc.c.
Referenced by MPA_encode_frame().
static void filter | ( | MpegAudioContext * | s, | |
int | ch, | |||
short * | samples, | |||
int | incr | |||
) | [static] |
Definition at line 313 of file mpegaudioenc.c.
Referenced by av_resample(), filter_name(), hybrid4_8_12_cx(), hybrid6_cx(), initFilter(), make_filters_from_proto(), MPA_encode_frame(), pick_formats(), query_formats(), show_filters(), tta_decode_frame(), and vc1_decode_p_mb().
static void idct32 | ( | int * | out, | |
int * | tab | |||
) | [static] |
Definition at line 192 of file mpegaudioenc.c.
Referenced by filter().
static av_cold int MPA_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 785 of file mpegaudioenc.c.
static int MPA_encode_frame | ( | AVCodecContext * | avctx, | |
unsigned char * | frame, | |||
int | buf_size, | |||
void * | data | |||
) | [static] |
Definition at line 755 of file mpegaudioenc.c.
static av_cold int MPA_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 67 of file mpegaudioenc.c.
static void psycho_acoustic_model | ( | MpegAudioContext * | s, | |
short | smr[SBLIMIT] | |||
) | [static] |
Definition at line 489 of file mpegaudioenc.c.
Referenced by MPA_encode_frame().
{ "mp2", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP2, sizeof(MpegAudioContext), MPA_encode_init, MPA_encode_frame, MPA_encode_close, NULL, .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, .supported_samplerates= (const int[]){44100, 48000, 32000, 22050, 24000, 16000, 0}, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), }
Definition at line 791 of file mpegaudioenc.c.