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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? adpcm.c.svn-base

?? ffmpeg最新源碼
?? SVN-BASE
?? 第 1 頁 / 共 5 頁
字號:
/* * ADPCM codecs * Copyright (c) 2001-2003 The ffmpeg Project * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */#include "avcodec.h"#include "bitstream.h"#include "bytestream.h"/** * @file adpcm.c * ADPCM codecs. * First version by Francois Revol (revol@free.fr) * Fringe ADPCM codecs (e.g., DK3, DK4, Westwood) *   by Mike Melanson (melanson@pcisys.net) * CD-ROM XA ADPCM codec by BERO * EA ADPCM decoder by Robin Kay (komadori@myrealbox.com) * EA ADPCM R1/R2/R3 decoder by Peter Ross (pross@xvid.org) * EA IMA EACS decoder by Peter Ross (pross@xvid.org) * EA IMA SEAD decoder by Peter Ross (pross@xvid.org) * EA ADPCM XAS decoder by Peter Ross (pross@xvid.org) * MAXIS EA ADPCM decoder by Robert Marston (rmarston@gmail.com) * THP ADPCM decoder by Marco Gerards (mgerards@xs4all.nl) * * Features and limitations: * * Reference documents: * http://www.pcisys.net/~melanson/codecs/simpleaudio.html * http://www.geocities.com/SiliconValley/8682/aud3.txt * http://openquicktime.sourceforge.net/plugins.htm * XAnim sources (xa_codec.c) http://www.rasnaimaging.com/people/lapus/download.html * http://www.cs.ucla.edu/~leec/mediabench/applications.html * SoX source code http://home.sprynet.com/~cbagwell/sox.html * * CD-ROM XA: * http://ku-www.ss.titech.ac.jp/~yatsushi/xaadpcm.html * vagpack & depack http://homepages.compuserve.de/bITmASTER32/psx-index.html * readstr http://www.geocities.co.jp/Playtown/2004/ */#define BLKSIZE 1024/* step_table[] and index_table[] are from the ADPCM reference source *//* This is the index table: */static const int index_table[16] = {    -1, -1, -1, -1, 2, 4, 6, 8,    -1, -1, -1, -1, 2, 4, 6, 8,};/** * This is the step table. Note that many programs use slight deviations from * this table, but such deviations are negligible: */static const int step_table[89] = {    7, 8, 9, 10, 11, 12, 13, 14, 16, 17,    19, 21, 23, 25, 28, 31, 34, 37, 41, 45,    50, 55, 60, 66, 73, 80, 88, 97, 107, 118,    130, 143, 157, 173, 190, 209, 230, 253, 279, 307,    337, 371, 408, 449, 494, 544, 598, 658, 724, 796,    876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,    2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,    5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,    15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767};/* These are for MS-ADPCM *//* AdaptationTable[], AdaptCoeff1[], and AdaptCoeff2[] are from libsndfile */static const int AdaptationTable[] = {        230, 230, 230, 230, 307, 409, 512, 614,        768, 614, 512, 409, 307, 230, 230, 230};static const int AdaptCoeff1[] = {        256, 512, 0, 192, 240, 460, 392};static const int AdaptCoeff2[] = {        0, -256, 0, 64, 0, -208, -232};/* These are for CD-ROM XA ADPCM */static const int xa_adpcm_table[5][2] = {   {   0,   0 },   {  60,   0 },   { 115, -52 },   {  98, -55 },   { 122, -60 }};static const int ea_adpcm_table[] = {    0, 240, 460, 392, 0, 0, -208, -220, 0, 1,    3, 4, 7, 8, 10, 11, 0, -1, -3, -4};static const int ct_adpcm_table[8] = {    0x00E6, 0x00E6, 0x00E6, 0x00E6,    0x0133, 0x0199, 0x0200, 0x0266};// padded to zero where table size is less then 16static const int swf_index_tables[4][16] = {    /*2*/ { -1, 2 },    /*3*/ { -1, -1, 2, 4 },    /*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 },    /*5*/ { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 }};static const int yamaha_indexscale[] = {    230, 230, 230, 230, 307, 409, 512, 614,    230, 230, 230, 230, 307, 409, 512, 614};static const int yamaha_difflookup[] = {    1, 3, 5, 7, 9, 11, 13, 15,    -1, -3, -5, -7, -9, -11, -13, -15};/* end of tables */typedef struct ADPCMChannelStatus {    int predictor;    short int step_index;    int step;    /* for encoding */    int prev_sample;    /* MS version */    short sample1;    short sample2;    int coeff1;    int coeff2;    int idelta;} ADPCMChannelStatus;typedef struct ADPCMContext {    ADPCMChannelStatus status[6];} ADPCMContext;/* XXX: implement encoding */#ifdef CONFIG_ENCODERSstatic int adpcm_encode_init(AVCodecContext *avctx){    if (avctx->channels > 2)        return -1; /* only stereo or mono =) */    if(avctx->trellis && (unsigned)avctx->trellis > 16U){        av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");        return -1;    }    switch(avctx->codec->id) {    case CODEC_ID_ADPCM_IMA_WAV:        avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */                                                             /* and we have 4 bytes per channel overhead */        avctx->block_align = BLKSIZE;        /* seems frame_size isn't taken into account... have to buffer the samples :-( */        break;    case CODEC_ID_ADPCM_IMA_QT:        avctx->frame_size = 64;        avctx->block_align = 34 * avctx->channels;        break;    case CODEC_ID_ADPCM_MS:        avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; /* each 16 bits sample gives one nibble */                                                             /* and we have 7 bytes per channel overhead */        avctx->block_align = BLKSIZE;        break;    case CODEC_ID_ADPCM_YAMAHA:        avctx->frame_size = BLKSIZE * avctx->channels;        avctx->block_align = BLKSIZE;        break;    case CODEC_ID_ADPCM_SWF:        if (avctx->sample_rate != 11025 &&            avctx->sample_rate != 22050 &&            avctx->sample_rate != 44100) {            av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, 22050 or 44100\n");            return -1;        }        avctx->frame_size = 512 * (avctx->sample_rate / 11025);        break;    default:        return -1;        break;    }    avctx->coded_frame= avcodec_alloc_frame();    avctx->coded_frame->key_frame= 1;    return 0;}static int adpcm_encode_close(AVCodecContext *avctx){    av_freep(&avctx->coded_frame);    return 0;}static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c, short sample){    int delta = sample - c->prev_sample;    int nibble = FFMIN(7, abs(delta)*4/step_table[c->step_index]) + (delta<0)*8;    c->prev_sample += ((step_table[c->step_index] * yamaha_difflookup[nibble]) / 8);    c->prev_sample = av_clip_int16(c->prev_sample);    c->step_index = av_clip(c->step_index + index_table[nibble], 0, 88);    return nibble;}static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, short sample){    int predictor, nibble, bias;    predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 256;    nibble= sample - predictor;    if(nibble>=0) bias= c->idelta/2;    else          bias=-c->idelta/2;    nibble= (nibble + bias) / c->idelta;    nibble= av_clip(nibble, -8, 7)&0x0F;    predictor += (signed)((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;    c->sample2 = c->sample1;    c->sample1 = av_clip_int16(predictor);    c->idelta = (AdaptationTable[(int)nibble] * c->idelta) >> 8;    if (c->idelta < 16) c->idelta = 16;    return nibble;}static inline unsigned char adpcm_yamaha_compress_sample(ADPCMChannelStatus *c, short sample){    int nibble, delta;    if(!c->step) {        c->predictor = 0;        c->step = 127;    }    delta = sample - c->predictor;    nibble = FFMIN(7, abs(delta)*4/c->step) + (delta<0)*8;    c->predictor += ((c->step * yamaha_difflookup[nibble]) / 8);    c->predictor = av_clip_int16(c->predictor);    c->step = (c->step * yamaha_indexscale[nibble]) >> 8;    c->step = av_clip(c->step, 127, 24567);    return nibble;}typedef struct TrellisPath {    int nibble;    int prev;} TrellisPath;typedef struct TrellisNode {    uint32_t ssd;    int path;    int sample1;    int sample2;    int step;} TrellisNode;static void adpcm_compress_trellis(AVCodecContext *avctx, const short *samples,                                   uint8_t *dst, ADPCMChannelStatus *c, int n){#define FREEZE_INTERVAL 128    //FIXME 6% faster if frontier is a compile-time constant    const int frontier = 1 << avctx->trellis;    const int stride = avctx->channels;    const int version = avctx->codec->id;    const int max_paths = frontier*FREEZE_INTERVAL;    TrellisPath paths[max_paths], *p;    TrellisNode node_buf[2][frontier];    TrellisNode *nodep_buf[2][frontier];    TrellisNode **nodes = nodep_buf[0]; // nodes[] is always sorted by .ssd    TrellisNode **nodes_next = nodep_buf[1];    int pathn = 0, froze = -1, i, j, k;    assert(!(max_paths&(max_paths-1)));    memset(nodep_buf, 0, sizeof(nodep_buf));    nodes[0] = &node_buf[1][0];    nodes[0]->ssd = 0;    nodes[0]->path = 0;    nodes[0]->step = c->step_index;    nodes[0]->sample1 = c->sample1;    nodes[0]->sample2 = c->sample2;    if((version == CODEC_ID_ADPCM_IMA_WAV) || (version == CODEC_ID_ADPCM_IMA_QT) || (version == CODEC_ID_ADPCM_SWF))        nodes[0]->sample1 = c->prev_sample;    if(version == CODEC_ID_ADPCM_MS)        nodes[0]->step = c->idelta;    if(version == CODEC_ID_ADPCM_YAMAHA) {        if(c->step == 0) {            nodes[0]->step = 127;            nodes[0]->sample1 = 0;        } else {            nodes[0]->step = c->step;            nodes[0]->sample1 = c->predictor;        }    }    for(i=0; i<n; i++) {        TrellisNode *t = node_buf[i&1];        TrellisNode **u;        int sample = samples[i*stride];        memset(nodes_next, 0, frontier*sizeof(TrellisNode*));        for(j=0; j<frontier && nodes[j]; j++) {            // higher j have higher ssd already, so they're unlikely to use a suboptimal next sample too            const int range = (j < frontier/2) ? 1 : 0;            const int step = nodes[j]->step;            int nidx;            if(version == CODEC_ID_ADPCM_MS) {                const int predictor = ((nodes[j]->sample1 * c->coeff1) + (nodes[j]->sample2 * c->coeff2)) / 256;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱人伦精品一区二区在线观看| 国产成+人+日韩+欧美+亚洲| 国产精品99久久久久久宅男| 9l国产精品久久久久麻豆| 3d动漫精品啪啪1区2区免费| 国产精品久久久久久亚洲伦| 狠狠色丁香久久婷婷综合_中| 欧美日韩综合色| 国产精品电影院| 国产激情一区二区三区四区 | 亚洲影院在线观看| 国产成人亚洲精品青草天美| 欧美一区日韩一区| 亚洲国产精品精华液网站| 99热精品一区二区| 中文字幕av一区 二区| 国产一区福利在线| 日韩欧美高清dvd碟片| 亚洲成年人网站在线观看| 一本色道久久综合亚洲精品按摩| 国产精品三级久久久久三级| 国模少妇一区二区三区| 欧美成人a视频| 午夜免费久久看| 在线观看视频一区二区| 一区二区在线看| 日本道免费精品一区二区三区| 亚洲私人黄色宅男| 91免费看视频| 一区二区在线观看视频| 欧美无砖专区一中文字| 日韩激情在线观看| 欧美日韩精品一区二区在线播放| 一区二区不卡在线视频 午夜欧美不卡在 | 精品欧美一区二区在线观看| 日产国产欧美视频一区精品| 欧美喷潮久久久xxxxx| 丝袜亚洲精品中文字幕一区| 欧美男同性恋视频网站| 日韩高清不卡一区二区三区| 日韩一区二区三免费高清| 美国欧美日韩国产在线播放| 精品国产乱码久久久久久免费| 久久99蜜桃精品| 久久久综合视频| 不卡的电影网站| 伊人婷婷欧美激情| 日韩三级电影网址| 国产精品77777| 亚洲人成网站在线| 欧美丰满少妇xxxbbb| 国产一区二区不卡| 亚洲女与黑人做爰| 欧美久久久久久久久中文字幕| 免费成人美女在线观看.| 国产欧美日韩麻豆91| 欧洲精品在线观看| 久久99精品国产.久久久久久| 亚洲国产精华液网站w| 在线观看网站黄不卡| 久久国产尿小便嘘嘘| 麻豆91免费看| 国产精品少妇自拍| 欧美精品一卡两卡| 国产.欧美.日韩| 亚洲综合图片区| 2020国产成人综合网| 91国产免费看| 国产一区二区不卡| 亚洲成人av电影| 中文字幕一区二区三区四区 | 欧美精品一二三区| 国产福利一区在线| 丝袜美腿一区二区三区| 国产精品嫩草影院com| 欧美一区二区三区视频免费 | 亚洲丝袜美腿综合| 欧美成人精品福利| 日本道在线观看一区二区| 国产一区二区三区免费看| 亚洲午夜国产一区99re久久| 国产日产亚洲精品系列| 91精品国产91久久久久久一区二区| 成人开心网精品视频| 久久精品久久久精品美女| 亚洲国产成人av| 日韩一区在线看| 国产无一区二区| 久久综合网色—综合色88| 欧美日韩二区三区| 91精品午夜视频| 色系网站成人免费| 97国产一区二区| 国产v综合v亚洲欧| 美国毛片一区二区| 日产欧产美韩系列久久99| 一区二区欧美国产| 亚洲美女电影在线| 国产精品女主播在线观看| 久久你懂得1024| 久久亚洲一区二区三区明星换脸 | 成人开心网精品视频| 美女在线视频一区| 日韩精品亚洲一区| 午夜婷婷国产麻豆精品| 亚洲高清在线视频| 亚洲国产精品久久久久婷婷884| 亚洲猫色日本管| 亚洲日本中文字幕区| 国产精品国产三级国产aⅴ中文| 欧美大片拔萝卜| 欧美变态tickle挠乳网站| 日韩欧美国产电影| 欧美一区二区三区在线视频| 欧美一区二区三区日韩视频| 91精品黄色片免费大全| 欧美大片在线观看| 久久嫩草精品久久久久| 久久久蜜臀国产一区二区| 欧美激情一区二区三区蜜桃视频 | 精品88久久久久88久久久| 欧美精品一区二区蜜臀亚洲| 久久综合九色欧美综合狠狠 | 亚洲午夜精品在线| 亚洲最大色网站| 一区二区三区中文字幕电影 | 在线播放91灌醉迷j高跟美女| 欧美日韩精品欧美日韩精品一综合| 欧美日韩你懂的| 日韩久久久精品| 国产日韩v精品一区二区| 亚洲视频图片小说| 视频一区二区三区中文字幕| 国产永久精品大片wwwapp| www.亚洲国产| 91精品国产综合久久久久| 精品国产sm最大网站免费看| 国产精品成人在线观看 | 亚洲欧美激情视频在线观看一区二区三区| 国产精品久久精品日日| 亚洲一区二区在线观看视频| 秋霞电影一区二区| 岛国av在线一区| 在线视频亚洲一区| 亚洲精品在线电影| 国产精品激情偷乱一区二区∴| 亚洲与欧洲av电影| 国产精品亚洲一区二区三区妖精| 9久草视频在线视频精品| 91精品国产91久久久久久一区二区 | 中文字幕欧美日本乱码一线二线| 亚洲精品成人精品456| 蜜臀久久99精品久久久画质超高清 | 亚洲四区在线观看| 日韩国产欧美在线观看| 成人网男人的天堂| 欧美一区二区三区精品| ...中文天堂在线一区| 麻豆国产欧美一区二区三区| 99re成人在线| 久久综合久久鬼色| 一区二区三区日本| 国产老肥熟一区二区三区| 欧美日韩一区高清| 国产精品不卡一区| 精品一区二区三区视频在线观看 | 93久久精品日日躁夜夜躁欧美| 日韩天堂在线观看| 一区二区三区四区不卡在线 | 6080午夜不卡| 国产精品高潮久久久久无| 奇米影视7777精品一区二区| 色94色欧美sute亚洲线路二| 亚洲精品在线免费观看视频| 天天射综合影视| 91久久精品一区二区二区| 国产精品视频在线看| 日本sm残虐另类| 欧美精品自拍偷拍动漫精品| 亚洲欧美日本在线| 国产成人欧美日韩在线电影| 精品理论电影在线观看| 日韩激情中文字幕| 欧美日韩精品一区二区三区四区| 亚洲另类在线一区| 成人一区二区三区视频在线观看 | 一区二区久久久久| 91蜜桃免费观看视频| 国产精品久久久久一区二区三区| 国产一区二区不卡| 久久久久9999亚洲精品| 裸体歌舞表演一区二区| 日韩欧美美女一区二区三区| 免费av网站大全久久| 91精品国产入口在线| 日本女优在线视频一区二区| 日韩一区二区在线观看| 久久精品国产亚洲5555| xfplay精品久久| 91豆麻精品91久久久久久|