亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? openlpc.fixed.c

?? LPC10 2.4Kpbs 語音壓縮定點運算C語言源程序OPENLPC
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
  Fixed point OpenLPC codec
  Copyright (C) 2003-2005 Phil Frisbie, Jr. (phil@hawksoft.com)

  This is a major rewrite of the orginal floating point OpenLPC
  code from Future Dynamics. As such, a copywrite notice is not
  required to credit Future Dynamics.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Library General Public
  License as published by the Free Software Foundation; either
  version 2 of the License, or (at your option) any later version.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Library General Public License for more details.
    
  You should have received a copy of the GNU Library General Public
  License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA  02111-1307, USA.
      
  Or go to http://www.gnu.org/copyleft/lgpl.html
*/
/************************************************************************\

  Low bitrate LPC CODEC derived from the public domain implementation 
  of Ron Frederick.
  
  The basic design is preserved, except for several bug fixes and
  the following modifications:
    
  1. The pitch detector operates on the (downsampled) signal, not on 
  the residue. This appears to yield better performances, and it
  lowers the processing load.
  2. Each frame is elongated by 50% prefixing it with the last half
  of the previous frame. This design, inherited from the original
  code for windowing purposes, is exploited in order to provide 
  two independent pitch analyses: on the first 2/3, and on the 
  second 2/3 of the elongated frame (of course, they overlap by 
  half):
      
  last half old frame	            new frame
  --------------------========================================
  <--------- first pitch region --------->
                      <--------- second pitch region  ------->
        
  Two voiced/unvoiced flags define the voicing status of each
  region; only one value for the period is retained (if both
  halves are voiced, the average is used).
  The two flags are used by the synthesizer for the halves of
  each frame to play back. Of course, this is non optimal but
  is good enough (a half-frame would be too short for measuring
  low pitches)
  3. The parameters (one float for the period (pitch), one for the
  gain, and ten for the LPC-10 filter) are quantized according 
  this procedure:
  - the period is logarithmically compressed, then quantized 
  as 8-bit unsigned int (6 would actually suffice)
  - the gain is logarithmically compressed (using a different
  formula), then quantized at 6-bit unsigned int. The two
  remaining bits are used for the voicing flags.
  - the first two LPC parameters (k[1] and k[2]) are multiplied
  by PI/2, and the arcsine of the result is quantized as
  6 and 5 bit signed integers. This has proved more effective
  than the log-area compression used by LPC-10.
  - the remaining eight LPC parameters (k[3]...k[10]) are
  quantized as, respectively, 5,4,4,3,3,3,3 and 2 bit signed
  integers.
  Finally, period and gain plus voicing flags are stored in the
  first two bytes of the 7-byte parameters block, and the quantized
  LPC parameters are packed into the remaining 5 bytes. Two bits
  remain unassigned, and can be used for error detection or other
  purposes.

  The frame lenght is actually variable, and is simply passed as 
  initialization parameter to lpc_init(): this allows to experiment
  with various frame lengths. Long frames reduce the bitrate, but
  exceeding 320 samples (i.e. 40 ms, at 8000 samples/s) tend to
  deteriorate the speech, that sounds like spoken by a person 
  affected by a stroke: the LPC parameters (modeling the vocal 
  tract) can't change fast enough for a natural-sounding synthesis.
  25 ms per frame already yields a quite tight compression, corresponding
  to 1000/40 * 7 * 8 = 1400 bps. The quality improves little with 
  frames shorter than 250 samples (32 frames/s), so this is a recommended
  compromise. The bitrate is 32 * 7 * 8 = 1792 bps.
  
  The synthesizer has been modified as well. For voiced subframes it 
  now uses a sawtooth excitation, instead of the original pulse train.
  This idea, copied from MELP, reduces the buzzing-noise artifacts.
  In order to compensate the non-white spectrum of the sawtooth, a 
  pre-emphasis is applied to the signal before the Durbin calculation.
  The filter has (in s-space) two zeroes at (640, 0) Hz and two poles 
  at (3200, 0) Hz. These filters have been handoded, and may not be 
  optimal. Two other filters (anti-hum high-pass with corner at 100 Hz,
  and pre-downsampling lowpass with corner at 300 Hz) are Butterworth
  designs produced by the MkFilter package by A.J. Fisher
  (http://www.cs.york.ac.uk/~fisher/mkfilter/).

\************************************************************************/

