summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/celt/bands.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/bands.h')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/bands.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/bands.h b/lib/rbcodec/codecs/libopus/celt/bands.h
index 9ff8ffd7ba..96ba52a649 100644
--- a/lib/rbcodec/codecs/libopus/celt/bands.h
+++ b/lib/rbcodec/codecs/libopus/celt/bands.h
@@ -39,7 +39,7 @@
39/** Compute the amplitude (sqrt energy) in each of the bands 39/** Compute the amplitude (sqrt energy) in each of the bands
40 * @param m Mode data 40 * @param m Mode data
41 * @param X Spectrum 41 * @param X Spectrum
42 * @param bands Square root of the energy for each band (returned) 42 * @param bandE Square root of the energy for each band (returned)
43 */ 43 */
44void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int M); 44void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int M);
45 45
@@ -49,16 +49,17 @@ void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *band
49 equal to 1 49 equal to 1
50 * @param m Mode data 50 * @param m Mode data
51 * @param X Spectrum (returned normalised) 51 * @param X Spectrum (returned normalised)
52 * @param bands Square root of the energy for each band 52 * @param bandE Square root of the energy for each band
53 */ 53 */
54void 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); 54void 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);
55 55
56/** Denormalise each band of X to restore full amplitude 56/** Denormalise each band of X to restore full amplitude
57 * @param m Mode data 57 * @param m Mode data
58 * @param X Spectrum (returned de-normalised) 58 * @param X Spectrum (returned de-normalised)
59 * @param bands Square root of the energy for each band 59 * @param bandE Square root of the energy for each band
60 */ 60 */
61void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, celt_sig * OPUS_RESTRICT freq, const celt_ener *bandE, int end, int C, int M); 61void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
62 celt_sig * OPUS_RESTRICT freq, const opus_val16 *bandE, int start, int end, int C, int M);
62 63
63#define SPREAD_NONE (0) 64#define SPREAD_NONE (0)
64#define SPREAD_LIGHT (1) 65#define SPREAD_LIGHT (1)
@@ -76,14 +77,30 @@ void measure_norm_mse(const CELTMode *m, float *X, float *X0, float *bandE, floa
76void haar1(celt_norm *X, int N0, int stride); 77void haar1(celt_norm *X, int N0, int stride);
77 78
78/** Quantisation/encoding of the residual spectrum 79/** Quantisation/encoding of the residual spectrum
80 * @param encode flag that indicates whether we're encoding (1) or decoding (0)
79 * @param m Mode data 81 * @param m Mode data
82 * @param start First band to process
83 * @param end Last band to process + 1
80 * @param X Residual (normalised) 84 * @param X Residual (normalised)
85 * @param Y Residual (normalised) for second channel (or NULL for mono)
86 * @param collapse_masks Anti-collapse tracking mask
87 * @param bandE Square root of the energy for each band
88 * @param pulses Bit allocation (per band) for PVQ
89 * @param shortBlocks Zero for long blocks, non-zero for short blocks
90 * @param spread Amount of spreading to use
91 * @param dual_stereo Zero for MS stereo, non-zero for dual stereo
92 * @param intensity First band to use intensity stereo
93 * @param tf_res Time-frequency resolution change
81 * @param total_bits Total number of bits that can be used for the frame (including the ones already spent) 94 * @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
82 * @param enc Entropy encoder 95 * @param balance Number of unallocated bits
96 * @param en Entropy coder state
97 * @param LM log2() of the number of 2.5 subframes in the frame
98 * @param codedBands Last band to receive bits + 1
99 * @param seed Random generator seed
83 */ 100 */
84void quant_all_bands(int encode, const CELTMode *m, int start, int end, 101void quant_all_bands(int encode, const CELTMode *m, int start, int end,
85 celt_norm * X, celt_norm * Y, unsigned char *collapse_masks, const celt_ener *bandE, int *pulses, 102 celt_norm * X, celt_norm * Y, unsigned char *collapse_masks, const celt_ener *bandE, int *pulses,
86 int time_domain, int fold, int dual_stereo, int intensity, int *tf_res, 103 int shortBlocks, int spread, int dual_stereo, int intensity, int *tf_res,
87 opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed); 104 opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed);
88 105
89void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size, 106void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size,
@@ -92,4 +109,6 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas
92 109
93opus_uint32 celt_lcg_rand(opus_uint32 seed); 110opus_uint32 celt_lcg_rand(opus_uint32 seed);
94 111
112int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev);
113
95#endif /* BANDS_H */ 114#endif /* BANDS_H */