libavcodec/libmp3lame.c File Reference

Interface to libmp3lame for mp3 encoding. More...

#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#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   (7200 + 2 * MPA_FRAME_SIZE + MPA_FRAME_SIZE / 4+1000)
#define OFFSET(x)   offsetof(Mp3AudioContext, x)
#define AE   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

Functions

static av_cold int MP3lame_encode_init (AVCodecContext *avctx)
static int mp3len (void *data, int *samplesPerFrame, int *sampleRate)
static int MP3lame_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static av_cold int MP3lame_encode_close (AVCodecContext *avctx)

Variables

static const int sSampleRates []
static const int sBitRates [2][3][15]
static const int sSamplesPerFrame [2][3]
static const int sBitsPerSlot [3] = { 32, 8, 8 }
static const AVOption options []
static const AVClass libmp3lame_class
AVCodec ff_libmp3lame_encoder


Detailed Description

Interface to libmp3lame for mp3 encoding.

Definition in file libmp3lame.c.


Define Documentation

#define AE   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

Definition at line 286 of file libmp3lame.c.

#define BUFFER_SIZE   (7200 + 2 * MPA_FRAME_SIZE + MPA_FRAME_SIZE / 4+1000)

Definition at line 34 of file libmp3lame.c.

Referenced by http_getc(), http_seek(), MP3lame_encode_frame(), and oggvorbis_encode_frame().

#define OFFSET (  )     offsetof(Mp3AudioContext, x)

Definition at line 285 of file libmp3lame.c.


Function Documentation

static av_cold int MP3lame_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 274 of file libmp3lame.c.

static int MP3lame_encode_frame ( AVCodecContext avctx,
unsigned char *  frame,
int  buf_size,
void *  data 
) [static]

Definition at line 174 of file libmp3lame.c.

static av_cold int MP3lame_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 48 of file libmp3lame.c.

static int mp3len ( void *  data,
int *  samplesPerFrame,
int *  sampleRate 
) [static]

Definition at line 139 of file libmp3lame.c.

Referenced by MP3lame_encode_frame().


Variable Documentation

Initial value:

 {
    .name                  = "libmp3lame",
    .type                  = AVMEDIA_TYPE_AUDIO,
    .id                    = CODEC_ID_MP3,
    .priv_data_size        = sizeof(Mp3AudioContext),
    .init                  = MP3lame_encode_init,
    .encode                = MP3lame_encode_frame,
    .close                 = MP3lame_encode_close,
    .capabilities          = CODEC_CAP_DELAY,
    .sample_fmts           = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,



                                                             AV_SAMPLE_FMT_NONE },
    .supported_samplerates = sSampleRates,
    .long_name             = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
    .priv_class            = &libmp3lame_class,
}

Definition at line 299 of file libmp3lame.c.

const AVClass libmp3lame_class [static]

Initial value:

 {
    .class_name = "libmp3lame encoder",
    .item_name  = av_default_item_name,
    .option     = options,
    .version    = LIBAVUTIL_VERSION_INT,
}

Definition at line 292 of file libmp3lame.c.

const AVOption options[] [static]

Initial value:

 {
    { "reservoir", "Use bit reservoir.", OFFSET(reservoir), AV_OPT_TYPE_INT, { 1 }, 0, 1, AE },
    { NULL },
}

Definition at line 287 of file libmp3lame.c.

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 119 of file libmp3lame.c.

Referenced by mp3len().

const int sBitsPerSlot[3] = { 32, 8, 8 } [static]

Definition at line 137 of file libmp3lame.c.

Referenced by mp3len().

const int sSampleRates[] [static]

Initial value:

 {
    44100, 48000,  32000, 22050, 24000, 16000, 11025, 12000, 8000, 0
}

Definition at line 115 of file libmp3lame.c.

Referenced by mp3len().

const int sSamplesPerFrame[2][3] [static]

Initial value:

 {
    { 384, 1152, 1152 },
    { 384, 1152,  576 }
}

Definition at line 132 of file libmp3lame.c.

Referenced by mp3len().


Generated on Fri Oct 26 02:46:09 2012 for FFmpeg by  doxygen 1.5.8