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

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

?? decode.c

?? mp3 源代碼void III_hufman_decode
?? C
?? 第 1 頁 / 共 4 頁
字號:
/**********************************************************************
Copyright (c) 1991 MPEG/audio software simulation group, All Rights Reserved
decode.c
**********************************************************************/
/**********************************************************************
 * MPEG/audio coding/decoding software, work in progress              *
 *   NOT for public distribution until verified and approved by the   *
 *   MPEG/audio committee.  For further information, please contact   *
 *   Davis Pan, 708-538-5671, e-mail: pan@ukraine.corp.mot.com        *
 *                                                                    *
 * VERSION 4.3                                                        * 
 *   changes made since last update:                                  *
 *   date   programmers         comment                               *
 * 2/25/91  Douglas Wong,       start of version 1.0 records          *
 *          Davis Pan                                                 *
 * 3/06/91  Douglas Wong        rename: setup.h to dedef.h            *
 *                                      dfilter to defilter           *
 *                                      dwindow to dewindow           *
 *                              integrated "quantizer", "scalefactor" *
 *                              combined window_samples routine into  *
 *                              filter samples                        *
 * 3/31/91  Bill Aspromonte     replaced read_filter by               *
 *                              create_syn_filter and introduced a    *
 *                              new Sub-Band Synthesis routine called *
 *                              SubBandSynthesis()                    *
 * 5/10/91  Vish (PRISM)        Ported to Macintosh and Unix.         *
 *                              Changed "out_fifo()" so that last     *
 *                              unfilled block is also written out.   *
 *                              "create_syn_filter()" was modified so *
 *                              that calculation precision is same as *
 *                              in specification tables.              *
 *                              Changed "decode_scale()" to reflect   *
 *                              specifications.                       *
 *                              Removed all routines used by          *
 *                              "synchronize_buffer()".  This is now  *
 *                              replaced by "seek_sync()".            *
 *                              Incorporated Jean-Georges Fritsch's   *
 *                              "bitstream.c" package.                *
 *                              Deleted "reconstruct_sample()".       *
 * 27jun91  dpwe (Aware)        Passed outFile and &sampFrames as     *
 *                              args to out_fifo() - were global.     *
 *                              Moved "alloc_*" reader to common.c.   *
 *                              alloc, sblimit, stereo passed via new *
 *                              'frame_params struct (were globals).  *
 *                              Added JOINT STEREO decoding, lyrs I&II*
 *                              Affects: decode_bitalloc,buffer_samps *
 *                              Plus a few other cleanups.            *
 * 6/10/91   Earle Jennings     conditional expansion added in        *
 *                              II_dequantize_sample to handle range  *
 *                              problems in MSDOS version             *
 * 8/8/91    Jens Spille        Change for MS-C6.00                   *
 *10/1/91    S.I. Sudharsanan,  Ported to IBM AIX platform.           *
 *           Don H. Lee,                                              *
 *           Peter W. Farrett                                         *
 *10/3/91    Don H. Lee         implemented CRC-16 error protection   *
 *                              newly introduced functions are        *
 *                              buffer_CRC and recover_CRC_error.     *
 * 2/11/92  W. Joseph Carter    Ported new code to Macintosh.  Most   *
 *                              important fixes involved changing     *
 *                              16-bit ints to long or unsigned in    *
 *                              bit alloc routines for quant of 65535 *
 *                              and passing proper function args.     *
 *                              Removed "Other Joint Stereo" option   *
 *                              and made bitrate be total channel     *
 *                              bitrate, irrespective of the mode.    *
 *                              Fixed many small bugs & reorganized.  *
 * 7/27/92  Juan Pineda         Bug fix in SubBandSynthesis()         *
 *--------------------------------------------------------------------*
 * 6/14/92  Juan Pineda         Layer III decoding routines added.    *
 *          Amit Gulati         Follows CD 3-11172 rev2.  Contains    *
 *                              hacks deal with evolving available    *
 *                              layerIII bitstreams.  Some (minor)    *
 *                              modification of prior LI&II code.     *
 * 10/25/92 Amit Gulati         Updated layerIII routines. Added code *
 *                              for subblock_gain, switched block     *
 *                              modes, stereo pre-processing.         *
 *                              Corrected sign bits for huffman       *
 *                              decoding of quadruples region and     *
 *                              adjusted gain factor in III_dequant.  *
 * 11/21/92 Amit Gulati         Several layerIII bugs fixed.          *
 * 12/15/92 Amit Gulati         Corrected reordering (indexing)       *
 *          Stan Searing        within IMDCT routine.                 *
 *  8/24/93 Masahiro Iwadare    Included IS modification in Layer III.*
 *                              Changed for 1 pass decoding.          *
 *  9/07/93 Toshiyuki Ishino    Integrated Layer III with Ver 3.9.    *
 *--------------------------------------------------------------------*
 * 11/20/93 Masahiro Iwadare    Integrated Layer III with Ver 4.0.    *
 *--------------------------------------------------------------------*
 *  7/14/94 Juergen Koller      Bug fixes in Layer III code           *
 *--------------------------------------------------------------------*
 * 08/11/94 IIS                 Bug fixes in Layer III code           *
 *--------------------------------------------------------------------*
 * 9/20/94  Davis Pan           Modification to avoid premature       *
 *                              synchword detection                   *
 *--------------------------------------------------------------------*
 * 11/09/94 Jon Rowlands        Merged premature synchword detection  *
 *                              fix into layer III code version       *
 **********************************************************************/

