~ubuntu-branches/debian/experimental/spice/experimental

« back to all changes in this revision

Viewing changes to celt/libcelt/entcode.c

  • Committer: Package Import Robot
  • Author(s): Michael Tokarev, Michael Tokarev
  • Date: 2013-01-17 19:19:30 UTC
  • mfrom: (0.5.1) (7.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130117191930-oy4gnzcxdtj0uzh0
Tags: 0.12.2-0nocelt1exp
* New upstream release
* debian/patches:
   - Refresh link-libspice-server-with-libm-libpthread.patch
* Refresh debian/cpyright, new files added
* Build client, upstream don't build client by default
* Refresh libspice-server1.symbols
* Add libglib2.0-dev to Build-Depends

[ Michael Tokarev ]
* refresh make-celt-to-be-optional.patch (minor context diff)
* do not build-depend on libspice-protocol-dev
  (upstream always uses included copy)
* add (versioned) dependency on libspice-protocol-dev to libspice-server-dev
  package, since when the latter is installed, embedded protocol headers
  are not installed
* do not build-depend on mesa libs (OpenGL is not enabled by default
  and is not recommended by upstream)
* do not build-depend on libogg-dev
* configure with --disable-silent-rules, so that the compiler command
  line is visible (this fixes the lintian warnings about hardening flags)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifdef HAVE_CONFIG_H
2
 
#include "config.h"
3
 
#endif
4
 
 
5
 
#include "entcode.h"
6
 
 
7
 
 
8
 
 
9
 
 
10
 
 
11
 
 
12
 
 
13
 
int ec_ilog(ec_uint32 _v){
14
 
#if defined(EC_CLZ)
15
 
  return EC_CLZ0-EC_CLZ(_v);
16
 
#else
17
 
  /*On a Pentium M, this branchless version tested as the fastest on
18
 
     1,000,000,000 random 32-bit integers, edging out a similar version with
19
 
     branches, and a 256-entry LUT version.*/
20
 
  int ret;
21
 
  int m;
22
 
  ret=!!_v;
23
 
  m=!!(_v&0xFFFF0000)<<4;
24
 
  _v>>=m;
25
 
  ret|=m;
26
 
  m=!!(_v&0xFF00)<<3;
27
 
  _v>>=m;
28
 
  ret|=m;
29
 
  m=!!(_v&0xF0)<<2;
30
 
  _v>>=m;
31
 
  ret|=m;
32
 
  m=!!(_v&0xC)<<1;
33
 
  _v>>=m;
34
 
  ret|=m;
35
 
  ret+=!!(_v&0x2);
36
 
  return ret;
37
 
#endif
38
 
}
39