libavcodec/libopencore-amr.c File Reference

#include "avcodec.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include <opencore-amrnb/interf_dec.h>
#include <opencore-amrnb/interf_enc.h>
#include <opencore-amrwb/dec_if.h>
#include <opencore-amrwb/if_rom.h>

Go to the source code of this file.

Data Structures

struct  AMR_bitrates
struct  AMRContext
struct  AMRWBContext

Typedefs

typedef struct AMR_bitrates AMR_bitrates
typedef struct AMRContext AMRContext
typedef struct AMRWBContext AMRWBContext

Functions

static void amr_decode_fix_avctx (AVCodecContext *avctx)
static int get_bitrate_mode (int bitrate, void *log_ctx)
static av_cold int amr_nb_decode_init (AVCodecContext *avctx)
static av_cold int amr_nb_decode_close (AVCodecContext *avctx)
static int amr_nb_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static av_cold int amr_nb_encode_init (AVCodecContext *avctx)
static av_cold int amr_nb_encode_close (AVCodecContext *avctx)
static int amr_nb_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static av_cold int amr_wb_decode_init (AVCodecContext *avctx)
static int amr_wb_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static int amr_wb_decode_close (AVCodecContext *avctx)

Variables

static const AVOption options []
class {
      libopencore_amrnb
      av_default_item_name
      options
}; 
AVCodec ff_libopencore_amrnb_decoder
AVCodec ff_libopencore_amrnb_encoder
AVCodec ff_libopencore_amrwb_decoder

Typedef Documentation

typedef struct AMR_bitrates AMR_bitrates
typedef struct AMRContext AMRContext
typedef struct AMRWBContext AMRWBContext

Function Documentation

static void amr_decode_fix_avctx ( AVCodecContext avctx  )  [static]

Definition at line 26 of file libopencore-amr.c.

Referenced by amr_nb_decode_init(), and amr_wb_decode_init().

static av_cold int amr_nb_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 122 of file libopencore-amr.c.

static int amr_nb_decode_frame ( AVCodecContext avctx,
void *  data,
int *  got_frame_ptr,
AVPacket avpkt 
) [static]

Definition at line 131 of file libopencore-amr.c.

static av_cold int amr_nb_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 99 of file libopencore-amr.c.

static av_cold int amr_nb_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 212 of file libopencore-amr.c.

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

Definition at line 221 of file libopencore-amr.c.

static av_cold int amr_nb_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 183 of file libopencore-amr.c.

static int amr_wb_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 320 of file libopencore-amr.c.

static int amr_wb_decode_frame ( AVCodecContext avctx,
void *  data,
int *  got_frame_ptr,
AVPacket avpkt 
) [static]

Definition at line 286 of file libopencore-amr.c.

static av_cold int amr_wb_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 267 of file libopencore-amr.c.

static int get_bitrate_mode ( int  bitrate,
void *  log_ctx 
) [static]

Definition at line 52 of file libopencore-amr.c.

Referenced by amr_nb_encode_frame(), and amr_nb_encode_init().


Variable Documentation

const { ... } [static]
av_default_item_name

Definition at line 96 of file libopencore-amr.c.

Initial value:
 {
    .name           = "libopencore_amrnb",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = CODEC_ID_AMR_NB,
    .priv_data_size = sizeof(AMRContext),
    .init           = amr_nb_decode_init,
    .close          = amr_nb_decode_close,
    .decode         = amr_nb_decode_frame,
    .capabilities   = CODEC_CAP_DR1,
    .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"),
}

Definition at line 171 of file libopencore-amr.c.

Initial value:
 {
    .name           = "libopencore_amrnb",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = CODEC_ID_AMR_NB,
    .priv_data_size = sizeof(AMRContext),
    .init           = amr_nb_encode_init,
    .encode         = amr_nb_encode_frame,
    .close          = amr_nb_encode_close,
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
    .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"),
    .priv_class = &class,
}

Definition at line 241 of file libopencore-amr.c.

Initial value:
 {
    .name           = "libopencore_amrwb",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = CODEC_ID_AMR_WB,
    .priv_data_size = sizeof(AMRWBContext),
    .init           = amr_wb_decode_init,
    .close          = amr_wb_decode_close,
    .decode         = amr_wb_decode_frame,
    .capabilities   = CODEC_CAP_DR1,
    .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Wide-Band"),
}

Definition at line 328 of file libopencore-amr.c.

Definition at line 96 of file libopencore-amr.c.

Referenced by avcodec_register_all().

options [static]
Initial value:
 {
    { "dtx", "Allow DTX (generate comfort noise)", 0x42, AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
    { NULL }
}

Definition at line 90 of file libopencore-amr.c.