libavcodec/vorbisenc.c File Reference

Native Vorbis encoder. More...

#include <float.h>
#include "avcodec.h"
#include "dsputil.h"
#include "fft.h"
#include "vorbis.h"
#include "vorbis_enc_data.h"
#include "put_bits.h"
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  vorbis_enc_codebook
struct  vorbis_enc_floor_class
struct  vorbis_enc_floor
struct  vorbis_enc_residue
struct  vorbis_enc_mapping
struct  vorbis_enc_mode
struct  vorbis_enc_context

Defines

#define BITSTREAM_WRITER_LE
#define MAX_CHANNELS   2
#define MAX_CODEBOOK_DIM   8
#define MAX_FLOOR_CLASS_DIM   4
#define NUM_FLOOR_PARTITIONS   8
#define MAX_FLOOR_VALUES   (MAX_FLOOR_CLASS_DIM*NUM_FLOOR_PARTITIONS+2)
#define RESIDUE_SIZE   1600
#define RESIDUE_PART_SIZE   32
#define NUM_RESIDUE_PARTITIONS   (RESIDUE_SIZE/RESIDUE_PART_SIZE)

Functions

static void put_codeword (PutBitContext *pb, vorbis_enc_codebook *cb, int entry)
static int cb_lookup_vals (int lookup, int dimentions, int entries)
static void ready_codebook (vorbis_enc_codebook *cb)
static void ready_residue (vorbis_enc_residue *rc, vorbis_enc_context *venc)
static void create_vorbis_context (vorbis_enc_context *venc, AVCodecContext *avccontext)
static void put_float (PutBitContext *pb, float f)
static void put_codebook_header (PutBitContext *pb, vorbis_enc_codebook *cb)
static void put_floor_header (PutBitContext *pb, vorbis_enc_floor *fc)
static void put_residue_header (PutBitContext *pb, vorbis_enc_residue *rc)
static int put_main_header (vorbis_enc_context *venc, uint8_t **out)
static float get_floor_average (vorbis_enc_floor *fc, float *coeffs, int i)
static void floor_fit (vorbis_enc_context *venc, vorbis_enc_floor *fc, float *coeffs, uint16_t *posts, int samples)
static int render_point (int x0, int y0, int x1, int y1, int x)
static void floor_encode (vorbis_enc_context *venc, vorbis_enc_floor *fc, PutBitContext *pb, uint16_t *posts, float *floor, int samples)
static float * put_vector (vorbis_enc_codebook *book, PutBitContext *pb, float *num)
static void residue_encode (vorbis_enc_context *venc, vorbis_enc_residue *rc, PutBitContext *pb, float *coeffs, int samples, int real_ch)
static int apply_window_and_mdct (vorbis_enc_context *venc, const signed short *audio, int samples)
static av_cold int vorbis_encode_init (AVCodecContext *avccontext)
static int vorbis_encode_frame (AVCodecContext *avccontext, unsigned char *packets, int buf_size, void *data)
static av_cold int vorbis_encode_close (AVCodecContext *avccontext)

Variables

AVCodec ff_vorbis_encoder


Detailed Description

Native Vorbis encoder.

Author:
Oded Shimon <ods15@ods15.dyndns.org>

Definition in file vorbisenc.c.


Define Documentation

#define BITSTREAM_WRITER_LE

Definition at line 34 of file vorbisenc.c.

#define MAX_CHANNELS   2

Definition at line 129 of file vorbisenc.c.

#define MAX_CODEBOOK_DIM   8

Definition at line 130 of file vorbisenc.c.

Referenced by residue_encode().

#define MAX_FLOOR_CLASS_DIM   4

Definition at line 132 of file vorbisenc.c.

#define MAX_FLOOR_VALUES   (MAX_FLOOR_CLASS_DIM*NUM_FLOOR_PARTITIONS+2)

Definition at line 134 of file vorbisenc.c.

Referenced by floor_encode(), floor_fit(), and vorbis_encode_frame().

#define NUM_FLOOR_PARTITIONS   8

Definition at line 133 of file vorbisenc.c.

Referenced by create_vorbis_context().

#define NUM_RESIDUE_PARTITIONS   (RESIDUE_SIZE/RESIDUE_PART_SIZE)

Definition at line 138 of file vorbisenc.c.

Referenced by residue_encode().

#define RESIDUE_PART_SIZE   32

Definition at line 137 of file vorbisenc.c.

#define RESIDUE_SIZE   1600

