FFmpeg
Data Structures | Macros | Functions | Variables
libvorbisenc.c File Reference
#include <vorbis/vorbisenc.h>
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/fifo.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "audio_frame_queue.h"
#include "codec_internal.h"
#include "encode.h"
#include "version.h"
#include "vorbis_parser.h"

Go to the source code of this file.

Data Structures

struct  LibvorbisEncContext
 

Macros

#define LIBVORBIS_FRAME_SIZE   64
 
#define BUFFER_SIZE   (1024 * 64)
 

Functions

static int vorbis_error_to_averror (int ov_err)
 
static av_cold int libvorbis_setup (vorbis_info *vi, AVCodecContext *avctx)
 
static int xiph_len (int l)
 
static av_cold int libvorbis_encode_close (AVCodecContext *avctx)
 
static av_cold int libvorbis_encode_init (AVCodecContext *avctx)
 
static int libvorbis_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

static const AVOption options []
 
static const FFCodecDefault defaults []
 
static const AVClass vorbis_class
 
static const uint8_t vorbis_encoding_channel_layout_offsets [8][8]
 
const FFCodec ff_libvorbis_encoder
 

Macro Definition Documentation

◆ LIBVORBIS_FRAME_SIZE

#define LIBVORBIS_FRAME_SIZE   64

Definition at line 40 of file libvorbisenc.c.

◆ BUFFER_SIZE

#define BUFFER_SIZE   (1024 * 64)

Definition at line 42 of file libvorbisenc.c.

Function Documentation

◆ vorbis_error_to_averror()

static int vorbis_error_to_averror ( int  ov_err)
static

Definition at line 86 of file libvorbisenc.c.

Referenced by libvorbis_encode_frame(), libvorbis_encode_init(), and libvorbis_setup().

◆ libvorbis_setup()

static av_cold int libvorbis_setup ( vorbis_info *  vi,
AVCodecContext avctx 
)
static

Definition at line 96 of file libvorbisenc.c.

Referenced by libvorbis_encode_init().

◆ xiph_len()

static int xiph_len ( int  l)
static

Definition at line 182 of file libvorbisenc.c.

Referenced by libvorbis_encode_init().

◆ libvorbis_encode_close()

static av_cold int libvorbis_encode_close ( AVCodecContext avctx)
static

Definition at line 187 of file libvorbisenc.c.

Referenced by libvorbis_encode_init().

◆ libvorbis_encode_init()

static av_cold int libvorbis_encode_init ( AVCodecContext avctx)
static

Definition at line 207 of file libvorbisenc.c.

◆ libvorbis_encode_frame()

static int libvorbis_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)
static

Definition at line 286 of file libvorbisenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "iblock", "Sets the impulse block bias", 0x42, AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -15, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
}

Definition at line 58 of file libvorbisenc.c.

◆ defaults

const FFCodecDefault defaults[]
static
Initial value:
= {
{ "b", "0" },
{ NULL },
}

Definition at line 63 of file libvorbisenc.c.

◆ vorbis_class

const AVClass vorbis_class
static
Initial value:
= {
.class_name = "libvorbis",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 68 of file libvorbisenc.c.

◆ vorbis_encoding_channel_layout_offsets

const uint8_t vorbis_encoding_channel_layout_offsets[8][8]
static
Initial value:
= {
{ 0 },
{ 0, 1 },
{ 0, 2, 1 },
{ 0, 1, 2, 3 },
{ 0, 2, 1, 3, 4 },
{ 0, 2, 1, 4, 5, 3 },
{ 0, 2, 1, 5, 6, 4, 3 },
{ 0, 2, 1, 6, 7, 4, 5, 3 },
}

Definition at line 75 of file libvorbisenc.c.

Referenced by libvorbis_encode_frame().

◆ ff_libvorbis_encoder

const FFCodec ff_libvorbis_encoder
Initial value:
= {
.p.name = "libvorbis",
CODEC_LONG_NAME("libvorbis"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
.priv_data_size = sizeof(LibvorbisEncContext),
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.p.priv_class = &vorbis_class,
.defaults = defaults,
.p.wrapper_name = "libvorbis",
}

Definition at line 376 of file libvorbisenc.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
vorbis_class
static const AVClass vorbis_class
Definition: libvorbisenc.c:68
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:34
defaults
static const FFCodecDefault defaults[]
Definition: libvorbisenc.c:63
options
static const AVOption options[]
Definition: libvorbisenc.c:58
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:296
AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:274
libvorbis_encode_frame
static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libvorbisenc.c:286
libvorbis_encode_close
static av_cold int libvorbis_encode_close(AVCodecContext *avctx)
Definition: libvorbisenc.c:187
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:237
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:269
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
LibvorbisEncContext
Definition: libvorbisenc.c:44
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
libvorbis_encode_init
static av_cold int libvorbis_encode_init(AVCodecContext *avctx)
Definition: libvorbisenc.c:207
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
AV_CODEC_ID_VORBIS
@ AV_CODEC_ID_VORBIS
Definition: codec_id.h:445
AV_CODEC_CAP_SMALL_LAST_FRAME
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
Definition: codec.h:81