webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
#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) |
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 | ||
) |
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 | ||
) |
Compute the amplitude (sqrt energy) in each of the bands
m | Mode data |
X | Spectrum |
bandE | Square root of the energy for each band (returned) |
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
m | Mode data |
X | Spectrum (returned de-normalised) |
bandE | Square root of the energy for each band |
int hysteresis_decision | ( | opus_val16 | val, |
const opus_val16 * | thresholds, | ||
const opus_val16 * | hysteresis, | ||
int | N, | ||
int | prev | ||
) |
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
m | Mode data |
X | Spectrum (returned normalised) |
bandE | Square root of the energy for each band |
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
encode | flag that indicates whether we're encoding (1) or decoding (0) |
m | Mode data |
start | First band to process |
end | Last band to process + 1 |
X | Residual (normalised) |
Y | Residual (normalised) for second channel (or NULL for mono) |
collapse_masks | Anti-collapse tracking mask |
bandE | Square root of the energy for each band |
pulses | Bit allocation (per band) for PVQ |
shortBlocks | Zero for long blocks, non-zero for short blocks |
spread | Amount of spreading to use |
dual_stereo | Zero for MS stereo, non-zero for dual stereo |
intensity | First band to use intensity stereo |
tf_res | Time-frequency resolution change |
total_bits | Total number of bits that can be used for the frame (including the ones already spent) |
balance | Number of unallocated bits |
en | Entropy coder state |
LM | log2() of the number of 2.5 subframes in the frame |
codedBands | Last band to receive bits + 1 |
seed | Random generator seed |
arch | Run-time architecture (see opus_select_arch()) |