#include        "common.h"
#include        "decoder.h"
#include        "huffman.h"

/***************************************************************
/*
/* This module contains the core of the decoder ie all the
/* computational routines. (Layer I and II only)
/* Functions are common to both layer unless
/* otherwise specified.
/*
/***************************************************************/

/*****************************************************************
/*
/* The following routines decode the system information
/*
/****************************************************************/

/************ Layer I, Layer II & Layer III ******************/

void decode_info(bs, fr_ps)
Bit_stream_struc *bs;
frame_params *fr_ps;
{
    unsigned int bits;

    layer *hdr = fr_ps->header;
    while( (bits=getbits(bs,8)) == 255); /*discard leading 0xFF's of syncword*/
    hdr->bitrate_index = bits & 0xF;
    bits = bits >> 4;
    switch(bits) {
      case 0:
         hdr->version = 0;
         hdr->lay = 4;
         hdr->error_protection = 1;
         break;
      case 1:
         hdr->version = 0;
         hdr->lay = 4;
         hdr->error_protection = 0;
         break;
      case 2:
         hdr->version = 0;
         hdr->lay = 3;
         hdr->error_protection = 1;
         break;
      case 3:
         hdr->version = 0;
         hdr->lay = 3;
         hdr->error_protection = 0;
         break;
      case 4:
         hdr->version = 0;
         hdr->lay = 2;
         hdr->error_protection = 1;
         break;
      case 5:
         hdr->version = 0;
         hdr->lay = 2;
         hdr->error_protection = 0;
         break;
      case 6:
         hdr->version = 0;
         hdr->lay = 1;
         hdr->error_protection = 1;
         break;
      case 7:
         hdr->version = 0;
         hdr->lay = 1;
         hdr->error_protection = 0;
         break;
      case 8:
         hdr->version = 1;
         hdr->lay = 4;
         hdr->error_protection = 1;
         break;
      case 9:
         hdr->version = 1;
         hdr->lay = 4;
         hdr->error_protection = 0;
         break;
      case 10:
         hdr->version = 1;
         hdr->lay = 3;
         hdr->error_protection = 1;
         break;
      case 11:
         hdr->version = 1;
         hdr->lay = 3;
         hdr->error_protection = 0;
         break;
      case 12:
         hdr->version = 1;
         hdr->lay = 2;
         hdr->error_protection = 1;
         break;
      case 13:
         hdr->version = 1;
         hdr->lay = 2;
         hdr->error_protection = 0;
         break;
      case 14:
         hdr->version = 1;
         hdr->lay = 1;
         hdr->error_protection = 1;
         break;
      default:
         hdr->version = 1;
         hdr->lay = 1;
         hdr->error_protection = 0;
    }
    hdr->sampling_frequency = getbits(bs,2);
    hdr->padding = get1bit(bs);
    hdr->extension = get1bit(bs);
    hdr->mode = getbits(bs,2);
    hdr->mode_ext = getbits(bs,2);
    hdr->copyright = get1bit(bs);
    hdr->original = get1bit(bs);
    hdr->emphasis = getbits(bs,2);
}

/*******************************************************************
/*
/* The bit allocation information is decoded. Layer I
/* has 4 bit per subband whereas Layer II is Ws and bit rate
/* dependent.
/*
/********************************************************************/

/**************************** Layer II *************/

