diff options
author | Timothy B. Terriberry <tterribe@xiph.org> | 2009-05-26 17:09:27 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2009-05-27 03:07:41 +0400 |
commit | d98d8ae087844c616c1f187265ae9d20dea54207 (patch) | |
tree | 14ab3940384d72f11946558d750603e15c0377b1 /libcelt/cwrs.h | |
parent | 1cca151671509a2c0f7383fe98a1298c37d4fdbd (diff) |
CWRS clean-ups and optimizations.
Adds specialized O(N*log(K)) versions of cwrsi() and O(N) versions of icwrs()
for N={3,4,5}, which allows them to operate all the way up to the theoretical
pulse limit without serious performance degredation.
Also substantially reduces the computation time and stack usage of
get_required_bits().
On x86-64, this gives a 2% speed-up for 256 sample frames, and almost a 16%
speed-up for 64 sample frames.
Diffstat (limited to 'libcelt/cwrs.h')
-rw-r--r-- | libcelt/cwrs.h | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/libcelt/cwrs.h b/libcelt/cwrs.h index eabdf75..6da0875 100644 --- a/libcelt/cwrs.h +++ b/libcelt/cwrs.h @@ -38,29 +38,8 @@ int log2_frac(ec_uint32 val, int frac); -/* Returns log of an integer with fractional accuracy */ -int log2_frac64(ec_uint64 val, int frac); /* Whether the CWRS codebook will fit into 32 bits */ int fits_in32(int _n, int _m); -/* Whether the CWRS codebook will fit into 64 bits */ -int fits_in64(int _n, int _m); - -/* 32-bit versions */ -celt_uint32_t ncwrs_u32(int _n,int _m,celt_uint32_t *_u); - -void cwrsi32(int _n,int _m,celt_uint32_t _i,int *_y,celt_uint32_t *_u); - -celt_uint32_t icwrs32(int _n,int _m,celt_uint32_t *_nc,const int *_y, - celt_uint32_t *_u); - -/* 64-bit versions */ -celt_uint64_t ncwrs_u64(int _n,int _m,celt_uint64_t *_u); - -void cwrsi64(int _n,int _m,celt_uint64_t _i,int *_y,celt_uint64_t *_u); - -celt_uint64_t icwrs64(int _n,int _m,celt_uint64_t *_nc,const int *_y, - celt_uint64_t *_u); - void get_required_bits(celt_int16_t *bits, int N, int K, int frac); |