FFmpeg
Classes | Macros | Typedefs | Enumerations | Functions
g723_1.h File Reference

G.723.1 types, functions and data tables. More...

#include <stdint.h>
#include "libavutil/log.h"

Go to the source code of this file.

Classes

struct  G723_1_Subframe
 G723.1 unpacked data subframe. More...
 
struct  PPFParam
 Pitch postfilter parameters. More...
 
struct  HFParam
 Harmonic filter parameters. More...
 
struct  FCBParam
 Optimized fixed codebook excitation parameters. More...
 
struct  g723_1_context
 

Macros

#define SUBFRAMES   4
 
#define SUBFRAME_LEN   60
 
#define FRAME_LEN   (SUBFRAME_LEN << 2)
 
#define HALF_FRAME_LEN   (FRAME_LEN / 2)
 
#define LPC_FRAME   (HALF_FRAME_LEN + SUBFRAME_LEN)
 
#define LPC_ORDER   10
 
#define LSP_BANDS   3
 
#define LSP_CB_SIZE   256
 
#define PITCH_MIN   18
 
#define PITCH_MAX   (PITCH_MIN + 127)
 
#define PITCH_ORDER   5
 
#define GRID_SIZE   2
 
#define PULSE_MAX   6
 
#define GAIN_LEVELS   24
 
#define COS_TBL_SIZE   512
 
#define MULL2(a, b)   ((((a) >> 16) * (b) * 2) + (((a) & 0xffff) * (b) >> 15))
 Bitexact implementation of 2ab scaled by 1/2^16. More...
 

Typedefs

typedef struct G723_1_Subframe G723_1_Subframe
 G723.1 unpacked data subframe.
 
typedef struct PPFParam PPFParam
 Pitch postfilter parameters.
 
typedef struct HFParam HFParam
 Harmonic filter parameters.
 
typedef struct FCBParam FCBParam
 Optimized fixed codebook excitation parameters.
 
typedef struct g723_1_context G723_1_Context
 

Enumerations

enum  FrameType {
  ACTIVE_FRAME, SID_FRAME, UNTRANSMITTED_FRAME, INTRA_FRAME = 0,
  INTER_FRAME, SKIP_FRAME, FIRST_FRAME, INNER_FRAME,
  FINAL_FRAME, LINEAR_MODE, FRAME_NB
}
 G723.1 frame types. More...
 
enum  Rate { RATE_6300, RATE_5300 }
 G723.1 rate values.
 

Functions

int ff_g723_1_scale_vector (int16_t *dst, const int16_t *vector, int length)
 Scale vector contents based on the largest of their absolutes.
 
int ff_g723_1_normalize_bits (int num, int width)
 Calculate the number of left-shifts required for normalizing the input. More...
 
int ff_g723_1_dot_product (const int16_t *a, const int16_t *b, int length)
 
void ff_g723_1_get_residual (int16_t *residual, int16_t *prev_excitation, int lag)
 Get delayed contribution from the previous excitation vector.
 
void ff_g723_1_gen_dirac_train (int16_t *buf, int pitch_lag)
 Generate a train of dirac functions with period as pitch lag.
 
void ff_g723_1_gen_acb_excitation (int16_t *vector, int16_t *prev_excitation, int pitch_lag, G723_1_Subframe *subfrm, enum Rate cur_rate)
 Generate adaptive codebook excitation.
 
void ff_g723_1_lsp_interpolate (int16_t *lpc, int16_t *cur_lsp, int16_t *prev_lsp)
 Quantize LSP frequencies by interpolation and convert them to the corresponding LPC coefficients. More...
 
void ff_g723_1_inverse_quant (int16_t *cur_lsp, int16_t *prev_lsp, uint8_t *lsp_index, int bad_frame)
 Perform inverse quantization of LSP frequencies. More...
 

Detailed Description

G.723.1 types, functions and data tables.

Macro Definition Documentation

§ MULL2

#define MULL2 (   a,
 
)    ((((a) >> 16) * (b) * 2) + (((a) & 0xffff) * (b) >> 15))

Bitexact implementation of 2ab scaled by 1/2^16.

Parameters
a32 bit multiplicand
b16 bit multiplier

Enumeration Type Documentation

§ FrameType

enum FrameType

G723.1 frame types.

Enumerator
ACTIVE_FRAME 

Active speech.

SID_FRAME 

Silence Insertion Descriptor frame.

Function Documentation

§ ff_g723_1_inverse_quant()

void ff_g723_1_inverse_quant ( int16_t *  cur_lsp,
int16_t *  prev_lsp,
uint8_t *  lsp_index,
int  bad_frame 
)

Perform inverse quantization of LSP frequencies.

Parameters
cur_lspthe current LSP vector
prev_lspthe previous LSP vector
lsp_indexVQ indices
bad_framebad frame flag

§ ff_g723_1_lsp_interpolate()

void ff_g723_1_lsp_interpolate ( int16_t *  lpc,
int16_t *  cur_lsp,
int16_t *  prev_lsp 
)

Quantize LSP frequencies by interpolation and convert them to the corresponding LPC coefficients.

Parameters
lpcbuffer for LPC coefficients
cur_lspthe current LSP vector
prev_lspthe previous LSP vector

§ ff_g723_1_normalize_bits()

int ff_g723_1_normalize_bits ( int  num,
int  width 
)

Calculate the number of left-shifts required for normalizing the input.

Parameters
numinput number
widthwidth of the input, 16 bits(0) / 32 bits(1)