void II_decode_bitalloc(bs, bit_alloc, fr_ps)
Bit_stream_struc *bs;
unsigned int bit_alloc[2][SBLIMIT];
frame_params *fr_ps;
{
    int i,j;
    int stereo = fr_ps->stereo;
    int sblimit = fr_ps->sblimit;
    int jsbound = fr_ps->jsbound;
    al_table *alloc = fr_ps->alloc;

    for (i=0;i<jsbound;i++) for (j=0;j<stereo;j++)
        bit_alloc[j][i] = (char) getbits(bs,(*alloc)[i][0].bits);

    for (i=jsbound;i<sblimit;i++) /* expand to 2 channels */
        bit_alloc[0][i] = bit_alloc[1][i] =
            (char) getbits(bs,(*alloc)[i][0].bits);

    for (i=sblimit;i<SBLIMIT;i++) for (j=0;j<stereo;j++)
        bit_alloc[j][i] = 0;
}

/**************************** Layer I *************/

void I_decode_bitalloc(bs, bit_alloc, fr_ps)
Bit_stream_struc *bs;
unsigned int bit_alloc[2][SBLIMIT];
frame_params *fr_ps;
{
    int i,j;
    int stereo  = fr_ps->stereo;
    int sblimit = fr_ps->sblimit;
    int jsbound = fr_ps->jsbound;
    int b;

    for (i=0;i<jsbound;i++) for (j=0;j<stereo;j++)
        bit_alloc[j][i] = getbits(bs,4);
    for (i=jsbound;i<SBLIMIT;i++) {
        b = getbits(bs,4);
        for (j=0;j<stereo;j++)
            bit_alloc[j][i] = b;
    }
}

/*****************************************************************
/*
/* The following two functions implement the layer I and II
/* format of scale factor extraction. Layer I involves reading
/* 6 bit per subband as scale factor. Layer II requires reading
/* first the scfsi which in turn indicate the number of scale factors
/* transmitted.
/*    Layer I : I_decode_scale
/*   Layer II : II_decode_scale
/*
/****************************************************************/

/************************** Layer I stuff ************************/

void I_decode_scale(bs, bit_alloc, scale_index, fr_ps)
Bit_stream_struc *bs;
unsigned int bit_alloc[2][SBLIMIT], scale_index[2][3][SBLIMIT];
frame_params *fr_ps;
{
    int i,j;
    int stereo = fr_ps->stereo;
    int sblimit = fr_ps->sblimit;

    for (i=0;i<SBLIMIT;i++) for (j=0;j<stereo;j++)
        if (!bit_alloc[j][i])
            scale_index[j][0][i] = SCALE_RANGE-1;
        else                    /* 6 bit per scale factor */
            scale_index[j][0][i] =  getbits(bs,6);

}

/*************************** Layer II stuff ***************************/

void II_decode_scale(bs,scfsi, bit_alloc,scale_index, fr_ps)
Bit_stream_struc *bs;
unsigned int scfsi[2][SBLIMIT], bit_alloc[2][SBLIMIT],
             scale_index[2][3][SBLIMIT];
frame_params *fr_ps;
{
    int i,j;
    int stereo = fr_ps->stereo;
    int sblimit = fr_ps->sblimit;
   
    for (i=0;i<sblimit;i++) for (j=0;j<stereo;j++) /* 2 bit scfsi */
        if (bit_alloc[j][i]) scfsi[j][i] = (char) getbits(bs,2);
    for (i=sblimit;i<SBLIMIT;i++) for (j=0;j<stereo;j++)   
        scfsi[j][i] = 0;

    for (i=0;i<sblimit;i++) for (j=0;j<stereo;j++) {
        if (bit_alloc[j][i])   
            switch (scfsi[j][i]) {
                /* all three scale factors transmitted */
             case 0 : scale_index[j][0][i] = getbits(bs,6);
                scale_index[j][1][i] = getbits(bs,6);
                scale_index[j][2][i] = getbits(bs,6);
                break;
                /* scale factor 1 & 3 transmitted */
             case 1 : scale_index[j][0][i] =
                 scale_index[j][1][i] = getbits(bs,6);
                scale_index[j][2][i] = getbits(bs,6);
                break;
                /* scale factor 1 & 2 transmitted */
             case 3 : scale_index[j][0][i] = getbits(bs,6);
                scale_index[j][1][i] =
                    scale_index[j][2][i] =  getbits(bs,6);
                break;
                /* only one scale factor transmitted */
             case 2 : scale_index[j][0][i] =
                 scale_index[j][1][i] =
                     scale_index[j][2][i] = getbits(bs,6);
                break;
                default : break;
            }
        else {
            scale_index[j][0][i] = scale_index[j][1][i] =
                scale_index[j][2][i] = SCALE_RANGE-1;
        }
    }
    for (i=sblimit;i<SBLIMIT;i++) for (j=0;j<stereo;j++) {
        scale_index[j][0][i] = scale_index[j][1][i] =
            scale_index[j][2][i] = SCALE_RANGE-1;
    }
}

