Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: celt/ecintrin.h

Issue 12388030: Update Opus to 1.0.2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/opus
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « celt/cwrs.c ('k') | celt/entcode.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2003-2008 Timothy B. Terriberry 1 /* Copyright (c) 2003-2008 Timothy B. Terriberry
2 Copyright (c) 2008 Xiph.Org Foundation */ 2 Copyright (c) 2008 Xiph.Org Foundation */
3 /* 3 /*
4 Redistribution and use in source and binary forms, with or without 4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions 5 modification, are permitted provided that the following conditions
6 are met: 6 are met:
7 7
8 - Redistributions of source code must retain the above copyright 8 - Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer. 9 notice, this list of conditions and the following disclaimer.
10 10
(...skipping 30 matching lines...) Expand all
41 /*Modern gcc (4.x) can compile the naive versions of min and max with cmov if 41 /*Modern gcc (4.x) can compile the naive versions of min and max with cmov if
42 given an appropriate architecture, but the branchless bit-twiddling versions 42 given an appropriate architecture, but the branchless bit-twiddling versions
43 are just as fast, and do not require any special target architecture. 43 are just as fast, and do not require any special target architecture.
44 Earlier gcc versions (3.x) compiled both code to the same assembly 44 Earlier gcc versions (3.x) compiled both code to the same assembly
45 instructions, because of the way they represented ((_b)>(_a)) internally.*/ 45 instructions, because of the way they represented ((_b)>(_a)) internally.*/
46 # define EC_MINI(_a,_b) ((_a)+(((_b)-(_a))&-((_b)<(_a)))) 46 # define EC_MINI(_a,_b) ((_a)+(((_b)-(_a))&-((_b)<(_a))))
47 47
48 /*Count leading zeros. 48 /*Count leading zeros.
49 This macro should only be used for implementing ec_ilog(), if it is defined. 49 This macro should only be used for implementing ec_ilog(), if it is defined.
50 All other code should use EC_ILOG() instead.*/ 50 All other code should use EC_ILOG() instead.*/
51 #if defined(_MSC_VER) 51 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
52 # include <intrin.h> 52 # include <intrin.h>
53 /*In _DEBUG mode this is not an intrinsic by default.*/ 53 /*In _DEBUG mode this is not an intrinsic by default.*/
54 # pragma intrinsic(_BitScanReverse) 54 # pragma intrinsic(_BitScanReverse)
55 55
56 static __inline int ec_bsr(unsigned long _x){ 56 static __inline int ec_bsr(unsigned long _x){
57 unsigned long ret; 57 unsigned long ret;
58 _BitScanReverse(&ret,_x); 58 _BitScanReverse(&ret,_x);
59 return (int)ret; 59 return (int)ret;
60 } 60 }
61 # define EC_CLZ0 (1) 61 # define EC_CLZ0 (1)
(...skipping 16 matching lines...) Expand all
78 /*Note that __builtin_clz is not defined when _x==0, according to the gcc 78 /*Note that __builtin_clz is not defined when _x==0, according to the gcc
79 documentation (and that of the BSR instruction that implements it on x86). 79 documentation (and that of the BSR instruction that implements it on x86).
80 The majority of the time we can never pass it zero. 80 The majority of the time we can never pass it zero.
81 When we need to, it can be special cased.*/ 81 When we need to, it can be special cased.*/
82 # define EC_ILOG(_x) (EC_CLZ0-EC_CLZ(_x)) 82 # define EC_ILOG(_x) (EC_CLZ0-EC_CLZ(_x))
83 #else 83 #else
84 int ec_ilog(opus_uint32 _v); 84 int ec_ilog(opus_uint32 _v);
85 # define EC_ILOG(_x) (ec_ilog(_x)) 85 # define EC_ILOG(_x) (ec_ilog(_x))
86 #endif 86 #endif
87 #endif 87 #endif
OLDNEW
« no previous file with comments | « celt/cwrs.c ('k') | celt/entcode.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698