libavcodec/alacenc.c File Reference

#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "lpc.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  RiceContext
struct  AlacLPCContext
struct  AlacEncodeContext

Defines

#define DEFAULT_FRAME_SIZE   4096
#define DEFAULT_SAMPLE_SIZE   16
#define MAX_CHANNELS   8
#define ALAC_EXTRADATA_SIZE   36
#define ALAC_FRAME_HEADER_SIZE   55
#define ALAC_FRAME_FOOTER_SIZE   3
#define ALAC_ESCAPE_CODE   0x1FF
#define ALAC_MAX_LPC_ORDER   30
#define DEFAULT_MAX_PRED_ORDER   6
#define DEFAULT_MIN_PRED_ORDER   4
#define ALAC_MAX_LPC_PRECISION   9
#define ALAC_MAX_LPC_SHIFT   9
#define ALAC_CHMODE_LEFT_RIGHT   0
#define ALAC_CHMODE_LEFT_SIDE   1
#define ALAC_CHMODE_RIGHT_SIDE   2
#define ALAC_CHMODE_MID_SIDE   3

Functions

static void init_sample_buffers (AlacEncodeContext *s, int16_t **input_samples)
static void encode_scalar (AlacEncodeContext *s, int x, int k, int write_sample_size)
static void write_frame_header (AlacEncodeContext *s)
static void calc_predictor_params (AlacEncodeContext *s, int ch)
static int estimate_stereo_mode (int32_t *left_ch, int32_t *right_ch, int n)
static void alac_stereo_decorrelation (AlacEncodeContext *s)
static void alac_linear_predictor (AlacEncodeContext *s, int ch)
static void alac_entropy_coder (AlacEncodeContext *s)
static int write_frame (AlacEncodeContext *s, AVPacket *avpkt, int16_t **samples)
static av_always_inline int get_max_frame_size (int frame_size, int ch, int bps)
static av_cold int alac_encode_close (AVCodecContext *avctx)
static av_cold int alac_encode_init (AVCodecContext *avctx)
static int alac_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)

Variables

AVCodec ff_alac_encoder


Define Documentation

#define ALAC_CHMODE_LEFT_RIGHT   0

Definition at line 43 of file alacenc.c.

Referenced by alac_stereo_decorrelation().

#define ALAC_CHMODE_LEFT_SIDE   1

Definition at line 44 of file alacenc.c.

Referenced by alac_stereo_decorrelation().

#define ALAC_CHMODE_MID_SIDE   3

Definition at line 46 of file alacenc.c.

#define ALAC_CHMODE_RIGHT_SIDE   2

Definition at line 45 of file alacenc.c.

Referenced by alac_stereo_decorrelation().

#define ALAC_ESCAPE_CODE   0x1FF

Definition at line 36 of file alacenc.c.

Referenced by encode_scalar().

#define ALAC_EXTRADATA_SIZE   36

Definition at line 32 of file alacenc.c.

#define ALAC_FRAME_FOOTER_SIZE   3

Definition at line 34 of file alacenc.c.

#define ALAC_FRAME_HEADER_SIZE   55

Definition at line 33 of file alacenc.c.

#define ALAC_MAX_LPC_ORDER   30

Definition at line 37 of file alacenc.c.

Referenced by alac_encode_init().

#define ALAC_MAX_LPC_PRECISION   9

Definition at line 40 of file alacenc.c.

Referenced by calc_predictor_params().

#define ALAC_MAX_LPC_SHIFT   9

Definition at line 41 of file alacenc.c.

Referenced by calc_predictor_params().

#define DEFAULT_FRAME_SIZE   4096

#define DEFAULT_MAX_PRED_ORDER   6

Definition at line 38 of file alacenc.c.

Referenced by alac_encode_init().

#define DEFAULT_MIN_PRED_ORDER   4

Definition at line 39 of file alacenc.c.

Referenced by alac_encode_init().

#define DEFAULT_SAMPLE_SIZE   16

Definition at line 30 of file alacenc.c.

Referenced by alac_encode_frame(), and alac_encode_init().

#define MAX_CHANNELS   8

Definition at line 31 of file alacenc.c.


Function Documentation

static av_cold int alac_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 410 of file alacenc.c.

Referenced by alac_encode_init().

static int alac_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
) [static]

Definition at line 534 of file alacenc.c.

static av_cold int alac_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 420 of file alacenc.c.

static void alac_entropy_coder ( AlacEncodeContext s  )  [static]

Definition at line 304 of file alacenc.c.

Referenced by write_frame().

static void alac_linear_predictor ( AlacEncodeContext s,
int  ch 
) [static]

Definition at line 240 of file alacenc.c.

Referenced by write_frame().

static void alac_stereo_decorrelation ( AlacEncodeContext s  )  [static]

Definition at line 200 of file alacenc.c.

Referenced by write_frame().

static void calc_predictor_params ( AlacEncodeContext s,
int  ch 
) [static]

Definition at line 137 of file alacenc.c.

Referenced by write_frame().

static void encode_scalar ( AlacEncodeContext s,
int  x,
int  k,
int  write_sample_size 
) [static]

Definition at line 93 of file alacenc.c.

Referenced by alac_entropy_coder().

static int estimate_stereo_mode ( int32_t *  left_ch,
int32_t *  right_ch,
int  n 
) [static]

Definition at line 167 of file alacenc.c.

Referenced by alac_stereo_decorrelation(), and channel_decorrelation().

static av_always_inline int get_max_frame_size ( int  frame_size,
int  ch,
int  bps 
) [static]

Definition at line 404 of file alacenc.c.

Referenced by alac_encode_frame(), and alac_encode_init().

static void init_sample_buffers ( AlacEncodeContext s,
int16_t **  input_samples 
) [static]

Definition at line 81 of file alacenc.c.

Referenced by write_frame().

static int write_frame ( AlacEncodeContext s,
AVPacket avpkt,
int16_t **  samples 
) [static]

Definition at line 348 of file alacenc.c.

static void write_frame_header ( AlacEncodeContext s  )  [static]

Definition at line 121 of file alacenc.c.

Referenced by write_frame().


Variable Documentation

Initial value:

 {
    .name           = "alac",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = AV_CODEC_ID_ALAC,
    .priv_data_size = sizeof(AlacEncodeContext),
    .init           = alac_encode_init,
    .encode2        = alac_encode_frame,
    .close          = alac_encode_close,
    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME,
    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P,
                                                     AV_SAMPLE_FMT_NONE },
    .long_name      = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
}

Definition at line 568 of file alacenc.c.


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