/**************************************************************
/*
/*   The following two routines take care of reading the
/* compressed sample from the bit stream for both layer 1 and
/* layer 2. For layer 1, read the number of bits as indicated
/* by the bit_alloc information. For layer 2, if grouping is
/* indicated for a particular subband, then the sample size has
/* to be read from the bits_group and the merged samples has
/* to be decompose into the three distinct samples. Otherwise,
/* it is the same for as layer one.
/*
/**************************************************************/

/******************************* Layer I stuff ******************/

void I_buffer_sample(bs, sample, bit_alloc, fr_ps)
unsigned int FAR sample[2][3][SBLIMIT];
unsigned int bit_alloc[2][SBLIMIT];
Bit_stream_struc *bs;
frame_params *fr_ps;
{
    int i,j,k;
    int stereo = fr_ps->stereo;
    int sblimit = fr_ps->sblimit;
    int jsbound = fr_ps->jsbound;
    unsigned int s;

    for (i=0;i<jsbound;i++) for (j=0;j<stereo;j++)
        if ( (k = bit_alloc[j][i]) == 0)
            sample[j][0][i] = 0;
        else 
            sample[j][0][i] = (unsigned int) getbits(bs,k+1);
    for (i=jsbound;i<SBLIMIT;i++) {
        if ( (k = bit_alloc[0][i]) == 0)
            s = 0;
        else 
            s = (unsigned int)getbits(bs,k+1);
        for (j=0;j<stereo;j++)
            sample[j][0][i]    = s;
    }
}

/*************************** Layer II stuff ************************/

