Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Chromium
third_party/opus/src/celt/celt_encoder.c
static int patch_transient_decision(opus_val16 *newE, opus_val16 *oldE, int nbEBands, int start, int end, int C) { int i, c; opus_val32 mean_diff = 0; opus_val16 spread_old[26]; if (C == 1) { spread_old[start] = oldE[start]; for (i = start + 1; i < end; i++) sp...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/celt_encoder.c
static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *OPUS_RESTRICT in, celt_sig *OPUS_RESTRICT out, int C, int CC, int LM, int upsample, int arch) { const int overlap = mode->overlap; int N; int B; int shift; i...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/celt_encoder.c
static int stereo_analysis(const CELTMode *m, const celt_norm *X, int LM, int N0) { int i; int thetas; opus_val32 sumLR = EPSILON, sumMS = EPSILON; for (i = 0; i < 13; i++) { int j; for (j = m->eBands[i] << LM; j < m->eBands[i + 1] << LM; j++) { opus_val32 L, R, M, S; ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/cwrs.c
void encode_pulses(const int *_y, int _n, int _k, ec_enc *_enc) { celt_assert(_k > 0); ec_enc_uint(_enc, icwrs(_n, _y), CELT_PVQ_V(_n, _k)); }
[ 0, 0 ]
Chromium
third_party/opus/src/celt/cwrs.c
opus_val32 decode_pulses(int *_y, int _n, int _k, ec_dec *_dec) { return cwrsi(_n, _k, ec_dec_uint(_dec, CELT_PVQ_V(_n, _k)), _y); } #else
[ 0, 0 ]
Chromium
third_party/opus/src/celt/cwrs.c
static opus_uint32 ncwrs_urow(unsigned _n, unsigned _k, opus_uint32 *_u) { opus_uint32 um2; unsigned len; unsigned k; len = _k + 2; celt_assert(len >= 3); _u[0] = 0; _u[1] = um2 = 1; /*If _n==0, _u[0] should be 1 and the rest should be 0.*/ /*If _n==1, _u[i] should be 1 for i>1.*/ celt_assert(_n >=...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/cwrs.c
static OPUS_INLINE opus_uint32 icwrs1(const int *_y, int *_k) { *_k = abs(_y[0]); return _y[0] < 0; }
[ 0, 0 ]
Chromium
third_party/opus/src/celt/cwrs.c
static OPUS_INLINE opus_uint32 icwrs(int _n, int _k, opus_uint32 *_nc, const int *_y, opus_uint32 *_u) { opus_uint32 i; int j; int k; celt_assert(_n >= 2); _u[0] = 0; for (k = 1; k <= _k + 1; k++) _u[k] = (k << 1) - 1; i = icwrs1(_y + _n - 1, &k); j = _n - 2; ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/cwrs.c
void get_required_bits(opus_int16 *_bits, int _n, int _maxk, int _frac) { int k; celt_assert(_maxk > 0); _bits[0] = 0; if (_n == 1) { for (k = 1; k <= _maxk; k++) _bits[k] = 1 << _frac; } else { VARDECL(opus_uint32, u); SAVE_STACK; ALLOC(u, _maxk + 2U, opus_uint32); ncwrs_urow(_n, _...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/entcode.c
int ec_ilog(opus_uint32 _v) { int ret; int m; ret = !!_v; m = !!(_v & 0xFFFF0000) << 4; _v >>= m; ret |= m; m = !!(_v & 0xFF00) << 3; _v >>= m; ret |= m; m = !!(_v & 0xF0) << 2; _v >>= m; ret |= m; m = !!(_v & 0xC) << 1; _v >>= m; ret |= m; ret += !!(_v & 0x2); return ret; }
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entcode.c
opus_uint32 ec_tell_frac(ec_ctx *_this) { static const unsigned correction[8] = {35733, 38967, 42495, 46340, 50535, 55109, 60097, 65535}; opus_uint32 nbits; opus_uint32 r; int l; unsigned b; nbits = _this->nbits_total << BITRES; l = EC_ILOG(_this->rng); r = _this...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entcode.c
opus_uint32 ec_tell_frac(ec_ctx *_this) { opus_uint32 nbits; opus_uint32 r; int l; int i; nbits = _this->nbits_total << BITRES; l = EC_ILOG(_this->rng); r = _this->rng >> (l - 16); for (i = BITRES; i-- > 0;) { int b; r = r * r >> 15; b = (int)(r >> 16); l = l << 1 | b; r >>= b; } ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entcode.h
static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this) { return _this->offs; }
[ 0, 0 ]
Chromium
third_party/opus/src/celt/entdec.c
void ec_dec_init(ec_dec *_this, unsigned char *_buf, opus_uint32 _storage) { _this->buf = _buf; _this->storage = _storage; _this->end_offs = 0; _this->end_window = 0; _this->nend_bits = 0; _this->nbits_total = EC_CODE_BITS + 1 - ((EC_CODE_BITS - EC_CODE_EXTRA) / EC_SYM_BITS) * EC_SYM_BITS; _t...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entdec.c
int ec_dec_icdf(ec_dec *_this, const unsigned char *_icdf, unsigned _ftb) { opus_uint32 r; opus_uint32 d; opus_uint32 s; opus_uint32 t; int ret; s = _this->rng; d = _this->val; r = s >> _ftb; ret = -1; do { t = s; s = IMUL32(r, _icdf[++ret]); } while (d < s); _this->val = d - s; _this...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/entdec.c
opus_uint32 ec_dec_uint(ec_dec *_this, opus_uint32 _ft) { unsigned ft; unsigned s; int ftb; celt_assert(_ft > 1); _ft--; ftb = EC_ILOG(_ft); if (ftb > EC_UINT_BITS) { opus_uint32 t; ftb -= EC_UINT_BITS; ft = (unsigned)(_ft >> ftb) + 1; s = ec_decode(_this, ft); ec_dec_update(_this, s,...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/entenc.c
static int ec_write_byte(ec_enc *_this, unsigned _value) { if (_this->offs + _this->end_offs >= _this->storage) return -1; _this->buf[_this->offs++] = (unsigned char)_value; return 0; }
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entenc.c
static OPUS_INLINE void ec_enc_normalize(ec_enc *_this) { while (_this->rng <= EC_CODE_BOT) { ec_enc_carry_out(_this, (int)(_this->val >> EC_CODE_SHIFT)); /*Move the next-to-high-order symbol into the high-order position.*/ _this->val = (_this->val << EC_SYM_BITS) & (EC_CODE_TOP - 1); _this->rng <<= ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entenc.c
void ec_enc_init(ec_enc *_this, unsigned char *_buf, opus_uint32 _size) { _this->buf = _buf; _this->end_offs = 0; _this->end_window = 0; _this->nend_bits = 0; _this->nbits_total = EC_CODE_BITS + 1; _this->offs = 0; _this->rng = EC_CODE_TOP; _this->rem = -1; _this->val = 0; _this->ext = 0; _this->...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/entenc.c
void ec_enc_uint(ec_enc *_this, opus_uint32 _fl, opus_uint32 _ft) { unsigned ft; unsigned fl; int ftb; celt_assert(_ft > 1); _ft--; ftb = EC_ILOG(_ft); if (ftb > EC_UINT_BITS) { ftb -= EC_UINT_BITS; ft = (_ft >> ftb) + 1; fl = (unsigned)(_fl >> ftb); ec_encode(_this, fl, fl + 1, ft); ...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/entenc.c
void ec_enc_patch_initial_bits(ec_enc *_this, unsigned _val, unsigned _nbits) { int shift; unsigned mask; celt_assert(_nbits <= EC_SYM_BITS); shift = EC_SYM_BITS - _nbits; mask = ((1 << _nbits) - 1) << shift; if (_this->offs > 0) { _this->buf[0] = (unsigned char)((_this->buf[0] & ~mask) | _val << shift...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/entenc.c
void ec_enc_shrink(ec_enc *_this, opus_uint32 _size) { celt_assert(_this->offs + _this->end_offs <= _size); OPUS_MOVE(_this->buf + _size - _this->end_offs, _this->buf + _this->storage - _this->end_offs, _this->end_offs); _this->storage = _size; }
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_c5x.h
static OPUS_INLINE long IMUL32(long i, long j) { long ac0, ac1; ac0 = _lmpy(i >> 16, j); ac1 = ac0 + _lmpy(i, j >> 16); return _lmpyu(i, j) + (ac1 << 16); } #undef MAX16 #define MAX16(a, b) _max(a, b) #undef MIN16 #define MIN16(a, b) _min(a, b) #undef MAX32 #define MAX32(a, b) _lmax(a, b) #undef MIN32 #defin...
[ 0, 1 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short NEG16(int x) { int res; if (!VERIFY_SHORT(x)) { fprintf(stderr, "NEG16: input is not short: %d\n", (int)x); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = -x; if (!VERIFY_SHORT(res)) { fprintf(stderr, "NEG16: output is not short: %d\n", (int)res); #ifdef FIXED_D...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short EXTRACT16_(int x, char *file, int line) { int res; if (!VERIFY_SHORT(x)) { fprintf(stderr, "EXTRACT16: input is not short: %d in %s: line %d\n", x, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = x; celt_mips++; return res; } #define EXTEND...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short SHR16_(int a, int shift, char *file, int line) { int res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) { fprintf(stderr, "SHR16: inputs are not short: %d >> %d in %s: line %d\n", a, shift, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = a >> sh...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short SHL16_(int a, int shift, char *file, int line) { int res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) { fprintf(stderr, "SHL16: inputs are not short: %d %d in %s: line %d\n", a, shift, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = a << shift...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short ADD16_(int a, int b, char *file, int line) { int res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) { fprintf(stderr, "ADD16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = a + b; if (!VERIFY_S...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE int SUB32_(opus_int64 a, opus_int64 b, char *file, int line) { opus_int64 res; if (!VERIFY_INT(a) || !VERIFY_INT(b)) { fprintf(stderr, "SUB32: inputs are not int: %d %d in %s: line %d\n", (int)a, (int)b, file, line); #ifdef FIXED_DEBUG_ASSERT celt...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int line) { opus_uint64 res; if (!VERIFY_UINT(a) || !VERIFY_UINT(b)) { fprintf(stderr, "USUB32: inputs are not uint32: %llu %llu in %s: line %d\n", a, b, file, line); #ifdef FIXE...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line) { opus_int64 res; if (!VERIFY_SHORT(a) || !VERIFY_INT(b)) { fprintf(stderr, "MULT16_32_Q%d: inputs are not short+int: %d %d in %s: line %d\n", Q, (int)a, (int)b, fi...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int line) { opus_int64 res; if (!VERIFY_SHORT(a) || !VERIFY_INT(b)) { fprintf(stderr, "MULT16_32_P%d: inputs are not short+int: %d %d in %s: line %d\n\n", Q, (int)a, (int)b, ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE int SATURATE(int a, int b) { if (a > b) a = b; if (a < -b) a = -b; celt_mips += 3; return a; }
[ 0, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short MULT16_16_Q14(int a, int b) { opus_int64 res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) { fprintf(stderr, "MULT16_16_Q14: inputs are not short: %d %d\n", a, b); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = ((opus_int64)a) * b; res >>= 14; if (!VERIFY_SHORT(res)) ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short MULT16_16_Q15_(int a, int b, char *file, int line) { opus_int64 res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) { fprintf(stderr, "MULT16_16_Q15: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short MULT16_16_P13(int a, int b) { opus_int64 res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) { fprintf(stderr, "MULT16_16_P13: inputs are not short: %d %d\n", a, b); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = ((opus_int64)a) * b; res += 4096; if (!VERIFY_INT(res)) ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE short MULT16_16_P14(int a, int b) { opus_int64 res; if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) { fprintf(stderr, "MULT16_16_P14: inputs are not short: %d %d\n", a, b); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif } res = ((opus_int64)a) * b; res += 8192; if (!VERIFY_INT(res)) {...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/fixed_debug.h
static OPUS_INLINE int DIV32_16_(opus_int64 a, opus_int64 b, char *file, int line) { opus_int64 res; if (b == 0) { fprintf(stderr, "DIV32_16: divide by zero: %d/%d in %s: line %d\n", (int)a, (int)b, file, line); #ifdef FIXED_DEBUG_ASSERT celt_assert(0); #endif ...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/float_cast.h
static OPUS_INLINE opus_int32 float2int(float x) { return _mm_cvt_ss2si(_mm_set_ss(x)); } #elif defined(HAVE_LRINTF) #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC9X 1 #define __USE_ISOC99 1 #include <math.h> #define float2int(x) lrintf(x) #elif (defined(HAVE_LRINT)) #define _ISOC9X_SOURCE...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/float_cast.h
**Therefore implement OPUS_INLINE versions of these functions here.* / static __inline long int float2int(float flt) { int intgr; _asm { fld flt fistp intgr } ; return intgr; } #else #if (defined(__GNUC__) && defined(__STDC__) && __STDC__ && ...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/kiss_fft.c
static void compute_twiddles(kiss_twiddle_cpx *twiddles, int nfft) { int i; #ifdef FIXED_POINT for (i = 0; i < nfft; ++i) { opus_val32 phase = -i; kf_cexp2(twiddles + i, DIV32(SHL32(phase, 17), nfft)); } #else for (i = 0; i < nfft; ++i) { const double pi = 3.14159265358979323846264338327; doubl...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/kiss_fft.c
void opus_fft_c(const kiss_fft_state *st, const kiss_fft_cpx *fin, kiss_fft_cpx *fout) { int i; opus_val16 scale; #ifdef FIXED_POINT int scale_shift = st->scale_shift - 1; #endif scale = st->scale; celt_assert2(fin != fout, "In-place FFT not supported"); /* Bit-reverse the input */ for (...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/kiss_fft.c
void opus_ifft_c(const kiss_fft_state *st, const kiss_fft_cpx *fin, kiss_fft_cpx *fout) { int i; celt_assert2(fin != fout, "In-place FFT not supported"); for (i = 0; i < st->nfft; i++) fout[st->bitrev[i]] = fin[i]; for (i = 0; i < st->nfft; i++) fout[i].i = -fout[i].i; opus_fft_impl(...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/laplace.c
void ec_laplace_encode(ec_enc *enc, int *value, unsigned fs, int decay) { unsigned fl; int val = *value; fl = 0; if (val) { int s; int i; s = -(val < 0); val = (val + s) ^ s; fl = fs; fs = ec_laplace_get_freq1(fs, decay); for (i = 1; fs > 0 && i < val; i++) { fs *= 2; fl...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/laplace.c
int ec_laplace_decode(ec_dec *dec, unsigned fs, int decay) { int val = 0; unsigned fl; unsigned fm; fm = ec_decode_bin(dec, 15); fl = 0; if (fm >= fs) { val++; fl = fs; fs = ec_laplace_get_freq1(fs, decay) + LAPLACE_MINP; while (fs > LAPLACE_MINP && fm >= fl + 2 * fs) { fs *= 2; ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/mathops.c
opus_val32 frac_div32(opus_val32 a, opus_val32 b) { opus_val16 rcp; opus_val32 result, rem; int shift = celt_ilog2(b) - 29; a = VSHR32(a, shift); b = VSHR32(b, shift); rcp = ROUND16(celt_rcp(ROUND16(b, 16)), 3); result = MULT16_32_Q15(rcp, a); rem = PSHR32(a, 2) - MULT32_32_Q31(result, b); result = A...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mathops.c
static OPUS_INLINE opus_val16 _celt_cos_pi_2(opus_val16 x) { opus_val16 x2; x2 = MULT16_16_P15(x, x); return ADD16( 1, MIN16(32766, ADD32(SUB16(L1, x2), MULT16_16_P15( x2, ADD32(L2, MULT16_16_P15( ...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mathops.h
static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len) { int i; opus_val32 maxval = 0; opus_val32 minval = 0; for (i = 0; i < len; i++) { maxval = MAX32(maxval, x[i]); minval = MIN32(minval, x[i]); } return MAX32(maxval, -minval); } #else #define celt_maxabs32(x, len) celt_maxabs1...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mathops.h
static OPUS_INLINE opus_val16 celt_atan2p(opus_val16 y, opus_val16 x) { if (y < x) { opus_val32 arg; arg = celt_div(SHL32(EXTEND32(y), 15), x); if (arg >= 32767) arg = 32767; return SHR16(celt_atan01(EXTRACT16(arg)), 1); } else { opus_val32 arg; arg = celt_div(SHL32(EXTEND32(x), 15), y...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mdct.c
int clt_mdct_init(mdct_lookup *l, int N, int maxshift, int arch) { int i; kiss_twiddle_scalar *trig; int shift; int N2 = N >> 1; l->n = N; l->maxshift = maxshift; for (i = 0; i <= maxshift; i++) { if (i == 0) l->kfft[i] = opus_fft_alloc(N >> 2 >> i, 0, 0, arch); else l->kfft[i] = opus_...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/mips/fixed_generic_mipsr1.h
static inline int MULT16_32_Q15_ADD(int a, int b, int c, int d) { int m; asm volatile("MULT $ac1, %0, %1" : : "r"((int)a), "r"((int)b)); asm volatile("madd $ac1, %0, %1" : : "r"((int)c), "r"((int)d)); asm volatile("EXTR.W %0,$ac1, %1" : "=r"(m) : "i"(15)); return m; } #undef MULT16_32_Q15_SUB
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mips/fixed_generic_mipsr1.h
static inline int MULT16_32_Q15_SUB(int a, int b, int c, int d) { int m; asm volatile("MULT $ac1, %0, %1" : : "r"((int)a), "r"((int)b)); asm volatile("msub $ac1, %0, %1" : : "r"((int)c), "r"((int)d)); asm volatile("EXTR.W %0,$ac1, %1" : "=r"(m) : "i"(15)); return m; } #undef MULT16_16_Q15_ADD
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mips/fixed_generic_mipsr1.h
static inline int MULT16_16_Q15_SUB(int a, int b, int c, int d) { int m; asm volatile("MULT $ac1, %0, %1" : : "r"((int)a), "r"((int)b)); asm volatile("msub $ac1, %0, %1" : : "r"((int)c), "r"((int)d)); asm volatile("EXTR.W %0,$ac1, %1" : "=r"(m) : "i"(15)); return m; } #undef MULT16_32_Q16
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mips/fixed_generic_mipsr1.h
static inline int MULT16_32_Q16(int a, int b) { int c; asm volatile("MULT $ac1,%0, %1" : : "r"(a), "r"(b)); asm volatile("EXTR.W %0,$ac1, %1" : "=r"(c) : "i"(16)); return c; } #undef MULT16_32_P16
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mips/fixed_generic_mipsr1.h
static inline int MULT32_32_Q31(int a, int b) { int r; asm volatile("MULT $ac1, %0, %1" : : "r"(a), "r"(b)); asm volatile("EXTR.W %0,$ac1, %1" : "=r"(r) : "i"(31)); return r; } #undef PSHR32
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mips/fixed_generic_mipsr1.h
static inline int PSHR32(int a, int shift) { int r; asm volatile("SHRAV_R.W %0, %1, %2" : "=r"(r) : "r"(a), "r"(shift)); return r; } #undef MULT16_16_P15
[ 0, 0 ]
Chromium
third_party/opus/src/celt/mips/vq_mipsr1.h
void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch) { int i; #ifdef FIXED_POINT int k; #endif opus_val32 E = EPSILON; opus_val16 g; opus_val32 t; celt_norm *xptr = X; int X0, X1; (void)arch; asm volatile("mult $ac1, $0, $0"); asm volatile("MTLO %0, $ac1" : : "r"(E)); for (i ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/pitch.c
static opus_val16 compute_pitch_gain(opus_val32 xy, opus_val32 xx, opus_val32 yy) { opus_val32 x2y2; int sx, sy, shift; opus_val32 g; opus_val16 den; if (xy == 0 || xx == 0 || yy == 0) return 0; sx = celt_ilog2(xx) - 14; sy = celt_ilog2(yy) - 14; shift = sx + sy;...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/quant_bands.c
static opus_val32 loss_distortion(const opus_val16 *eBands, opus_val16 *oldEBands, int start, int end, int len, int C) { int c, i; opus_val32 dist = 0; c = 0; do { for (i = start; i < end; i++) { opus_val16 d = SUB16(SHR16(eBands[i +...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/quant_bands.c
void quant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *oldEBands, opus_val16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int C) { int i, prio, c; for (prio = 0; prio < 2; prio++) { ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/quant_bands.c
void unquant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int *fine_quant, ec_dec *dec, int C) { int i, c; for (i = start; i < end; i++) { if (fine_quant[i] <= 0) continue; c = 0; do { int q2; opus_val16 of...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/rate.h
static OPUS_INLINE int get_pulses(int i) { return i < 8 ? i : (8 + (i & 7)) << ((i >> 3) - 1); }
[ 0, 0 ]
Chromium
third_party/opus/src/celt/rate.h
static OPUS_INLINE int pulses2bits(const CELTMode *m, int band, int LM, int pulses) { const unsigned char *cache; LM++; cache = m->cache.bits + m->cache.index[LM * m->nbEBands + band]; return pulses == 0 ? 0 : cache[pulses] + 1; }
[ 1, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_dft.c
void test1d(int nfft, int isinverse, int arch) { size_t buflen = sizeof(kiss_fft_cpx) * nfft; kiss_fft_cpx *in; kiss_fft_cpx *out; int k; #ifdef CUSTOM_MODES kiss_fft_state *cfg = opus_fft_alloc(nfft, 0, 0, arch); #else int id; const kiss_fft_state *cfg; CELTMode *mode = opus_custom_mode_create(48000, 9...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_mathops.c
void testbitexactlog2tan(void) { int i, fail; opus_int32 min_d, max_d, last, chk; fail = chk = max_d = 0; last = min_d = 15059; for (i = 64; i < 8193; i++) { opus_int32 d; opus_int32 mid = bitexact_cos(i); opus_int32 side = bitexact_cos(16384 - i); opus_int32 q = bitexact_log2tan(mid, side); ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_mathops.c
void testexp2(void) { float x; for (x = -11.0; x < 24.0; x += 0.0007) { float error = fabs(x - (1.442695040888963387 * log(celt_exp2(x)))); if (error > 0.0002) { fprintf(stderr, "celt_exp2 failed: " "fabs(x-(1.442695040888963387*log(celt_exp2(x))))>0.0005 (x = " ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_mathops.c
void testlog2(void) { opus_val32 x; for (x = 8; x < 1073741824; x += (x >> 3)) { float error = fabs((1.442695040888963387 * log(x / 16384.0)) - celt_log2(x) / 1024.0); if (error > 0.003) { fprintf(stderr, "celt_log2 failed: x = %ld, error = %f\n", (long)x, error); ret = 1; ...
[ 0, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_mathops.c
void testilog2(void) { opus_val32 x; for (x = 1; x <= 268435455; x += 127) { opus_val32 lg; opus_val32 y; lg = celt_ilog2(x); if (lg < 0 || lg >= 31) { printf("celt_ilog2 failed: 0<=celt_ilog2(x)<31 (x = %d, celt_ilog2(x) = " "%d)\n", x, lg); ret = 1; } ...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_mdct.c
void check(kiss_fft_scalar *in, kiss_fft_scalar *out, int nfft, int isinverse) { int bin, k; double errpow = 0, sigpow = 0; double snr; for (bin = 0; bin < nfft / 2; ++bin) { double ansr = 0; double difr; for (k = 0; k < nfft; ++k) { double phase = 2 * M_PI * (k + .5 + .25 * nfft) * (bin + .5...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/tests/test_unit_mdct.c
void check_inv(kiss_fft_scalar *in, kiss_fft_scalar *out, int nfft, int isinverse) { int bin, k; double errpow = 0, sigpow = 0; double snr; for (bin = 0; bin < nfft; ++bin) { double ansr = 0; double difr; for (k = 0; k < nfft / 2; ++k) { double phase = 2 * M_PI * (bin + .5 + .2...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/vq.c
static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s) { int i; opus_val16 ms; celt_norm *Xptr; Xptr = X; ms = NEG16(s); for (i = 0; i < len - stride; i++) { celt_norm x1, x2; x1 = Xptr[0]; x2 = Xptr[stride]; Xptr[stride] = EXTRACT1...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/x86/celt_lpc_sse4_1.c
void celt_fir_sse4_1(const opus_val16 *x, const opus_val16 *num, opus_val16 *y, int N, int ord, int arch) { int i, j; VARDECL(opus_val16, rnum); __m128i vecNoA; opus_int32 noA; SAVE_STACK; ALLOC(rnum, ord, opus_val16); for (i = 0; i < ord; i++) rnum[i] = num[ord - i - 1]; noA...
[ 1, 0 ]
Chromium
third_party/opus/src/celt/x86/pitch_sse.c
opus_val32 celt_inner_prod_sse(const opus_val16 *x, const opus_val16 *y, int N) { int i; float xy; __m128 sum; sum = _mm_setzero_ps(); /* FIXME: We should probably go 8-way and use 2 sums. */ for (i = 0; i < N - 3; i += 4) { __m128 xi = _mm_loadu_ps(x + i); __m128 yi =...
[ 1, 1 ]
Chromium
third_party/opus/src/silk/A2NLSF.c
static OPUS_INLINE void silk_A2NLSF_trans_poly( opus_int32 *p, const opus_int dd /* I Polynomial order (= filter order / 2 ) */ ) { opus_int k, n; for (k = 2; k <= dd; k++) { for (n = dd; n > k; n--) { p[n - 2] -= p[n]; } p[k - 2] -= silk_LSHIFT(p[k], 1); } }
[ 0, 0 ]
Chromium
third_party/opus/src/silk/A2NLSF.c
static OPUS_INLINE opus_int32 silk_A2NLSF_eval_poly( opus_int32 *p, const opus_int32 x, /* I Evaluation point, Q12 */ const opus_int dd /* I Order */ ) { opus_int n; opus_int32 x_Q16, y32; y32 = p[dd]; /* Q16 */ x_Q16 = silk_LSHIFT(x, 4); if (opus_likely(8 == ...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/A2NLSF.c
static OPUS_INLINE void silk_A2NLSF_init(const opus_int32 *a_Q16, opus_int32 *P, opus_int32 *Q, const opus_int dd) { opus_int k; P[dd] = silk_LSHIFT(1, 16); Q[dd] = silk_LSHIFT(1, 16); for (k = 0; k < dd; k++) { P[k] = -a_Q16[dd - k - 1] - a_Q16[dd + k]; /* Q16 */ ...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/macros_armv4.h
static OPUS_INLINE opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b) { unsigned rd_lo; int rd_hi; __asm__("#silk_SMULWB\n\t" "smull %0, %1, %2, %3\n\t" : "=&r"(rd_lo), "=&r"(rd_hi) : "%r"(a), "r"(SAFE_SHL(b, 16))); return rd_hi; } #define silk_SMULWB(a, b) (silk_SMULWB_armv4...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/macros_armv4.h
static OPUS_INLINE opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b) { unsigned rd_lo; int rd_hi; __asm__("#silk_SMULWW\n\t" "smull %0, %1, %2, %3\n\t" : "=&r"(rd_lo), "=&r"(rd_hi) : "%r"(a), "r"(b)); return SAFE_SHL(rd_hi, 16) + (rd_lo >> 16); } #define silk_SMULWW(a, b) (s...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/macros_armv5e.h
static OPUS_INLINE opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b, opus_int32 c) { int res; __asm__("#silk_SMLAWT\n\t" "smlawt %0, %1, %2, %3\n\t" : "=r"(res) : "r"(b), "r"(c), "r"(a)); return res; } #define silk_SMLAWT(a, b,...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/macros_armv5e.h
static OPUS_INLINE opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b, opus_int32 c) { int res; __asm__("#silk_SMLABB\n\t" "smlabb %0, %1, %2, %3\n\t" : "=r"(res) : "%r"(b), "r"(c), "r"(a)); return res; } #define silk_SMLABB(a, b...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/macros_armv5e.h
static OPUS_INLINE opus_int32 silk_CLZ16_armv5(opus_int16 in16) { int res; __asm__("#silk_CLZ16\n\t" "clz %0, %1;\n" : "=r"(res) : "r"(SAFE_SHL(in16, 16) | 0x8000)); return res; } #define silk_CLZ16(in16) (silk_CLZ16_armv5(in16)) #undef silk_CLZ32
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/NSQ_del_dec_neon_intr.c
static OPUS_INLINE void silk_SMULWB_8_neon(const opus_int16 *a, const int32x2_t b, opus_int32 *o) { const int16x8_t a_s16x8 = vld1q_s16(a); int32x4_t o0_s32x4, o1_s32x4; o0_s32x4 = vshll_n_s16(vget_low_s16(a_s16x8), 15); o1_s32x4 = vshll_n_s16(vget_high_s16(a_s16x8),...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/NSQ_del_dec_neon_intr.c
static OPUS_INLINE void silk_SMULWW_4_neon(opus_int32 *a, const int32x2_t b_s32x2) { int32x4_t a_s32x4, o_s32x4; a_s32x4 = vld1q_s32(a); o_s32x4 = vqdmulhq_lane_s32(a_s32x4, b_s32x2, 0); o_s32x4 = vmlaq_lane_s32(o_s32x4, a_s32x4, b_s32x2, 1); vst1q_s32(a, o_s32x4);...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/arm/NSQ_neon.c
opus_int32 silk_noise_shape_quantizer_short_prediction_neon( const opus_int32 *buf32, const opus_int32 *coef32, opus_int order) { int32x4_t coef0 = vld1q_s32(coef32); int32x4_t coef1 = vld1q_s32(coef32 + 4); int32x4_t coef2 = vld1q_s32(coef32 + 8); int32x4_t coef3 = vld1q_s32(coef32 + 12); int32x4_t a0 ...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/bwexpander.c
void silk_bwexpander( opus_int16 *ar, const opus_int d, /* I Length of ar */ opus_int32 chirp_Q16 /* I Chirp factor (typically in the range 0 to 1) */ ) { opus_int i; opus_int32 chirp_minus_one_Q16 = chirp_Q16 - 65536; /* NB: Dont use silk_SMULWB, instead of silk_RSHIFT_ROUND( silk_MUL(), 16 ), ...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/debug.c
unsigned long GetHighResolutionTime(void) { struct timeval tv; gettimeofday(&tv, 0); return ((tv.tv_sec * 1000000) + (tv.tv_usec)); } #endif
[ 0, 0 ]
Chromium
third_party/opus/src/silk/debug.c
void silk_TimerSave(char *file_name) { if (silk_Timer_nTimers > 0) { int k; FILE *fp; fp = fopen(file_name, "w"); fprintf(fp, " min avg max " " count\n"); for (k = 0; k < silk_Timer_nTimers; k++) { if (silk_Timer_depth[k] ==...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/enc_API.c
opus_int silk_InitEncoder(/* O Returns error code */ void *encState, /* I/O State */ int arch, /* I Run-time architecture */ silk_EncControlStruct *encStatus /* O Encoder Status */ ) { silk_encoder *psEnc; opus_int...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/fixed/k2a_FIX.c
void silk_k2a( opus_int32 *A_Q24, const opus_int16 *rc_Q15, /* I Reflection coefficients [order] Q15 */ const opus_int32 order /* I Prediction order */ ) { opus_int k, n; opus_int32 rc, tmp1, tmp2; for (k = 0; k < order; k++) { rc = rc_Q15[k]; for (n = 0; n < (k + 1) >> 1; n++) { ...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/fixed/LTP_scale_ctrl_FIX.c
void silk_LTP_scale_ctrl_FIX( silk_encoder_state_FIX *psEnc, silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control */ opus_int condCoding /* I The type of conditional coding to use */ ) { opus_int round_loss; if (condCoding == CODE_INDEPENDENTLY) { /* Only scale if first frame in packet *...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/fixed/noise_shape_analysis_FIX.c
static OPUS_INLINE opus_int32 warped_gain(const opus_int32 *coefs_Q24, opus_int lambda_Q16, opus_int order) { opus_int i; opus_int32 gain_Q24; lambda_Q16 = -lambda_Q16; gain_Q24 = coefs_Q24[order - 1]; for (i = order - 2; i >= 0; i--) { gain_Q24 = silk_SMLAWB(coe...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/fixed/vector_ops_FIX.c
opus_int64 silk_inner_prod16_aligned_64_c( const opus_int16 *inVec1, const opus_int16 *inVec2, /* I input vector 2 */ const opus_int len /* I vector lengths */ ) { opus_int i; opus_int64 sum = 0; for (i = 0; i < len; i++) { sum = silk_SMLALBB(sum, inVec1[i], inVec2[i]); } r...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/float/corrMatrix_FLP.c
void silk_corrMatrix_FLP( const silk_float *x, const opus_int L, /* I Length of vectors */ const opus_int Order, /* I Max lag for correlation */ silk_float *XX /* O X'*X correlation matrix [order x order] */ ) { opus_int j, lag; double energy; const silk_float *...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/float/inner_product_FLP.c
double silk_inner_product_FLP(const silk_float *data1, const silk_float *data2, opus_int dataSize) { opus_int i; double result; result = 0.0; for (i = 0; i < dataSize - 3; i += 4) { result += data1[i + 0] * (double)data2[i + 0] + data1[i + 1] * (double)data2[i + ...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/float/LPC_analysis_filter_FLP.c
static OPUS_INLINE void silk_LPC_analysis_filter8_FLP( silk_float r_LPC[], const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ const opus_int length /* I Length of input signal */ ) { opus_int ix; silk_floa...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/float/LPC_analysis_filter_FLP.c
static OPUS_INLINE void silk_LPC_analysis_filter6_FLP( silk_float r_LPC[], const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ const opus_int length /* I Length of input signal */ ) { opus_int ix; silk_floa...
[ 0, 0 ]
Chromium
third_party/opus/src/silk/float/LPC_analysis_filter_FLP.c
void silk_LPC_analysis_filter_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ const opus_int length, /* I Length of input signal */ ...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/float/LPC_inv_pred_gain_FLP.c
silk_float silk_LPC_inverse_pred_gain_FLP( const silk_float *A, opus_int32 order /* I prediction order */ ) { opus_int k, n; double invGain, rc, rc_mult1, rc_mult2, tmp1, tmp2; silk_float Atmp[SILK_MAX_ORDER_LPC]; silk_memcpy(Atmp, A, order * sizeof(silk_float)); invGain = 1.0; for (k = order - 1; ...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/float/LTP_analysis_filter_FLP.c
void silk_LTP_analysis_filter_FLP( silk_float *LTP_res, const silk_float *x, /* I Input signal, with preceding samples */ const silk_float B[LTP_ORDER * MAX_NB_SUBFR], /* I LTP coefficients for each subframe */ const opus_int pit...
[ 1, 0 ]
Chromium
third_party/opus/src/silk/float/noise_shape_analysis_FLP.c
static OPUS_INLINE void limit_coefs(silk_float *coefs, silk_float limit, opus_int order) { opus_int i, iter, ind = 0; silk_float tmp, maxabs, chirp; for (iter = 0; iter < 10; iter++) { maxabs = -1.0f; for (i = 0; i < order; i++) { tmp = silk_abs_float(coefs[i]);...
[ 0, 0 ]