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

Side by Side Diff: webrtc/common_audio/signal_processing/spl_inl.c

Issue 2014023002: Add clz functions (Count number of Leading Zero bits), 32-and 64-bit variants (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@bug601787-1
Patch Set: new algorithm Created 4 years, 6 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
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include <stdint.h>
12
13 #include "webrtc/common_audio/signal_processing/include/spl_inl.h"
14
15 // Table used by WebRtcSpl_CountLeadingZeros32_NotBuiltin. For each uint32_t n
16 // that's a sequence of 0 bits followed by a sequence of 1 bits, the entry at
17 // index (n * 0x8c0b2891) >> 26 in this table gives the number of zero bits in
18 // n.
19 const int8_t kWebRtcSpl_CountLeadingZeros32_Table[64] = {
20 32, 8, 17, -1, -1, 14, -1, -1, -1, 20, -1, -1, -1, 28, -1, 18,
21 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 26, 25, 24,
22 4, 11, 23, 31, 3, 7, 10, 16, 22, 30, -1, -1, 2, 6, 13, 9,
23 -1, 15, -1, 21, -1, 29, 19, -1, -1, -1, -1, -1, 1, 27, 5, 12,
tlegrand-webrtc 2016/05/26 12:01:46 I would prefer keeping it as in Patch Set 1, since
kwiberg-webrtc 2016/05/26 12:17:59 Yes, this global table adds 64 bytes to the progra
24 };
OLDNEW
« no previous file with comments | « webrtc/common_audio/signal_processing/signal_processing_unittest.cc ('k') | webrtc/system_wrappers/include/compile_assert_c.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698