#ifdef _MSC_VER
#pragma warning (disable:4711) /* to disable automatic inline warning */
  #define M_PI (3.1415926535897932384626433832795)
#endif

#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <math.h>
#include "openlpc.h"

#define fixed32         long

#if defined WIN32 || defined WIN64 || defined (_WIN32_WCE)
#define fixed64         __int64
#else
#define fixed64         long long
#endif

/* These are for development and debugging and should not be changed unless
you REALLY know what you are doing ;) */
#define IGNORE_OVERFLOW
#define FAST_FILTERS
#define PRECISION       20

#define ftofix32(x)       ((fixed32)((x) * (float)(1 << PRECISION) + ((x) < 0 ? -0.5 : 0.5)))
#define itofix32(x)       ((x) << PRECISION)
#define fixtoi32(x)       ((x) >> PRECISION)
#define fixtof32(x)       (float)((float)(x) / (float)(1 << PRECISION))

static fixed32 fixmul32(fixed32 x, fixed32 y)
{
    fixed64 temp;
    
    temp = x;
    temp *= y;
    temp >>= PRECISION;
#ifndef IGNORE_OVERFLOW
    if(temp > 0x7fffffff)
    {
        return 0x7fffffff;
    }
    else if(temp < -0x7ffffffe)
    {
        return -0x7ffffffe;
    }
#endif
    return (fixed32)temp;
}

static fixed32 fixdiv32(fixed32 x, fixed32 y)
{
    fixed64 temp;
    
    if(x == 0)
        return 0;
    if(y == 0)
        return 0x7fffffff;
    temp = x;
    temp <<= PRECISION;
    return (fixed32)(temp / y);
}

static fixed32 fixsqrt32(fixed32 x)
{
    
    unsigned long r = 0, s, v = (unsigned long)x;
    
#define STEP(k) s = r + (1 << k * 2); r >>= 1; \
    if (s <= v) { v -= s; r |= (1 << k * 2); }
    
    STEP(15);
    STEP(14);
    STEP(13);
    STEP(12);
    STEP(11);
    STEP(10);
    STEP(9);
    STEP(8);
    STEP(7);
    STEP(6);
    STEP(5);
    STEP(4);
    STEP(3);
    STEP(2);
    STEP(1);
    STEP(0);
    
    return (fixed32)(r << (PRECISION / 2));
}

__inline static fixed32 fixexp32(fixed32 x)
{
    fixed64 result = ftofix32(1.f);
    fixed64 temp;
    int     sign = 1;

    /* reduce range to 0.0 to 1.0 */
    if(x < 0)
    {
        x = (fixed32)-x;
        sign = -1;
    }
    while(x > itofix32(1))
    {
        x -= itofix32(1);
        result *= ftofix32(2.718282f);
        result >>= PRECISION;
    }
    /* reduce range to 0.0 to 0.5 */
    if(x > ftofix32(0.5f))
    {
        x -= ftofix32(0.5f);
        result *= ftofix32(1.648721f);
        result >>= PRECISION;
    }
    if(result > 0x7fffffff)
    {
        return 0x7fffffff;
    }
    temp = ftofix32(0.00138888f) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(0.00833333f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(0.04166666f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(0.16666666f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(0.5f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(1.0f)) * x;
    temp >>= PRECISION;
    result *= (temp + ftofix32(1.f));
    result >>= PRECISION;
    if(sign == -1)
    {
        temp = 1;
        result = (temp << (PRECISION * 2)) / result;
    }
    if(result > 0x7fffffff)
    {
        return 0x7fffffff;
    }
    return (fixed32)result;
}

__inline static fixed32 fixlog32(fixed32 x)
{
    fixed64 result = 0;
    fixed64 temp;

    if(x == 0)
    {
        return -0x7ffffffe;
    }
    else if(x < 0)
    {
        return 0;
    }
    while(x > itofix32(2))
    {
        result += ftofix32(0.693147f);
        x /= 2;
    }
    while(x < itofix32(1))
    {
        result -= ftofix32(0.693147f);
        x *= 2;
    }
    x -= itofix32(1);
    temp = ftofix32(-.0064535442f) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.0360884937f)) * x;
    temp >>= PRECISION;
    temp = (temp - ftofix32(.0953293897f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.1676540711f)) * x;
    temp >>= PRECISION;
    temp = (temp - ftofix32(.2407338084f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.3317990258f)) * x;
    temp >>= PRECISION;
    temp = (temp - ftofix32(.4998741238f)) * x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.9999964239f)) * x;
    temp >>= PRECISION;
    result += temp;

    return (fixed32)result;
}

