#include "avcodec.h"#include "mpegaudio.h"#include <lame/lame.h>

Go to the source code of this file.
Data Structures | |
| struct | Mp3AudioContext |
Defines | |
| #define | BUFFER_SIZE (2*MPA_FRAME_SIZE) |
Functions | |
| static int | MP3lame_encode_init (AVCodecContext *avctx) |
| static int | mp3len (void *data, int *samplesPerFrame, int *sampleRate) |
| int | MP3lame_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) |
| int | MP3lame_encode_close (AVCodecContext *avctx) |
Variables | |
| static const int | sSampleRates [3] |
| static const int | sBitRates [2][3][15] |
| static const int | sSamplesPerFrame [2][3] |
| static const int | sBitsPerSlot [3] |
| AVCodec | mp3lame_encoder |
Definition in file mp3lameaudio.c.
| #define BUFFER_SIZE (2*MPA_FRAME_SIZE) |
Definition at line 29 of file mp3lameaudio.c.
| int MP3lame_encode_close | ( | AVCodecContext * | avctx | ) |
Definition at line 194 of file mp3lameaudio.c.
References av_freep(), AVCodecContext::coded_frame, Mp3AudioContext::gfp, AVCodecContext::priv_data, and s.

| int MP3lame_encode_frame | ( | AVCodecContext * | avctx, | |
| unsigned char * | frame, | |||
| int | buf_size, | |||
| void * | data | |||
| ) |
Definition at line 131 of file mp3lameaudio.c.
References av_log(), AV_LOG_ERROR, Mp3AudioContext::buffer, Mp3AudioContext::buffer_index, BUFFER_SIZE, AVCodecContext::frame_size, Mp3AudioContext::gfp, memcpy, mp3len(), NULL, AVCodecContext::priv_data, s, and Mp3AudioContext::stereo.

| static int MP3lame_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 37 of file mp3lameaudio.c.
References avcodec_alloc_frame(), AVCodecContext::bit_rate, AVCodecContext::channels, AVCodecContext::coded_frame, AVCodecContext::frame_size, Mp3AudioContext::gfp, NULL, AVCodecContext::priv_data, s, AVCodecContext::sample_rate, and Mp3AudioContext::stereo.

| static int mp3len | ( | void * | data, | |
| int * | samplesPerFrame, | |||
| int * | sampleRate | |||
| ) | [static] |
Definition at line 100 of file mp3lameaudio.c.
References header, sBitRates, sBitsPerSlot, sSampleRates, and sSamplesPerFrame.
Referenced by MP3lame_encode_frame().
Initial value:
{
"mp3",
CODEC_TYPE_AUDIO,
CODEC_ID_MP3,
sizeof(Mp3AudioContext),
MP3lame_encode_init,
MP3lame_encode_frame,
MP3lame_encode_close,
.capabilities= CODEC_CAP_DELAY,
}
Definition at line 205 of file mp3lameaudio.c.
Referenced by avcodec_register_all().
const int sBitRates[2][3][15] [static] |
Initial value:
{
{ { 0, 32, 64, 96,128,160,192,224,256,288,320,352,384,416,448},
{ 0, 32, 48, 56, 64, 80, 96,112,128,160,192,224,256,320,384},
{ 0, 32, 40, 48, 56, 64, 80, 96,112,128,160,192,224,256,320}
},
{ { 0, 32, 48, 56, 64, 80, 96,112,128,144,160,176,192,224,256},
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160},
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160}
},
}
Definition at line 77 of file mp3lameaudio.c.
Referenced by mp3len().
const int sBitsPerSlot[3] [static] |
const int sSampleRates[3] [static] |
Initial value:
{
44100, 48000, 32000
}
Definition at line 73 of file mp3lameaudio.c.
Referenced by mp3len().
const int sSamplesPerFrame[2][3] [static] |
Initial value:
{
{ 384, 1152, 1152 },
{ 384, 1152, 576 }
}
Definition at line 88 of file mp3lameaudio.c.
Referenced by mp3len().
1.5.5