FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
twinvq.h File Reference
#include <math.h>
#include <stdint.h>
#include "libavutil/attributes_internal.h"
#include "libavutil/tx.h"
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "avcodec.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, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
int ff_twinvq_decode_close (AVCodecContext *avctx)
 
int ff_twinvq_decode_init (AVCodecContext *avctx)
 Requires the caller to call ff_twinvq_decode_close() upon failure. More...
 

Variables

FF_VISIBILITY_PUSH_HIDDEN enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table []
 
const float ff_metasound_lsp8 []
 
const float ff_metasound_lsp11 []
 
const float ff_metasound_lsp16 []
 
const float ff_metasound_lsp22 []
 
const float ff_metasound_lsp44 []
 

Macro Definition Documentation

◆ TWINVQ_PPC_SHAPE_CB_SIZE

#define TWINVQ_PPC_SHAPE_CB_SIZE   64

Definition at line 46 of file twinvq.h.

◆ TWINVQ_PPC_SHAPE_LEN_MAX

#define TWINVQ_PPC_SHAPE_LEN_MAX   60

Definition at line 47 of file twinvq.h.

◆ TWINVQ_SUB_AMP_MAX

#define TWINVQ_SUB_AMP_MAX   4500.0

Definition at line 48 of file twinvq.h.

◆ TWINVQ_MULAW_MU

#define TWINVQ_MULAW_MU   100.0

Definition at line 49 of file twinvq.h.

◆ TWINVQ_GAIN_BITS

#define TWINVQ_GAIN_BITS   8

Definition at line 50 of file twinvq.h.

◆ TWINVQ_AMP_MAX

#define TWINVQ_AMP_MAX   13000.0

Definition at line 51 of file twinvq.h.

◆ TWINVQ_SUB_GAIN_BITS

#define TWINVQ_SUB_GAIN_BITS   5

Definition at line 52 of file twinvq.h.

◆ TWINVQ_WINDOW_TYPE_BITS

#define TWINVQ_WINDOW_TYPE_BITS   4

Definition at line 53 of file twinvq.h.

◆ TWINVQ_PGAIN_MU

#define TWINVQ_PGAIN_MU   200

Definition at line 54 of file twinvq.h.

◆ TWINVQ_LSP_COEFS_MAX

#define TWINVQ_LSP_COEFS_MAX   20

Definition at line 55 of file twinvq.h.

◆ TWINVQ_LSP_SPLIT_MAX

#define TWINVQ_LSP_SPLIT_MAX   4

Definition at line 56 of file twinvq.h.

◆ TWINVQ_CHANNELS_MAX

#define TWINVQ_CHANNELS_MAX   2

Definition at line 57 of file twinvq.h.

◆ TWINVQ_SUBBLOCKS_MAX

#define TWINVQ_SUBBLOCKS_MAX   16

Definition at line 58 of file twinvq.h.

◆ TWINVQ_BARK_N_COEF_MAX

#define TWINVQ_BARK_N_COEF_MAX   4

Definition at line 59 of file twinvq.h.

◆ TWINVQ_MAX_FRAMES_PER_PACKET

#define TWINVQ_MAX_FRAMES_PER_PACKET   2

Definition at line 61 of file twinvq.h.

Enumeration Type Documentation

◆ TwinVQCodec

Enumerator
TWINVQ_CODEC_VQF 
TWINVQ_CODEC_METASOUND 

Definition at line 34 of file twinvq.h.

◆ TwinVQFrameType

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

◆ twinvq_memset_float()

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

Definition at line 194 of file twinvq.h.

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

◆ twinvq_mulawinv()

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

Definition at line 200 of file twinvq.h.

Referenced by dec_gain(), and decode_ppc().

◆ ff_twinvq_decode_frame()

int ff_twinvq_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket avpkt 
)

Definition at line 479 of file twinvq.c.

◆ ff_twinvq_decode_close()

int ff_twinvq_decode_close ( AVCodecContext avctx)

Definition at line 744 of file twinvq.c.

◆ ff_twinvq_decode_init()

int ff_twinvq_decode_init ( AVCodecContext avctx)

Requires the caller to call ff_twinvq_decode_close() upon failure.

Definition at line 763 of file twinvq.c.

Referenced by metasound_decode_init(), and twinvq_decode_init().

Variable Documentation

◆ ff_twinvq_wtype_to_ftype_table

FF_VISIBILITY_PUSH_HIDDEN enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table[]

Definition at line 473 of file twinvq.c.

Referenced by metasound_read_bitstream(), and twinvq_read_bitstream().

◆ ff_metasound_lsp8

const float ff_metasound_lsp8[]

Definition at line 27 of file metasound_twinvq_data.h.

◆ ff_metasound_lsp11

const float ff_metasound_lsp11[]

Definition at line 93 of file metasound_twinvq_data.h.

◆ ff_metasound_lsp16

const float ff_metasound_lsp16[]

Definition at line 260 of file metasound_twinvq_data.h.

◆ ff_metasound_lsp22

const float ff_metasound_lsp22[]

Definition at line 439 of file metasound_twinvq_data.h.

◆ ff_metasound_lsp44

const float ff_metasound_lsp44[]

Definition at line 606 of file metasound_twinvq_data.h.