OLD | NEW |
1 /* Copyright (c) 2007-2008 CSIRO | 1 /* Copyright (c) 2007-2008 CSIRO |
2 Copyright (c) 2007-2009 Xiph.Org Foundation | 2 Copyright (c) 2007-2009 Xiph.Org Foundation |
3 Written by Jean-Marc Valin */ | 3 Written by Jean-Marc Valin */ |
4 /** | 4 /** |
5 @file vq.h | 5 @file vq.h |
6 @brief Vector quantisation of the residual | 6 @brief Vector quantisation of the residual |
7 */ | 7 */ |
8 /* | 8 /* |
9 Redistribution and use in source and binary forms, with or without | 9 Redistribution and use in source and binary forms, with or without |
10 modification, are permitted provided that the following conditions | 10 modification, are permitted provided that the following conditions |
(...skipping 19 matching lines...) Expand all Loading... |
30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 */ | 31 */ |
32 | 32 |
33 #ifndef VQ_H | 33 #ifndef VQ_H |
34 #define VQ_H | 34 #define VQ_H |
35 | 35 |
36 #include "entenc.h" | 36 #include "entenc.h" |
37 #include "entdec.h" | 37 #include "entdec.h" |
38 #include "modes.h" | 38 #include "modes.h" |
39 | 39 |
| 40 #if (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(FIXED_POINT)) |
| 41 #include "x86/vq_sse.h" |
| 42 #endif |
| 43 |
40 #if defined(MIPSr1_ASM) | 44 #if defined(MIPSr1_ASM) |
41 #include "mips/vq_mipsr1.h" | 45 #include "mips/vq_mipsr1.h" |
42 #endif | 46 #endif |
43 | 47 |
| 48 void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread)
; |
| 49 |
| 50 opus_val16 op_pvq_search_c(celt_norm *X, int *iy, int K, int N, int arch); |
| 51 |
| 52 #if !defined(OVERRIDE_OP_PVQ_SEARCH) |
| 53 #define op_pvq_search(x, iy, K, N, arch) \ |
| 54 (op_pvq_search_c(x, iy, K, N, arch)) |
| 55 #endif |
44 | 56 |
45 /** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of | 57 /** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of |
46 * the pitch and a combination of pulses such that its norm is still equal | 58 * the pitch and a combination of pulses such that its norm is still equal |
47 * to 1. This is the function that will typically require the most CPU. | 59 * to 1. This is the function that will typically require the most CPU. |
48 * @param X Residual signal to quantise/encode (returns quantised version) | 60 * @param X Residual signal to quantise/encode (returns quantised version) |
49 * @param N Number of samples to encode | 61 * @param N Number of samples to encode |
50 * @param K Number of pulses to use | 62 * @param K Number of pulses to use |
51 * @param enc Entropy encoder state | 63 * @param enc Entropy encoder state |
52 * @ret A mask indicating which blocks in the band received pulses | 64 * @ret A mask indicating which blocks in the band received pulses |
53 */ | 65 */ |
54 unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, | 66 unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc, |
55 ec_enc *enc | 67 opus_val16 gain, int resynth, int arch); |
56 #ifdef RESYNTH | |
57 , opus_val16 gain | |
58 #endif | |
59 ); | |
60 | 68 |
61 /** Algebraic pulse decoder | 69 /** Algebraic pulse decoder |
62 * @param X Decoded normalised spectrum (returned) | 70 * @param X Decoded normalised spectrum (returned) |
63 * @param N Number of samples to decode | 71 * @param N Number of samples to decode |
64 * @param K Number of pulses to use | 72 * @param K Number of pulses to use |
65 * @param dec Entropy decoder state | 73 * @param dec Entropy decoder state |
66 * @ret A mask indicating which blocks in the band received pulses | 74 * @ret A mask indicating which blocks in the band received pulses |
67 */ | 75 */ |
68 unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B, | 76 unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B, |
69 ec_dec *dec, opus_val16 gain); | 77 ec_dec *dec, opus_val16 gain); |
70 | 78 |
71 void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch); | 79 void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch); |
72 | 80 |
73 int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N, int
arch); | 81 int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N, int
arch); |
74 | 82 |
75 #endif /* VQ_H */ | 83 #endif /* VQ_H */ |
OLD | NEW |