Definition at line 136 of file vorbisenc.c.


Function Documentation

static int apply_window_and_mdct ( vorbis_enc_context venc,
const signed short *  audio,
int  samples 
) [static]

Definition at line 902 of file vorbisenc.c.

static int cb_lookup_vals ( int  lookup,
int  dimentions,
int  entries 
) [static]

Definition at line 149 of file vorbisenc.c.

Referenced by create_vorbis_context(), put_codebook_header(), and ready_codebook().

static void create_vorbis_context ( vorbis_enc_context venc,
AVCodecContext avccontext 
) [static]

Definition at line 228 of file vorbisenc.c.

Referenced by vorbis_encode_init().

static void floor_encode ( vorbis_enc_context venc,
vorbis_enc_floor fc,
PutBitContext pb,
uint16_t *  posts,
float *  floor,
int  samples 
) [static]

Definition at line 708 of file vorbisenc.c.

Referenced by vorbis_encode_frame().

static void floor_fit ( vorbis_enc_context venc,
vorbis_enc_floor fc,
float *  coeffs,
uint16_t *  posts,
int  samples 
) [static]

Definition at line 676 of file vorbisenc.c.

Referenced by vorbis_encode_frame().

static float get_floor_average ( vorbis_enc_floor fc,
float *  coeffs,
int  i 
) [static]

Definition at line 664 of file vorbisenc.c.

Referenced by floor_fit().

static void put_codebook_header ( PutBitContext pb,
vorbis_enc_codebook cb 
) [static]

Definition at line 404 of file vorbisenc.c.

Referenced by put_main_header().

static void put_codeword ( PutBitContext pb,
vorbis_enc_codebook cb,
int  entry 
) [inline, static]

Definition at line 140 of file vorbisenc.c.

Referenced by floor_encode(), put_vector(), and residue_encode().

static void put_float ( PutBitContext pb,
float  f 
) [static]

Definition at line 390 of file vorbisenc.c.

Referenced by put_codebook_header().

static void put_floor_header ( PutBitContext pb,
vorbis_enc_floor fc 
) [static]

Definition at line 469 of file vorbisenc.c.

Referenced by put_main_header().

static int put_main_header ( vorbis_enc_context venc,
uint8_t **  out 
) [static]

Definition at line 534 of file vorbisenc.c.

Referenced by vorbis_encode_init().

static void put_residue_header ( PutBitContext pb,
vorbis_enc_residue rc 
) [static]

Definition at line 502 of file vorbisenc.c.

Referenced by put_main_header().

static float* put_vector ( vorbis_enc_codebook book,
PutBitContext pb,
float *  num 
) [static]

Definition at line 791 of file vorbisenc.c.

Referenced by residue_encode().

static void ready_codebook ( vorbis_enc_codebook cb  )  [static]

Definition at line 158 of file vorbisenc.c.

Referenced by create_vorbis_context().

static void ready_residue ( vorbis_enc_residue rc,
vorbis_enc_context venc 
) [static]

Definition at line 192 of file vorbisenc.c.

Referenced by create_vorbis_context().

static int render_point ( int  x0,
int  y0,
int  x1,
int  y1,
int  x 
) [static]

Definition at line 703 of file vorbisenc.c.

Referenced by floor_encode().

static void residue_encode ( vorbis_enc_context venc,
vorbis_enc_residue rc,
PutBitContext pb,
float *  coeffs,
int  samples,
int  real_ch 
) [static]

Definition at line 813 of file vorbisenc.c.

Referenced by vorbis_encode_frame().

static av_cold int vorbis_encode_close ( AVCodecContext avccontext  )  [static]

Definition at line 1045 of file vorbisenc.c.

static int vorbis_encode_frame ( AVCodecContext avccontext,
unsigned char *  packets,
int  buf_size,
void *  data 
) [static]

Definition at line 982 of file vorbisenc.c.

static av_cold int vorbis_encode_init ( AVCodecContext avccontext  )  [static]

Definition at line 955 of file vorbisenc.c.


Variable Documentation

Initial value:

 {
    .name           = "vorbis",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = CODEC_ID_VORBIS,
    .priv_data_size = sizeof(vorbis_enc_context),
    .init           = vorbis_encode_init,
    .encode         = vorbis_encode_frame,
    .close          = vorbis_encode_close,
    .capabilities= CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
    .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
}

Definition at line 1105 of file vorbisenc.c.


Generated on Fri Oct 26 02:43:50 2012 for FFmpeg by  doxygen 1.5.8