亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲成av人片在www色猫咪| 亚洲一二三级电影| a级精品国产片在线观看| 中文字幕在线不卡国产视频| 99久久er热在这里只有精品15| 亚洲欧美日韩综合aⅴ视频| 欧洲另类一二三四区| 蜜臀av亚洲一区中文字幕| 久久久一区二区| 欧美性欧美巨大黑白大战| 日韩精品电影一区亚洲| 国产女主播一区| 欧美在线不卡视频| 国产一二三精品| 亚洲精品国产a久久久久久| 日韩一区二区三区电影| 成人va在线观看| 日韩专区在线视频| 国产精品网站在线| 日韩一区二区三区四区五区六区| 风间由美性色一区二区三区| 亚洲午夜精品一区二区三区他趣| 精品日韩99亚洲| 欧美综合一区二区| 国产美女久久久久| 日本不卡的三区四区五区| 一区在线中文字幕| 久久嫩草精品久久久久| 欧美无人高清视频在线观看| 国产精品一区二区在线观看网站| 亚洲综合另类小说| 国产精品美女www爽爽爽| 日韩一级黄色片| 欧美色中文字幕| 91老司机福利 在线| 成人激情av网| 精油按摩中文字幕久久| 日韩制服丝袜先锋影音| 一区二区三区欧美日| 亚洲天堂中文字幕| 国产色产综合色产在线视频| 精品国精品国产| 3atv一区二区三区| 欧美日韩国产美| 在线影院国内精品| 欧美中文字幕久久 | 精品第一国产综合精品aⅴ| 精品视频999| 91精品久久久久久久99蜜桃| 制服.丝袜.亚洲.中文.综合| 欧美军同video69gay| 欧美伦理视频网站| 欧美精品18+| 精品久久久久久久人人人人传媒| 日韩一级免费一区| 欧美一区二区三区思思人| 69堂精品视频| 日韩欧美高清在线| 久久蜜桃香蕉精品一区二区三区| 久久久影院官网| 国产日韩精品一区二区三区 | 日韩精品一区第一页| 五月婷婷另类国产| 国产在线视视频有精品| 成人一区二区三区视频| 一本一道综合狠狠老| 欧美老女人在线| 26uuu欧美日本| 欧美激情一区二区在线| 亚洲一区二区美女| 裸体在线国模精品偷拍| 成人黄色免费短视频| 欧洲色大大久久| 日韩久久久久久| 最新高清无码专区| 蜜桃一区二区三区在线| 国产成人一区二区精品非洲| 色噜噜狠狠成人中文综合| 这里只有精品99re| 中文字幕av不卡| 免费高清在线一区| 91蝌蚪porny九色| 久久看人人爽人人| 亚洲成a人v欧美综合天堂| 国产高清亚洲一区| 欧美日韩高清一区二区| 国产精品视频麻豆| 日本网站在线观看一区二区三区 | 欧美精品色综合| 日韩毛片高清在线播放| 国产在线观看一区二区| 欧美综合一区二区| 中文字幕一区二区不卡| 激情综合五月天| 欧美日韩午夜影院| 亚洲在线观看免费| 91香蕉视频在线| 国产精品毛片久久久久久| 美国一区二区三区在线播放| 欧美挠脚心视频网站| 一区二区三区国产精华| www.爱久久.com| 亚洲欧洲精品一区二区三区不卡 | 亚洲自拍与偷拍| 一道本成人在线| 一区二区三区加勒比av| 91蜜桃免费观看视频| 国产精品成人午夜| 99视频一区二区| 亚洲天堂免费在线观看视频| eeuss国产一区二区三区| 国产精品国产三级国产aⅴ入口 | 99精品国产视频| 亚洲色图制服丝袜| 色琪琪一区二区三区亚洲区| 一区二区三区产品免费精品久久75| av激情综合网| 亚洲综合在线第一页| 欧美亚洲一区二区在线| 亚洲18色成人| 欧美zozo另类异族| 国产精品一区二区三区99| 2023国产精华国产精品| 成人激情校园春色| 中文字幕一区三区| 欧美日本一道本在线视频| 日本不卡一二三区黄网| 国产婷婷精品av在线| 色哟哟一区二区在线观看| 亚洲自拍偷拍av| 久久综合五月天婷婷伊人| 成人免费视频网站在线观看| 一区二区三区成人| 欧美成人欧美edvon| 一本大道av一区二区在线播放| 五月天亚洲婷婷| 国产欧美日韩一区二区三区在线观看| 91美女片黄在线观看| 蜜桃一区二区三区在线| 亚洲视频电影在线| 日韩精品一区二区三区中文不卡| 不卡av免费在线观看| 久久99最新地址| 亚洲一区二区综合| 中文字幕av一区二区三区| 日韩一级高清毛片| 色94色欧美sute亚洲线路一ni| 精品一区二区三区免费视频| 亚洲美女在线一区| 久久久精品tv| 日韩欧美高清dvd碟片| 欧美中文字幕久久| 99精品视频中文字幕| 国产成人一级电影| 激情欧美一区二区| 日韩激情av在线| 亚洲国产另类av| 亚洲美女偷拍久久| 中文字幕一区二区三区蜜月| 久久美女艺术照精彩视频福利播放| 91精品国产综合久久香蕉的特点| 色噜噜狠狠一区二区三区果冻| 成人97人人超碰人人99| 成人免费观看男女羞羞视频| 国产一区二区视频在线播放| 久久99精品国产麻豆不卡| 视频一区免费在线观看| 天天色综合成人网| 亚洲高清视频中文字幕| 亚洲网友自拍偷拍| 亚洲国产精品麻豆| 肉色丝袜一区二区| 蜜桃视频一区二区三区 | 欧美国产乱子伦 | 玉米视频成人免费看| 亚洲少妇30p| 亚洲成人在线免费| 亚洲成人激情综合网| 午夜精品福利视频网站| 天堂蜜桃91精品| 毛片不卡一区二区| 国产麻豆9l精品三级站| 不卡的看片网站| 欧美性视频一区二区三区| 欧美日韩午夜在线| 精品国产一区久久| 中文字幕欧美区| 亚洲综合视频在线观看| 免费成人在线网站| 国产精品69毛片高清亚洲| 91在线丨porny丨国产| 欧美日韩在线播放一区| 精品国产乱码久久久久久牛牛| 国产日本欧洲亚洲| 亚洲高清免费一级二级三级| 久久精品国产久精国产| 91在线高清观看| 欧美一级欧美三级在线观看| 中文字幕第一区综合| 亚洲成人av电影在线|