void II_buffer_sample(bs,sample,bit_alloc,fr_ps)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美电影免费观看高清完整版| 不卡av在线免费观看| 亚洲免费观看在线视频| 国产日韩精品一区二区三区在线| 日韩视频免费观看高清完整版| 欧美日韩另类一区| 欧美片在线播放| 日韩一级精品视频在线观看| 91精品在线免费观看| 日韩女优制服丝袜电影| 欧美大片一区二区| 欧美国产激情一区二区三区蜜月| 国产精品污污网站在线观看| 中文字幕欧美一区| 夜色激情一区二区| 青青草伊人久久| 精品一区二区在线免费观看| 国产剧情av麻豆香蕉精品| 国产精品一区二区在线观看网站 | 欧美性xxxxxxxx| 欧美日韩一区在线| 欧美一区二区三区免费大片| 精品国精品国产尤物美女| 国产欧美一区二区三区在线老狼| 国产精品欧美经典| 一区二区三区 在线观看视频| 午夜婷婷国产麻豆精品| 久久99蜜桃精品| 99久久久久久| 欧美一区二区三区视频| 国产日韩欧美一区二区三区乱码| 亚洲天堂2016| 另类小说图片综合网| 成人免费视频caoporn| 日本精品视频一区二区三区| 国产人成一区二区三区影院| 一区二区三区中文字幕精品精品| 日韩精品亚洲一区| 丁香婷婷深情五月亚洲| 欧美日韩视频在线观看一区二区三区 | 欧美高清视频www夜色资源网| 欧美成人精品高清在线播放| 亚洲欧洲成人自拍| 美国av一区二区| 色婷婷综合激情| 精品国产青草久久久久福利| 亚洲日本乱码在线观看| 国内不卡的二区三区中文字幕| 91麻豆精品视频| 久久久午夜精品| 丝袜亚洲精品中文字幕一区| 成人激情视频网站| 26uuu精品一区二区| 亚洲成人一二三| 99久久国产综合色|国产精品| 欧美xxxxx裸体时装秀| 亚洲日本在线天堂| 国产91精品久久久久久久网曝门| 欧美日韩高清一区二区| 亚洲欧美视频在线观看视频| 国产精品12区| 精品免费一区二区三区| 天堂va蜜桃一区二区三区漫画版 | 自拍偷拍欧美激情| 粉嫩av一区二区三区| 日韩欧美你懂的| 婷婷久久综合九色综合绿巨人| 97国产一区二区| 国产精品看片你懂得| 国产精品亚洲第一 | 国产成人免费在线观看不卡| 日韩一卡二卡三卡四卡| 日韩精品欧美成人高清一区二区| 91久久奴性调教| 一区二区三区日本| 91网站黄www| 亚洲欧美色一区| 色婷婷亚洲一区二区三区| 日韩一区在线免费观看| fc2成人免费人成在线观看播放 | 99在线热播精品免费| 国产精品久久久一本精品| 成人精品国产一区二区4080| 中文字幕一区二区三区精华液| caoporen国产精品视频| |精品福利一区二区三区| av一本久道久久综合久久鬼色| 国产精品国产三级国产aⅴ中文| 懂色av一区二区三区免费观看| 国产日产精品一区| 91视频国产资源| 亚洲成人高清在线| 欧美大片拔萝卜| 粉嫩av一区二区三区在线播放| 亚洲欧美中日韩| 欧美亚洲高清一区| 久久精品国产99国产精品| 国产亚洲1区2区3区| 不卡区在线中文字幕| 亚洲综合免费观看高清在线观看| 欧美美女一区二区在线观看| 奇米888四色在线精品| 久久亚洲综合色| 91麻豆.com| 久久精品国产一区二区| 中文字幕乱码日本亚洲一区二区| 一本大道久久a久久精二百| 性做久久久久久| 久久麻豆一区二区| 在线观看欧美精品| 精品一区二区三区视频| 中文字幕一区二区三区在线观看 | 欧美大片日本大片免费观看| 福利一区福利二区| 午夜激情久久久| 国产精品免费久久| 欧美精品乱码久久久久久| 国产成人在线电影| 水蜜桃久久夜色精品一区的特点| 久久久精品黄色| 欧美日韩国产精选| 成人三级伦理片| 六月丁香综合在线视频| 亚洲欧美色综合| 欧美国产欧美亚州国产日韩mv天天看完整 | 成人网页在线观看| 亚洲成av人综合在线观看| 欧美国产丝袜视频| 欧美精品一区二区在线播放| 色综合久久88色综合天天免费| 国内精品免费**视频| 午夜国产精品一区| 亚洲同性gay激情无套| 久久亚洲二区三区| 日韩三级免费观看| 欧美日韩免费视频| 欧美在线制服丝袜| av福利精品导航| 国产一区二区三区不卡在线观看| 午夜精品福利在线| 亚洲午夜激情网页| 亚洲综合在线免费观看| 亚洲欧洲av色图| 国产精品不卡一区二区三区| 国产午夜亚洲精品不卡| 欧美mv日韩mv亚洲| 91精品久久久久久久99蜜桃| 欧美亚洲国产一区二区三区va| 91麻豆蜜桃一区二区三区| 94-欧美-setu| 99国产欧美另类久久久精品 | 亚洲美女区一区| 亚洲视频免费在线| 亚洲人精品一区| 亚洲狠狠丁香婷婷综合久久久| 最新日韩在线视频| 亚洲欧洲国产专区| 亚洲人成精品久久久久| 一区二区成人在线观看| 亚洲一区二区不卡免费| 一区二区三区影院| 亚欧色一区w666天堂| 日韩va欧美va亚洲va久久| 婷婷中文字幕一区三区| 日韩黄色一级片| 久久国内精品视频| 国产精品一区二区久激情瑜伽| 国产原创一区二区三区| 高清不卡一二三区| 日本韩国视频一区二区| 欧美日韩久久一区| 精品久久久久久久久久久院品网| 精品处破学生在线二十三| 国产日韩欧美一区二区三区乱码| 久久精品在线免费观看| 成人欧美一区二区三区在线播放| 亚洲欧美成人一区二区三区| 亚洲在线观看免费视频| 日韩avvvv在线播放| 国产精品影视网| 色婷婷久久久亚洲一区二区三区| 欧美日韩国产综合久久| 精品国产伦一区二区三区观看体验| 久久精品人人爽人人爽| 亚洲精品午夜久久久| 蜜桃视频免费观看一区| av不卡免费在线观看| 欧美男男青年gay1069videost| 久久婷婷综合激情| 亚洲女人****多毛耸耸8| 免费成人av在线| 99精品国产热久久91蜜凸| 欧美成人欧美edvon| 亚洲欧洲在线观看av| 麻豆中文一区二区| 91久久免费观看| 国产欧美一区视频| 另类调教123区| 欧美亚洲免费在线一区| 欧美激情一区二区三区四区 |