libavcodec/g722enc.c File Reference

G.722 ADPCM audio encoder. More...

#include "avcodec.h"
#include "internal.h"
#include "g722.h"

Go to the source code of this file.

Defines

#define FREEZE_INTERVAL   128
#define MAX_FRAME_SIZE   32768
#define MIN_TRELLIS   0
#define MAX_TRELLIS   16
#define STORE_NODE(index, UPDATE, VALUE)

Functions

static av_cold int g722_encode_close (AVCodecContext *avctx)
static av_cold int g722_encode_init (AVCodecContext *avctx)
static void filter_samples (G722Context *c, const int16_t *samples, int *xlow, int *xhigh)
static int encode_high (const struct G722Band *state, int xhigh)
static int encode_low (const struct G722Band *state, int xlow)
static void g722_encode_trellis (G722Context *c, int trellis, uint8_t *dst, int nb_samples, const int16_t *samples)
static av_always_inline void encode_byte (G722Context *c, uint8_t *dst, const int16_t *samples)
static void g722_encode_no_trellis (G722Context *c, uint8_t *dst, int nb_samples, const int16_t *samples)
static int g722_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)

Variables

static const int16_t low_quant [33]
AVCodec ff_adpcm_g722_encoder


Detailed Description

G.722 ADPCM audio encoder.

Definition in file g722enc.c.


Define Documentation

#define FREEZE_INTERVAL   128

Definition at line 34 of file g722enc.c.

#define MAX_FRAME_SIZE   32768

Definition at line 38 of file g722enc.c.

#define MAX_TRELLIS   16

Definition at line 43 of file g722enc.c.

Referenced by g722_encode_init().

#define MIN_TRELLIS   0

Definition at line 42 of file g722enc.c.

Referenced by g722_encode_init().

#define STORE_NODE ( index,
UPDATE,
VALUE   ) 


Function Documentation

static av_always_inline void encode_byte ( G722Context c,
uint8_t dst,
const int16_t samples 
) [static]

Definition at line 336 of file g722enc.c.

static int encode_high ( const struct G722Band *  state,
int  xhigh 
) [inline, static]

Definition at line 162 of file g722enc.c.

static int encode_low ( const struct G722Band *  state,
int  xlow 
) [inline, static]

Definition at line 170 of file g722enc.c.

Referenced by g722_encode_trellis().

static void filter_samples ( G722Context c,
const int16_t samples,
int *  xlow,
int *  xhigh 
) [inline, static]

Definition at line 145 of file g722enc.c.

Referenced by ff_filter_samples(), g722_encode_trellis(), and init().

static av_cold int g722_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 45 of file g722enc.c.

Referenced by g722_encode_init().

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

Definition at line 358 of file g722enc.c.

static av_cold int g722_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 60 of file g722enc.c.

static void g722_encode_no_trellis ( G722Context c,
uint8_t dst,
int  nb_samples,
const int16_t samples 
) [static]

Definition at line 349 of file g722enc.c.

static void g722_encode_trellis ( G722Context c,
int  trellis,
uint8_t dst,
int  nb_samples,
const int16_t samples 
) [static]

Definition at line 184 of file g722enc.c.


Variable Documentation

Initial value:

 {
    .name           = "g722",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = CODEC_ID_ADPCM_G722,
    .priv_data_size = sizeof(G722Context),
    .init           = g722_encode_init,
    .close          = g722_encode_close,
    .encode2        = g722_encode_frame,
    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME,
    .long_name      = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
                                                     AV_SAMPLE_FMT_NONE },
}

Definition at line 388 of file g722enc.c.

const int16_t low_quant[33] [static]

Initial value:

 {
      35,   72,  110,  150,  190,  233,  276,  323,
     370,  422,  473,  530,  587,  650,  714,  786,
     858,  940, 1023, 1121, 1219, 1339, 1458, 1612,
    1765, 1980, 2195, 2557, 2919
}

Definition at line 138 of file g722enc.c.

Referenced by encode_low().


Generated on Fri Oct 26 02:47:56 2012 for FFmpeg by  doxygen 1.5.8