Download src/fe/fixpoint.h from camenduru/pocketsphinx: direct link, hf CLI and curl.
- Browser
- Download file 4.94 kB
-
https://huggingface.co/camenduru/pocketsphinx/resolve/main/src/fe/fixpoint.h
- Command line
-
hf download hf://camenduru/pocketsphinx/src/fe/fixpoint.h
-
curl -L -o fixpoint.h https://huggingface.co/camenduru/pocketsphinx/resolve/main/src/fe/fixpoint.h
4.94 kB
| /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */ | |
| /* ==================================================================== | |
| * Copyright (c) 2005 Carnegie Mellon University. All rights | |
| * reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | |
| * are met: | |
| * | |
| * 1. Redistributions of source code must retain the above copyright | |
| * notice, this list of conditions and the following disclaimer. | |
| * | |
| * 2. Redistributions in binary form must reproduce the above copyright | |
| * notice, this list of conditions and the following disclaimer in | |
| * the documentation and/or other materials provided with the | |
| * distribution. | |
| * | |
| * This work was supported in part by funding from the Defense Advanced | |
| * Research Projects Agency and the National Science Foundation of the | |
| * United States of America, and the CMU Sphinx Speech Consortium. | |
| * | |
| * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND | |
| * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | |
| * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY | |
| * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| * | |
| * ==================================================================== */ | |
| /** | |
| * @file fixpoint.h | |
| * @brief Fixed-point arithmetic macros. | |
| * | |
| * Author: David Huggins-Daines <dhdaines@gmail.com> | |
| */ | |
| extern "C" { | |
| /* Fool Emacs. */ | |
| } | |
| /** Fixed-point computation type. */ | |
| typedef int32 fixed32; | |
| /** Convert floating point to fixed point. */ | |
| /** Convert fixed point to floating point. */ | |
| /** | |
| * Multiply two fixed point numbers with an arbitrary radix point. | |
| * | |
| * A veritable multiplicity of implementations exist, starting with | |
| * the fastest ones... | |
| */ | |
| /* | |
| * This works on most modern ARMs but *only* in ARM mode (for obvious | |
| * reasons), so don't use it in Thumb mode (but why are you building | |
| * signal processing code in Thumb mode?!) | |
| */ | |
| /* Standard systems*/ | |
| /* Most general case where 'long long' doesn't exist or is slow. */ | |
| /* Various fixed-point logarithmic functions that we need. */ | |
| /** Minimum value representable in log format. */ | |
| /** Fixed-point representation of log(2) */ | |
| /** Take natural logarithm of a fixedpoint number. */ | |
| /** | |
| * Take natural logarithm of an integer, yielding a fixedpoint number | |
| * with DEFAULT_RADIX as radix point. | |
| */ | |
| int32 fixlog(uint32 x); | |
| /** | |
| * Take base-2 logarithm of an integer, yielding a fixedpoint number | |
| * with DEFAULT_RADIX as radix point. | |
| */ | |
| int32 fixlog2(uint32 x); | |
| } | |