FFmpeg
Macros | Functions
opus_pvq.c File Reference
#include "opustab.h"
#include "opus_pvq.h"

Go to the source code of this file.

Macros

#define CELT_PVQ_U(n, k)   (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)])
 
#define CELT_PVQ_V(n, k)   (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1))
 

Functions

static int16_t celt_cos (int16_t x)
 
static int celt_log2tan (int isin, int icos)
 
static int celt_bits2pulses (const uint8_t *cache, int bits)
 
static int celt_pulses2bits (const uint8_t *cache, int pulses)
 
static void celt_normalize_residual (const int *av_restrict iy, float *av_restrict X, int N, float g)
 
static void celt_exp_rotation_impl (float *X, uint32_t len, uint32_t stride, float c, float s)
 
static void celt_exp_rotation (float *X, uint32_t len, uint32_t stride, uint32_t K, enum CeltSpread spread, const int encode)
 
static uint32_t celt_extract_collapse_mask (const int *iy, uint32_t N, uint32_t B)
 
static void celt_stereo_merge (float *X, float *Y, float mid, int N)
 
static void celt_interleave_hadamard (float *tmp, float *X, int N0, int stride, int hadamard)
 
static void celt_deinterleave_hadamard (float *tmp, float *X, int N0, int stride, int hadamard)
 
static void celt_haar1 (float *X, int N0, int stride)
 
static int celt_compute_qn (int N, int b, int offset, int pulse_cap, int stereo)
 
static uint32_t celt_icwrsi (uint32_t N, uint32_t K, const int *y)
 
static uint64_t celt_cwrsi (uint32_t N, uint32_t K, uint32_t i, int *y)
 
static void celt_encode_pulses (OpusRangeCoder *rc, int *y, uint32_t N, uint32_t K)
 
static float celt_decode_pulses (OpusRangeCoder *rc, int *y, uint32_t N, uint32_t K)
 
static float ppp_pvq_search_c (float *X, int *y, int K, int N)
 
static uint32_t celt_alg_quant (OpusRangeCoder *rc, float *X, uint32_t N, uint32_t K, enum CeltSpread spread, uint32_t blocks, float gain, CeltPVQ *pvq)
 
static uint32_t celt_alg_unquant (OpusRangeCoder *rc, float *X, uint32_t N, uint32_t K, enum CeltSpread spread, uint32_t blocks, float gain, CeltPVQ *pvq)
 Decode pulse vector and combine the result with the pitch vector to produce the final normalised signal in the current band. More...
 
static int celt_calc_theta (const float *X, const float *Y, int coupling, int N)
 
static void celt_stereo_is_decouple (float *X, float *Y, float e_l, float e_r, int N)
 
static void celt_stereo_ms_decouple (float *X, float *Y, int N)
 
static av_always_inline uint32_t quant_band_template (CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, const int band, float *X, float *Y, int N, int b, uint32_t blocks, float *lowband, int duration, float *lowband_out, int level, float gain, float *lowband_scratch, int fill, int quant)
 
static QUANT_FN (pvq_decode_band)
 
static QUANT_FN (pvq_encode_band)
 
int av_cold ff_celt_pvq_init (CeltPVQ **pvq, int encode)
 
void av_cold ff_celt_pvq_uninit (CeltPVQ **pvq)
 

Macro Definition Documentation

◆ CELT_PVQ_U

#define CELT_PVQ_U (   n,
 
)    (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)])

Definition at line 29 of file opus_pvq.c.

◆ CELT_PVQ_V

#define CELT_PVQ_V (   n,
 
)    (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1))

Definition at line 30 of file opus_pvq.c.

Function Documentation

◆ celt_cos()

static int16_t celt_cos ( int16_t  x)
inlinestatic

Definition at line 32 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_log2tan()

static int celt_log2tan ( int  isin,
int  icos 
)
inlinestatic

Definition at line 39 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_bits2pulses()

static int celt_bits2pulses ( const uint8_t cache,
int  bits 
)
inlinestatic

Definition at line 51 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_pulses2bits()

static int celt_pulses2bits ( const uint8_t cache,
int  pulses 
)
inlinestatic

Definition at line 70 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_normalize_residual()

static void celt_normalize_residual ( const int *av_restrict  iy,
float *av_restrict  X,
int  N,
float  g 
)
inlinestatic

Definition at line 76 of file opus_pvq.c.

Referenced by celt_alg_quant(), and celt_alg_unquant().

◆ celt_exp_rotation_impl()

static void celt_exp_rotation_impl ( float *  X,
uint32_t  len,
uint32_t  stride,
float  c,
float  s 
)
static

Definition at line 84 of file opus_pvq.c.

Referenced by celt_exp_rotation().

◆ celt_exp_rotation()

static void celt_exp_rotation ( float *  X,
uint32_t  len,
uint32_t  stride,
uint32_t  K,
enum CeltSpread  spread,
const int  encode 
)
inlinestatic

Definition at line 107 of file opus_pvq.c.

Referenced by celt_alg_quant(), and celt_alg_unquant().

