blob: d09e308ed3e2c078474f0aa3fe12c11d923c3798 [file] [log] [blame]
kwiberg729b21f2016-06-02 04:02:12 -07001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#include "common_audio/signal_processing/include/spl_inl.h"
kwiberg729b21f2016-06-02 04:02:12 -070014
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.
19const 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,
24};