__inline fixed32 fixsin32(fixed32 x)
{
    fixed64 x2, temp;
    int     sign = 1;

    if(x < 0)
    {
        sign = -1;
        x = -x;
    }
    while(x > ftofix32(M_PI))
    {
        x -= ftofix32(M_PI);
        sign = -sign;
    }
    if(x > ftofix32(M_PI/2))
    {
        x = ftofix32(M_PI) - x;
    }
    x2 = (fixed64)x * x;
    x2 >>= PRECISION;
    if(sign != 1)
    {
        x = -x;
    }
    temp = ftofix32(-.0000000239f) * x2;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.0000027526f)) * x2;
    temp >>= PRECISION;
    temp = (temp - ftofix32(.0001984090f)) * x2;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.0083333315f)) * x2;
    temp >>= PRECISION;
    temp = (temp - ftofix32(.1666666664f)) * x2;
    temp >>= PRECISION;
    temp += itofix32(1);
    temp = temp * x;
    temp >>= PRECISION;

    return  (fixed32)(temp);
}

__inline fixed32 fixasin32(fixed32 x)
{
    fixed64 temp;
    int     sign = 1;

    if(x > itofix32(1) || x < itofix32(-1))
    {
        return 0;
    }
    if(x < 0)
    {
        sign = -1;
        x = -x;
    }
    temp = 0;
    temp = ftofix32(-.0012624911f) * (fixed64)x;
    temp >>= PRECISION;
    temp = (temp + ftofix32(.0066700901f)) * x;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产乱码| 中文字幕欧美激情| 白白色 亚洲乱淫| 偷拍亚洲欧洲综合| 中文字幕av免费专区久久| 欧美另类久久久品| 成人免费不卡视频| 狠狠网亚洲精品| 婷婷综合久久一区二区三区| 国产精品免费看片| 精品99999| 在线成人高清不卡| 91国模大尺度私拍在线视频| 福利视频网站一区二区三区| 裸体一区二区三区| 亚洲第一激情av| 一区二区三区资源| 日韩毛片在线免费观看| 国产日本亚洲高清| 精品欧美久久久| 日韩片之四级片| 欧美精品日韩一本| 欧洲精品在线观看| 一本久道中文字幕精品亚洲嫩| 福利电影一区二区三区| 国产精品亚洲人在线观看| 久久99精品久久久久| 美女脱光内衣内裤视频久久影院| 亚洲小少妇裸体bbw| 一区二区三区四区视频精品免费 | 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲精品老司机| 亚洲欧美视频在线观看视频| 中文字幕一区免费在线观看| 久久久久久久av麻豆果冻| 精品欧美乱码久久久久久1区2区 | 久久人人超碰精品| 欧美草草影院在线视频| 精品国产一区a| 精品久久久久久久久久久久久久久| 91精品免费在线观看| 91精品婷婷国产综合久久竹菊| 欧美人狂配大交3d怪物一区| 欧美日韩一级片网站| 欧美区一区二区三区| 欧美日韩成人综合| 欧美一二三区在线| 精品国产1区二区| 国产日产欧产精品推荐色| 国产精品丝袜91| 亚洲欧美一区二区三区久本道91| 亚洲伦理在线精品| 午夜久久久久久久久| 日韩高清一级片| 老司机一区二区| 国产成人在线网站| 99久久精品免费看国产| 欧美性xxxxxxxx| 91精品国产色综合久久不卡蜜臀| 日韩欧美国产三级| 亚洲国产精品黑人久久久| 自拍视频在线观看一区二区| 亚洲成人午夜影院| 激情综合网最新| 97成人超碰视| 欧美一区二区三区不卡| 久久女同精品一区二区| 国产精品久久久久久亚洲伦| 亚洲一区二区综合| 精品午夜久久福利影院| 丁香啪啪综合成人亚洲小说 | 91精品久久久久久蜜臀| 久久综合色天天久久综合图片| 国产精品午夜久久| 亚洲成人久久影院| 国产麻豆一精品一av一免费 | 成人av免费网站| 欧美色综合影院| 久久精品人人做人人爽人人| 亚洲欧美日韩国产综合在线| 免费精品视频在线| 91在线视频免费91| 日韩欧美国产电影| 一区二区三区日韩精品| 黄一区二区三区| 欧美日韩综合在线| 国产欧美精品一区aⅴ影院 | 国模一区二区三区白浆| 91香蕉视频污| 精品黑人一区二区三区久久| 一区二区三区四区国产精品| 国产乱一区二区| 欧美挠脚心视频网站| 国产精品视频一二三区 | 国产精品亚洲成人| 8v天堂国产在线一区二区| 中文字幕一区二区三区视频| 蜜臀va亚洲va欧美va天堂| 91国产福利在线| 国产精品美女视频| 狠狠色丁香婷综合久久| 欧美区视频在线观看| 亚洲美女精品一区| 国产91综合一区在线观看| 日韩午夜激情电影| 亚洲一区二区三区激情| av不卡一区二区三区| 国产亚洲精品资源在线26u| 蜜臀av性久久久久蜜臀av麻豆| 91福利在线导航| 国产精品久久毛片av大全日韩| 极品少妇xxxx精品少妇偷拍| 6080yy午夜一二三区久久| 亚洲欧美另类图片小说| 丁香一区二区三区| 国产日韩三级在线| 狠狠色丁香久久婷婷综| 日韩三级在线观看| 美女性感视频久久| 91精品国产综合久久国产大片| 亚洲在线观看免费| 91香蕉视频污在线| 国产精品福利一区| 成人永久aaa| 亚洲国产高清不卡| 成人免费毛片嘿嘿连载视频| 亚洲精品在线免费观看视频| 麻豆91免费看| 欧美成人乱码一区二区三区| 蜜桃久久久久久久| 日韩手机在线导航| 久久99久久精品| 亚洲精品在线三区| 国产激情91久久精品导航| 国产清纯白嫩初高生在线观看91| 激情欧美一区二区三区在线观看| 精品久久久网站| 国产精品1区2区3区在线观看| 久久精品一区八戒影视| 国产精品性做久久久久久| 国产欧美一区二区精品性| 东方欧美亚洲色图在线| 国产精品久久免费看| 色综合久久久久综合体| 亚洲黄色小说网站| 欧美日韩国产精品自在自线| 天天av天天翘天天综合网| 在线播放一区二区三区| 美女www一区二区| 久久精品视频在线免费观看| eeuss鲁片一区二区三区在线看| 亚洲欧美综合另类在线卡通| 91国偷自产一区二区开放时间| 午夜伦欧美伦电影理论片| 日韩欧美激情四射| 国产91精品欧美| 一区二区三区蜜桃网| 91精品国产一区二区三区蜜臀| 激情综合色丁香一区二区| 国产精品日日摸夜夜摸av| 在线国产电影不卡| 男人的天堂久久精品| 国产日韩欧美在线一区| 一本色道久久综合精品竹菊| 日本欧美肥老太交大片| 欧美精品一区二区在线播放| 成人激情校园春色| 亚洲已满18点击进入久久| 日韩午夜在线影院| 成人激情校园春色| 天天av天天翘天天综合网色鬼国产 | 中文字幕av不卡| 欧美伊人久久大香线蕉综合69| 免费成人av资源网| 国产欧美一区在线| 欧美久久高跟鞋激| 成人免费的视频| 日韩国产成人精品| 国产精品盗摄一区二区三区| 欧美另类久久久品| 波多野结衣中文字幕一区| 午夜视频在线观看一区| 欧美国产精品v| 欧美一三区三区四区免费在线看| 国产精品一区二区在线观看不卡 | 国产精品乱码一区二三区小蝌蚪| 在线观看一区不卡| 国产99一区视频免费| 午夜视频久久久久久| 国产精品美女久久久久久久 | 亚洲图片激情小说| 日韩视频在线你懂得| 一本久道久久综合中文字幕 | 亚洲精品网站在线观看| 精品少妇一区二区| 在线视频国产一区| 成人h精品动漫一区二区三区| 丝袜美腿亚洲一区二区图片| 中文字幕欧美日韩一区| 精品久久久网站|