libamr.c File Reference


Detailed Description

Adaptive Multi-Rate (AMR) Audio decoder stub.

This code implements both an AMR-NarrowBand (AMR-NB) and an AMR-WideBand (AMR-WB) audio encoder/decoder through external reference code from http://www.3gpp.org/. The license of the code from 3gpp is unclear so you have to download the code separately. Two versions exists: One fixed-point and one floating-point. For some reason the float encoder is significantly faster at least on a P4 1.5GHz (0.9s instead of 9.9s on a 30s audio clip at MR102). Both float and fixed point are supported for AMR-NB, but only float for AMR-WB.

AMR-NB

Float

The float version (default) can be downloaded from: http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-610.zip

Fixed-point

The fixed-point (TS26.073) can be downloaded from: http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-600.zip

Specification

The specification for AMR-NB can be found in TS 26.071 (http://www.3gpp.org/ftp/Specs/html-info/26071.htm) and some other info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm.

AMR-WB

Float

The reference code can be downloaded from: http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-600.zip

Fixed-point

If someone wants to use the fixed point version it can be downloaded from: http://www.3gpp.org/ftp/Specs/archive/26_series/26.173/26173-571.zip.

Specification

The specification for AMR-WB can be found in TS 26.171 (http://www.3gpp.org/ftp/Specs/html-info/26171.htm) and some other info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm.

Definition in file libamr.c.

Go to the source code of this file.

Classes

struct  AMR_bitrates
struct  AMRContext
struct  AMRContext
struct  AMRWB_bitrates
struct  AMRWBContext

Functions

static int getBitrateMode (int bitrate)
static void amr_decode_fix_avctx (AVCodecContext *avctx)
static int amr_nb_decode_init (AVCodecContext *avctx)
static int amr_nb_encode_init (AVCodecContext *avctx)
static int amr_nb_encode_close (AVCodecContext *avctx)
static int amr_nb_decode_close (AVCodecContext *avctx)
static int amr_nb_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int amr_nb_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static int getWBBitrateMode (int bitrate)
static int amr_wb_encode_init (AVCodecContext *avctx)
static int amr_wb_encode_close (AVCodecContext *avctx)
static int amr_wb_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static int amr_wb_decode_init (AVCodecContext *avctx)
static int amr_wb_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int amr_wb_decode_close (AVCodecContext *avctx)

Variables

static const char * nb_bitrate_unsupported
static const char * wb_bitrate_unsupported
AVCodec libamr_nb_decoder
AVCodec libamr_nb_encoder
AVCodec libamr_wb_decoder
AVCodec libamr_wb_encoder


Function Documentation

static int getBitrateMode ( int  bitrate  )  [static]

Definition at line 97 of file libamr.c.

Referenced by amr_nb_encode_init().

static void amr_decode_fix_avctx ( AVCodecContext avctx  )  [static]

Definition at line 122 of file libamr.c.

Referenced by amr_nb_decode_init(), and amr_wb_decode_init().

static int amr_nb_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 158 of file libamr.c.

static int amr_nb_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 186 of file libamr.c.

static int amr_nb_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 227 of file libamr.c.

static int amr_nb_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 237 of file libamr.c.

static int amr_nb_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 245 of file libamr.c.

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

Definition at line 330 of file libamr.c.

static int getWBBitrateMode ( int  bitrate  )  [static]

Definition at line 541 of file libamr.c.

Referenced by amr_wb_encode_frame(), and amr_wb_encode_init().

static int amr_wb_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 575 of file libamr.c.

static int amr_wb_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 608 of file libamr.c.

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

Definition at line 618 of file libamr.c.

static int amr_wb_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 633 of file libamr.c.

static int amr_wb_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 651 of file libamr.c.

static int amr_wb_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 679 of file libamr.c.


Variable Documentation

const char* nb_bitrate_unsupported [static]

Initial value:

    "bitrate not supported: use one of 4.75k, 5.15k, 5.9k, 6.7k, 7.4k, 7.95k, 10.2k or 12.2k\n"

Definition at line 84 of file libamr.c.

Referenced by amr_nb_encode_init().

const char* wb_bitrate_unsupported [static]

Initial value:

    "bitrate not supported: use one of 6.6k, 8.85k, 12.65k, 14.25k, 15.85k, 18.25k, 19.85k, 23.05k, or 23.85k\n"

Definition at line 86 of file libamr.c.

Referenced by amr_wb_encode_frame(), and amr_wb_encode_init().

Initial value:

Definition at line 496 of file libamr.c.

Initial value:

Definition at line 508 of file libamr.c.

Initial value:

Definition at line 687 of file libamr.c.

Initial value:

Definition at line 699 of file libamr.c.


Generated on Sat Dec 18 05:15:53 2010 for MythTV by  doxygen 1.5.5