◆ celt_extract_collapse_mask()

static uint32_t celt_extract_collapse_mask ( const int iy,
uint32_t  N,
uint32_t  B 
)
inlinestatic

Definition at line 147 of file opus_pvq.c.

Referenced by celt_alg_quant(), and celt_alg_unquant().

◆ celt_stereo_merge()

static void celt_stereo_merge ( float *  X,
float *  Y,
float  mid,
int  N 
)
inlinestatic

Definition at line 161 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_interleave_hadamard()

static void celt_interleave_hadamard ( float *  tmp,
float *  X,
int  N0,
int  stride,
int  hadamard 
)
static

Definition at line 199 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_deinterleave_hadamard()

static void celt_deinterleave_hadamard ( float *  tmp,
float *  X,
int  N0,
int  stride,
int  hadamard 
)
static

Definition at line 212 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_haar1()

static void celt_haar1 ( float *  X,
int  N0,
int  stride 
)
static

Definition at line 225 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_compute_qn()

static int celt_compute_qn ( int  N,
int  b,
int  offset,
int  pulse_cap,
int  stereo 
)
inlinestatic

Definition at line 239 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_icwrsi()

static uint32_t celt_icwrsi ( uint32_t  N,
uint32_t  K,
const int y 
)
inlinestatic

Definition at line 256 of file opus_pvq.c.

Referenced by celt_encode_pulses().

◆ celt_cwrsi()

static uint64_t celt_cwrsi ( uint32_t  N,
uint32_t  K,
uint32_t  i,
int y 
)
inlinestatic

Definition at line 268 of file opus_pvq.c.

Referenced by celt_decode_pulses().

◆ celt_encode_pulses()

static void celt_encode_pulses ( OpusRangeCoder rc,
int y,
uint32_t  N,
uint32_t  K 
)
inlinestatic

Definition at line 351 of file opus_pvq.c.

Referenced by celt_alg_quant().

◆ celt_decode_pulses()

static float celt_decode_pulses ( OpusRangeCoder rc,
int y,
uint32_t  N,
uint32_t  K 
)
inlinestatic

Definition at line 356 of file opus_pvq.c.

Referenced by celt_alg_unquant().

◆ ppp_pvq_search_c()

static float ppp_pvq_search_c ( float *  X,
int y,
int  K,
int  N 
)
static

Definition at line 366 of file opus_pvq.c.

Referenced by ff_celt_pvq_init().

◆ celt_alg_quant()

static uint32_t celt_alg_quant ( OpusRangeCoder rc,
float *  X,
uint32_t  N,
uint32_t  K,
enum CeltSpread  spread,
uint32_t  blocks,
float  gain,
CeltPVQ pvq 
)
static

Definition at line 415 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_alg_unquant()

static uint32_t celt_alg_unquant ( OpusRangeCoder rc,
float *  X,
uint32_t  N,
uint32_t  K,
enum CeltSpread  spread,
uint32_t  blocks,
float  gain,
CeltPVQ pvq 
)
static

Decode pulse vector and combine the result with the pitch vector to produce the final normalised signal in the current band.

Definition at line 431 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_calc_theta()

static int celt_calc_theta ( const float *  X,
const float *  Y,
int  coupling,
int  N 
)
static

Definition at line 443 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_stereo_is_decouple()

static void celt_stereo_is_decouple ( float *  X,
float *  Y,
float  e_l,
float  e_r,
int  N 
)
static

Definition at line 461 of file opus_pvq.c.

Referenced by quant_band_template().

◆ celt_stereo_ms_decouple()

static void celt_stereo_ms_decouple ( float *  X,
float *  Y,
int  N 
)
static

Definition at line 471 of file opus_pvq.c.

Referenced by quant_band_template().

◆ quant_band_template()

static av_always_inline uint32_t quant_band_template ( CeltPVQ pvq,
CeltFrame f,
OpusRangeCoder rc,
const int  band,
float *  X,
float *  Y,
int  N,
int  b,
uint32_t  blocks,
float *  lowband,
int  duration,
float *  lowband_out,
int  level,
float  gain,
float *  lowband_scratch,
int  fill,
int  quant 
)
static

Definition at line 481 of file opus_pvq.c.

Referenced by QUANT_FN().

◆ QUANT_FN() [1/2]

static QUANT_FN ( pvq_decode_band  )
static

Definition at line 877 of file opus_pvq.c.

◆ QUANT_FN() [2/2]

static QUANT_FN ( pvq_encode_band  )
static

Definition at line 887 of file opus_pvq.c.

◆ ff_celt_pvq_init()

int av_cold ff_celt_pvq_init ( CeltPVQ **  pvq,
int  encode 
)

Definition at line 897 of file opus_pvq.c.

Referenced by ff_celt_init(), and opus_encode_init().

◆ ff_celt_pvq_uninit()

void av_cold ff_celt_pvq_uninit ( CeltPVQ **  pvq)

Definition at line 914 of file opus_pvq.c.

Referenced by ff_celt_free(), and opus_encode_end().