FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
twinvq.h File Reference
#include <math.h>
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "fft.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  TwinVQFrameMode
 Parameters and tables that are different for each frame type. More...
 
struct  TwinVQFrameData
 
struct  TwinVQModeTab
 Parameters and tables that are different for every combination of bitrate/sample rate. More...
 
struct  TwinVQContext
 

Macros

#define TWINVQ_PPC_SHAPE_CB_SIZE   64
 
#define TWINVQ_PPC_SHAPE_LEN_MAX   60
 
#define TWINVQ_SUB_AMP_MAX   4500.0
 
#define TWINVQ_MULAW_MU   100.0
 
#define TWINVQ_GAIN_BITS   8
 
#define TWINVQ_AMP_MAX   13000.0
 
#define TWINVQ_SUB_GAIN_BITS   5
 
#define TWINVQ_WINDOW_TYPE_BITS   4
 
#define TWINVQ_PGAIN_MU   200
 
#define TWINVQ_LSP_COEFS_MAX   20
 
#define TWINVQ_LSP_SPLIT_MAX   4
 
#define TWINVQ_CHANNELS_MAX   2
 
#define TWINVQ_SUBBLOCKS_MAX   16
 
#define TWINVQ_BARK_N_COEF_MAX   4
 
#define TWINVQ_MAX_FRAMES_PER_PACKET   2
 

Enumerations

enum  TwinVQCodec { TWINVQ_CODEC_VQF, TWINVQ_CODEC_METASOUND }
 
enum  TwinVQFrameType { TWINVQ_FT_SHORT = 0, TWINVQ_FT_MEDIUM, TWINVQ_FT_LONG, TWINVQ_FT_PPC }
 

Functions

static void twinvq_memset_float (float *buf, float val, int size)
 
static float twinvq_mulawinv (float y, float clip, float mu)
 
int ff_twinvq_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
int ff_twinvq_decode_close (AVCodecContext *avctx)
 
int ff_twinvq_decode_init (AVCodecContext *avctx)
 

Variables

enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table []
 

Macro Definition Documentation

#define TWINVQ_PPC_SHAPE_CB_SIZE   64

Definition at line 46 of file twinvq.h.

Referenced by read_and_decode_spectrum().

#define TWINVQ_PPC_SHAPE_LEN_MAX   60

Definition at line 47 of file twinvq.h.

Referenced by read_and_decode_spectrum().

#define TWINVQ_SUB_AMP_MAX   4500.0

Definition at line 48 of file twinvq.h.

Referenced by dec_gain().

#define TWINVQ_MULAW_MU   100.0

Definition at line 49 of file twinvq.h.

Referenced by dec_gain().

#define TWINVQ_GAIN_BITS   8
#define TWINVQ_AMP_MAX   13000.0

Definition at line 51 of file twinvq.h.

Referenced by dec_gain().

#define TWINVQ_SUB_GAIN_BITS   5
#define TWINVQ_WINDOW_TYPE_BITS   4

Definition at line 53 of file twinvq.h.

Referenced by init_bitstream_params(), metasound_read_bitstream(), and twinvq_read_bitstream().

#define TWINVQ_PGAIN_MU   200

Definition at line 54 of file twinvq.h.

Referenced by decode_ppc().

#define TWINVQ_LSP_COEFS_MAX   20

Definition at line 55 of file twinvq.h.

Referenced by read_and_decode_spectrum().

#define TWINVQ_LSP_SPLIT_MAX   4

Definition at line 56 of file twinvq.h.

#define TWINVQ_CHANNELS_MAX   2

Definition at line 57 of file twinvq.h.

Referenced by metasound_decode_init(), read_and_decode_spectrum(), and twinvq_decode_init().

#define TWINVQ_SUBBLOCKS_MAX   16

Definition at line 58 of file twinvq.h.

Referenced by read_and_decode_spectrum().

#define TWINVQ_BARK_N_COEF_MAX   4

Definition at line 59 of file twinvq.h.

#define TWINVQ_MAX_FRAMES_PER_PACKET   2

Definition at line 61 of file twinvq.h.

Referenced by ff_twinvq_decode_init().

Enumeration Type Documentation

Enumerator:
TWINVQ_CODEC_VQF 
TWINVQ_CODEC_METASOUND 

Definition at line 34 of file twinvq.h.

Enumerator:
TWINVQ_FT_SHORT 

Short frame (divided in n sub-blocks)

TWINVQ_FT_MEDIUM 

Medium frame (divided in m<n sub-blocks)

TWINVQ_FT_LONG 

Long frame (single sub-block + PPC)

TWINVQ_FT_PPC 

Periodic Peak Component (part of the long frame)

Definition at line 39 of file twinvq.h.

Function Documentation

static void twinvq_memset_float ( float *  buf,
float  val,
int  size 
)
inlinestatic
Note
not speed critical, hence not optimized

Definition at line 186 of file twinvq.h.

Referenced by dec_bark_env(), eval_lpcenv_2parts(), and ff_twinvq_decode_init().

static float twinvq_mulawinv ( float  y,
float  clip,
float  mu 
)
inlinestatic

Definition at line 192 of file twinvq.h.

Referenced by dec_gain(), and decode_ppc().

int ff_twinvq_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame_ptr,
AVPacket avpkt 
)

Definition at line 476 of file twinvq.c.

int ff_twinvq_decode_close ( AVCodecContext avctx)

Definition at line 751 of file twinvq.c.

Referenced by ff_twinvq_decode_init().

int ff_twinvq_decode_init ( AVCodecContext avctx)

Definition at line 770 of file twinvq.c.

Referenced by metasound_decode_init(), and twinvq_decode_init().

Variable Documentation

enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table[]

Definition at line 470 of file twinvq.c.

Referenced by metasound_read_bitstream(), and twinvq_read_bitstream().