#include <limits.h>
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "put_bits.h"
Go to the source code of this file.
Data Structures | |
struct | Float11 |
G.726 11bit float. More... | |
struct | G726Tables |
struct | G726Context |
Defines | |
#define | OFFSET(x) offsetof(G726Context, x) |
#define | AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Typedefs | |
typedef struct Float11 | Float11 |
G.726 11bit float. | |
typedef struct G726Tables | G726Tables |
typedef struct G726Context | G726Context |
Functions | |
static Float11 * | i2f (int i, Float11 *f) |
static int16_t | mult (Float11 *f1, Float11 *f2) |
static int | sgn (int value) |
static uint8_t | quant (G726Context *c, int d) |
Para 4.2.2 page 18: Adaptive quantizer. | |
static int16_t | inverse_quant (G726Context *c, int i) |
Para 4.2.3 page 22: Inverse adaptive quantizer. | |
static int16_t | g726_decode (G726Context *c, int I) |
static av_cold int | g726_reset (G726Context *c) |
static int16_t | g726_encode (G726Context *c, int16_t sig) |
static av_cold int | g726_encode_init (AVCodecContext *avctx) |
static av_cold int | g726_encode_close (AVCodecContext *avctx) |
static int | g726_encode_frame (AVCodecContext *avctx, uint8_t *dst, int buf_size, void *data) |
static av_cold int | g726_decode_init (AVCodecContext *avctx) |
static int | g726_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) |
static void | g726_decode_flush (AVCodecContext *avctx) |
Variables | |
static const int | quant_tbl16 [] |
16kbit/s 2bits per sample | |
static const int16_t | iquant_tbl16 [] |
static const int16_t | W_tbl16 [] |
static const uint8_t | F_tbl16 [] |
static const int | quant_tbl24 [] |
24kbit/s 3bits per sample | |
static const int16_t | iquant_tbl24 [] |
static const int16_t | W_tbl24 [] |
static const uint8_t | F_tbl24 [] |
static const int | quant_tbl32 [] |
32kbit/s 4bits per sample | |
static const int16_t | iquant_tbl32 [] |
static const int16_t | W_tbl32 [] |
static const uint8_t | F_tbl32 [] |
static const int | quant_tbl40 [] |
40kbit/s 5bits per sample | |
static const int16_t | iquant_tbl40 [] |
static const int16_t | W_tbl40 [] |
static const uint8_t | F_tbl40 [] |
static const G726Tables | G726Tables_pool [] |
static const AVOption | options [] |
class { | |
class_name = "g726" | |
item_name = av_default_item_name | |
option = options | |
version = LIBAVUTIL_VERSION_INT | |
}; | |
static const AVCodecDefault | defaults [] |
AVCodec | ff_adpcm_g726_encoder |
AVCodec | ff_adpcm_g726_decoder |
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
#define OFFSET | ( | x | ) | offsetof(G726Context, x) |
G.726 11bit float.
G.726 Standard uses rather odd 11bit floating point arithmentic for numerous occasions. It's a mistery to me why they did it this way instead of simply using 32bit integer arithmetic.
typedef struct G726Context G726Context |
typedef struct G726Tables G726Tables |
static int16_t g726_decode | ( | G726Context * | c, | |
int | I | |||
) | [static] |
Definition at line 192 of file g726.c.
Referenced by g726_decode_frame(), and g726_encode().
static void g726_decode_flush | ( | AVCodecContext * | avctx | ) | [static] |
static int g726_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | got_frame_ptr, | |||
AVPacket * | avpkt | |||
) | [static] |
static av_cold int g726_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static int16_t g726_encode | ( | G726Context * | c, | |
int16_t | sig | |||
) | [static] |
Definition at line 295 of file g726.c.
Referenced by g726_encode_frame().
static av_cold int g726_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
static int g726_encode_frame | ( | AVCodecContext * | avctx, | |
uint8_t * | dst, | |||
int | buf_size, | |||
void * | data | |||
) | [static] |
static av_cold int g726_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
static av_cold int g726_reset | ( | G726Context * | c | ) | [static] |
Definition at line 274 of file g726.c.
Referenced by g726_decode_flush(), g726_decode_init(), and g726_encode_init().
Definition at line 44 of file g726.c.
Referenced by g726_decode().
static int16_t inverse_quant | ( | G726Context * | c, | |
int | i | |||
) | [inline, static] |
Para 4.2.3 page 22: Inverse adaptive quantizer.
Definition at line 182 of file g726.c.
Referenced by g726_decode().
Definition at line 54 of file g726.c.
Referenced by g726_decode().
static uint8_t quant | ( | G726Context * | c, | |
int | d | |||
) | [inline, static] |
static int sgn | ( | int | value | ) | [inline, static] |
Definition at line 64 of file g726.c.
Referenced by g726_decode().
const { ... } [static] |
class_name = "g726" |
const AVCodecDefault defaults[] [static] |
const uint8_t F_tbl16[] [static] |
const uint8_t F_tbl24[] [static] |
const uint8_t F_tbl32[] [static] |
const uint8_t F_tbl40[] [static] |
{ .name = "g726", .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_ADPCM_G726, .priv_data_size = sizeof(G726Context), .init = g726_decode_init, .decode = g726_decode_frame, .flush = g726_decode_flush, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), }
{ .name = "g726", .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_ADPCM_G726, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, .encode = g726_encode_frame, .close = g726_encode_close, .capabilities = CODEC_CAP_SMALL_LAST_FRAME, .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), .priv_class = &class, .defaults = defaults, }
const G726Tables G726Tables_pool[] [static] |
{{ quant_tbl16, iquant_tbl16, W_tbl16, F_tbl16 }, { quant_tbl24, iquant_tbl24, W_tbl24, F_tbl24 }, { quant_tbl32, iquant_tbl32, W_tbl32, F_tbl32 }, { quant_tbl40, iquant_tbl40, W_tbl40, F_tbl40 }}
const int16_t iquant_tbl16[] [static] |
const int16_t iquant_tbl24[] [static] |
const int16_t iquant_tbl32[] [static] |
const int16_t iquant_tbl40[] [static] |
const int quant_tbl16[] [static] |
const int quant_tbl24[] [static] |
const int quant_tbl32[] [static] |
const int quant_tbl40[] [static] |
const int16_t W_tbl16[] [static] |
const int16_t W_tbl24[] [static] |
const int16_t W_tbl32[] [static] |