webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Functions
bands.c File Reference
#include <math.h>
#include "bands.h"
#include "modes.h"
#include "vq.h"
#include "cwrs.h"
#include "stack_alloc.h"
#include "os_support.h"
#include "mathops.h"
#include "rate.h"
#include "quant_bands.h"
#include "pitch.h"

Classes

struct  band_ctx
 
struct  split_ctx
 

Functions

int hysteresis_decision (opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev)
 
opus_uint32 celt_lcg_rand (opus_uint32 seed)
 
void compute_band_energies (const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM)
 
void normalise_bands (const CELTMode *m, const celt_sig *OPUS_RESTRICT freq, celt_norm *OPUS_RESTRICT X, const celt_ener *bandE, int end, int C, int M)
 
void denormalise_bands (const CELTMode *m, const celt_norm *OPUS_RESTRICT X, celt_sig *OPUS_RESTRICT freq, const opus_val16 *bandLogE, int start, int end, int M, int downsample, int silence)
 
void anti_collapse (const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size, int start, int end, const opus_val16 *logE, const opus_val16 *prev1logE, const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed, int arch)
 
int spreading_decision (const CELTMode *m, const celt_norm *X, int *average, int last_decision, int *hf_average, int *tapset_decision, int update_hf, int end, int C, int M)
 
void haar1 (celt_norm *X, int N0, int stride)
 
void quant_all_bands (int encode, const CELTMode *m, int start, int end, celt_norm *X_, celt_norm *Y_, unsigned char *collapse_masks, const celt_ener *bandE, int *pulses, int shortBlocks, int spread, int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int LM, int codedBands, opus_uint32 *seed, int arch)
 

Function Documentation

◆ anti_collapse()

void anti_collapse ( const CELTMode m,
celt_norm X_,
unsigned char *  collapse_masks,
int  LM,
int  C,
int  size,
int  start,
int  end,
const opus_val16 logE,
const opus_val16 prev1logE,
const opus_val16 prev2logE,
const int *  pulses,
opus_uint32  seed,
int  arch 
)

◆ celt_lcg_rand()

opus_uint32 celt_lcg_rand ( opus_uint32  seed)

◆ compute_band_energies()

void compute_band_energies ( const CELTMode m,
const celt_sig X,
celt_ener bandE,
int  end,
int  C,
int  LM 
)

Compute the amplitude (sqrt energy) in each of the bands

Parameters
mMode data
XSpectrum
bandESquare root of the energy for each band (returned)

◆ denormalise_bands()

void denormalise_bands ( const CELTMode m,
const celt_norm *OPUS_RESTRICT  X,
celt_sig *OPUS_RESTRICT  freq,
const opus_val16 bandE,
int  start,
int  end,
int  M,
int  downsample,
int  silence 
)

Denormalise each band of X to restore full amplitude

Parameters
mMode data
XSpectrum (returned de-normalised)
bandESquare root of the energy for each band

◆ haar1()

void haar1 ( celt_norm X,
int  N0,
int  stride 
)

◆ hysteresis_decision()

int hysteresis_decision ( opus_val16  val,
const opus_val16 thresholds,
const opus_val16 hysteresis,
int  N,
int  prev 
)

◆ normalise_bands()

void normalise_bands ( const CELTMode m,
const celt_sig *OPUS_RESTRICT  freq,
celt_norm *OPUS_RESTRICT  X,
const celt_ener bandE,
int  end,
int  C,
int  M 
)

Normalise each band of X such that the energy in each band is equal to 1

Parameters
mMode data
XSpectrum (returned normalised)
bandESquare root of the energy for each band

◆ quant_all_bands()

void quant_all_bands ( int  encode,
const CELTMode m,
int  start,
int  end,
celt_norm X,
celt_norm Y,
unsigned char *  collapse_masks,
const celt_ener bandE,
int *  pulses,
int  shortBlocks,
int  spread,
int  dual_stereo,
int  intensity,
int *  tf_res,
opus_int32  total_bits,
opus_int32  balance,
ec_ctx ec,
int  M,
int  codedBands,
opus_uint32 seed,
int  arch 
)

Quantisation/encoding of the residual spectrum

Parameters
encodeflag that indicates whether we're encoding (1) or decoding (0)
mMode data
startFirst band to process
endLast band to process + 1
XResidual (normalised)
YResidual (normalised) for second channel (or NULL for mono)
collapse_masksAnti-collapse tracking mask
bandESquare root of the energy for each band
pulsesBit allocation (per band) for PVQ
shortBlocksZero for long blocks, non-zero for short blocks
spreadAmount of spreading to use
dual_stereoZero for MS stereo, non-zero for dual stereo
intensityFirst band to use intensity stereo
tf_resTime-frequency resolution change
total_bitsTotal number of bits that can be used for the frame (including the ones already spent)
balanceNumber of unallocated bits
enEntropy coder state
LMlog2() of the number of 2.5 subframes in the frame
codedBandsLast band to receive bits + 1
seedRandom generator seed
archRun-time architecture (see opus_select_arch())

◆ spreading_decision()

int spreading_decision ( const CELTMode m,
const celt_norm X,
int *  average,
int  last_decision,
int *  hf_average,
int *  tapset_decision,
int  update_hf,
int  end,
int  C,
int  M 
)