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

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

?? coder.c

?? 包含Lzw,Huff1,Dhuff等等多種壓縮算法的源代碼包
?? C
字號:
/*
 * Listing 2 -- coder.c
 *
 * This file contains the code needed to accomplish arithmetic
 * coding of a symbol.  All the routines in this module need
 * to know in order to accomplish coding is what the probabilities
 * and scales of the symbol counts are.  This information is
 * generally passed in a SYMBOL structure.
 *
 * This code was first published by Ian H. Witten, Radford M. Neal,
 * and John G. Cleary in "Communications of the ACM" in June 1987,
 * and has been modified slightly for this article.  The code
 * is  published here with permission.
 */

#include <stdio.h>
#include "coder.h"
#include "bitio.h"

/*
 * These four variables define the current state of the arithmetic
 * coder/decoder.  They are assumed to be 16 bits long.  Note that
 * by declaring them as short ints, they will actually be 16 bits
 * on most 80X86 and 680X0 machines, as well as VAXen.
 */
static unsigned short int code;  /* The present input code value       */
static unsigned short int low;   /* Start of the current code range    */
static unsigned short int high;  /* End of the current code range      */
long underflow_bits;             /* Number of underflow bits pending   */

/*
 * This routine must be called to initialize the encoding process.
 * The high register is initialized to all 1s, and it is assumed that
 * it has an infinite string of 1s to be shifted into the lower bit
 * positions when needed.
 */
void initialize_arithmetic_encoder()
{
    low = 0;
    high = 0xffff;
    underflow_bits = 0;
}

/*
 * This routine is called to encode a symbol.  The symbol is passed
 * in the SYMBOL structure as a low count, a high count, and a range,
 * instead of the more conventional probability ranges.  The encoding
 * process takes two steps.  First, the values of high and low are
 * updated to take into account the range restriction created by the
 * new symbol.  Then, as many bits as possible are shifted out to
 * the output stream.  Finally, high and low are stable again and
 * the routine returns.
 */
void encode_symbol( FILE *stream, SYMBOL *s )
{
    long range;
/*
 * These three lines rescale high and low for the new symbol.
 */
    range = (long) ( high-low ) + 1;
    high = low + (unsigned short int )
                 (( range * s->high_count ) / s->scale - 1 );
    low = low + (unsigned short int )
                 (( range * s->low_count ) / s->scale );
/*
 * This loop turns out new bits until high and low are far enough
 * apart to have stabilized.
 */
    for ( ; ; )
    {
/*
 * If this test passes, it means that the MSDigits match, and can
 * be sent to the output stream.
 */
        if ( ( high & 0x8000 ) == ( low & 0x8000 ) )
        {
            output_bit( stream, high & 0x8000 );
            while ( underflow_bits > 0 )
            {
                output_bit( stream, ~high & 0x8000 );
                underflow_bits--;
            }
        }
/*
 * If this test passes, the numbers are in danger of underflow, because
 * the MSDigits don't match, and the 2nd digits are just one apart.
 */
        else if ( ( low & 0x4000 ) && !( high & 0x4000 ))
        {
            underflow_bits += 1;
            low &= 0x3fff;
            high |= 0x4000;
        }
        else
            return ;
        low <<= 1;
        high <<= 1;
        high |= 1;
    }
}

/*
 * At the end of the encoding process, there are still significant
 * bits left in the high and low registers.  We output two bits,
 * plus as many underflow bits as are necessary.
 */
void flush_arithmetic_encoder( FILE *stream )
{
    output_bit( stream, low & 0x4000 );
    underflow_bits++;
    while ( underflow_bits-- > 0 )
        output_bit( stream, ~low & 0x4000 );
}

/*
 * When decoding, this routine is called to figure out which symbol
 * is presently waiting to be decoded.  This routine expects to get
 * the current model scale in the s->scale parameter, and it returns
 * a count that corresponds to the present floating point code:
 *
 *  code = count / s->scale
 */
short int get_current_count( SYMBOL *s )
{
    long range;
    short int count;

    range = (long) ( high - low ) + 1;
    count = (short int)
            ((((long) ( code - low ) + 1 ) * s->scale-1 ) / range );
    return( count );
}

/*
 * This routine is called to initialize the state of the arithmetic
 * decoder.  This involves initializing the high and low registers
 * to their conventional starting values, plus reading the first
 * 16 bits from the input stream into the code value.
 */
void initialize_arithmetic_decoder( FILE *stream )
{
    int i;

    code = 0;
    for ( i = 0 ; i < 16 ; i++ )
    {
        code <<= 1;
        code += input_bit( stream );
    }
    low = 0;
    high = 0xffff;
}

/*
 * Just figuring out what the present symbol is doesn't remove
 * it from the input bit stream.  After the character has been
 * decoded, this routine has to be called to remove it from the
 * input stream.
 */
void remove_symbol_from_stream( FILE *stream, SYMBOL *s )
{
    long range;

/*
 * First, the range is expanded to account for the symbol removal.
 */
    range = (long)( high - low ) + 1;
    high = low + (unsigned short int)
                 (( range * s->high_count ) / s->scale - 1 );
    low = low + (unsigned short int)
                 (( range * s->low_count ) / s->scale );
/*
 * Next, any possible bits are shipped out.
 */
    for ( ; ; )
    {
/*
 * If the MSDigits match, the bits will be shifted out.
 */
        if ( ( high & 0x8000 ) == ( low & 0x8000 ) )
        {
        }
/*
 * Else, if underflow is threatining, shift out the 2nd MSDigit.
 */
        else if ((low & 0x4000) == 0x4000  && (high & 0x4000) == 0 )
        {
            code ^= 0x4000;
            low   &= 0x3fff;
            high  |= 0x4000;
        }
/*
 * Otherwise, nothing can be shifted out, so I return.
 */
        else
            return;
        low <<= 1;
        high <<= 1;
        high |= 1;
        code <<= 1;
        code += input_bit( stream );
    }
}


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人无遮挡在线视频| 日韩美女久久久| 久久精品72免费观看| 久久综合色综合88| 91麻豆国产在线观看| 蜜芽一区二区三区| 久久久久99精品国产片| 欧美日韩视频不卡| 99久久国产综合精品麻豆| 蜜桃av一区二区三区电影| 天天色综合天天| 亚洲欧美激情在线| 国产精品免费网站在线观看| 91精品国产欧美日韩| 色综合中文综合网| 欧美丰满少妇xxxxx高潮对白| 亚洲精品美国一| 久久视频一区二区| 欧美激情艳妇裸体舞| 日韩视频一区二区三区在线播放| 97se亚洲国产综合自在线| 色婷婷久久久综合中文字幕| 国产精品影视在线| 久久99国产精品免费| 日韩在线一区二区三区| 亚洲精品欧美专区| 蜜乳av一区二区| 国产精品一区二区三区99| 99精品国产一区二区三区不卡| 欧洲一区二区三区在线| 欧美自拍丝袜亚洲| 337p粉嫩大胆色噜噜噜噜亚洲| 国产精品私人影院| 手机精品视频在线观看| 岛国av在线一区| 国产精品18久久久久久久网站| 不卡一卡二卡三乱码免费网站| 成人动漫在线一区| 欧美日韩国产系列| 日韩一区二区在线观看视频播放| 久久久一区二区三区| 亚洲丰满少妇videoshd| 午夜婷婷国产麻豆精品| 成人免费视频一区| 日韩欧美高清一区| 国产日韩欧美a| 日韩一区在线免费观看| 亚洲区小说区图片区qvod| 久久99精品久久久久婷婷| 欧美亚洲日本国产| 欧美v日韩v国产v| 日本一区免费视频| 人人爽香蕉精品| 91久久国产综合久久| 91精品在线麻豆| 久久亚洲一区二区三区四区| 亚洲精品国产无天堂网2021| 国产乱国产乱300精品| 日韩一区二区高清| 亚洲成a人片在线不卡一二三区| 日韩vs国产vs欧美| 国产另类ts人妖一区二区| 欧美日本乱大交xxxxx| 亚洲免费资源在线播放| 丁香五精品蜜臀久久久久99网站 | 麻豆国产91在线播放| 欧美性生活久久| 亚洲综合色丁香婷婷六月图片| 日韩和的一区二区| 欧美日韩在线综合| 亚洲第一会所有码转帖| 欧美少妇xxx| 亚洲成人免费影院| 欧美老肥妇做.爰bbww| 日韩精品一区第一页| 在线播放一区二区三区| 视频一区欧美日韩| 欧美一级专区免费大片| 九色|91porny| 欧美精品一区二| 成人一级片在线观看| 国产精品电影一区二区| 久久99国产精品免费| 久久综合久久综合久久| 国产精品亚洲视频| 中文字幕一区二区三区在线不卡 | 日本va欧美va精品发布| 欧美岛国在线观看| 国产综合久久久久久久久久久久 | 欧美一区二区三区精品| 日本不卡不码高清免费观看| 日韩精品一区二区在线观看| 精久久久久久久久久久| 国产日韩欧美在线一区| 91老师片黄在线观看| 一区二区三区免费网站| 成人精品小蝌蚪| 亚洲综合视频网| 精品日韩在线观看| 成人国产在线观看| 亚洲超碰97人人做人人爱| 制服丝袜中文字幕一区| 国产成人免费9x9x人网站视频| 亚洲四区在线观看| 91麻豆精品国产自产在线观看一区 | 欧美亚洲免费在线一区| 九九国产精品视频| 国产精品久久久久久久久果冻传媒 | 亚洲国产精品久久一线不卡| 日韩精品在线一区二区| caoporen国产精品视频| 国产精品视频线看| 欧美久久久久久久久久| 北岛玲一区二区三区四区| 日日骚欧美日韩| 国产精品人妖ts系列视频| 欧美日韩午夜影院| 99久久精品一区二区| 国产在线精品一区二区夜色 | 亚洲色图视频免费播放| 精品国产自在久精品国产| 久久精品国产精品亚洲红杏| 亚洲视频一区二区在线| 精品国产91洋老外米糕| 欧美日韩在线不卡| 91免费在线看| 国产盗摄一区二区| 蜜臀av性久久久久蜜臀aⅴ| 亚洲精品国产精品乱码不99| 久久久精品人体av艺术| 日韩一区二区免费视频| 欧美日韩精品是欧美日韩精品| 成人一区二区视频| 国产自产2019最新不卡| 首页亚洲欧美制服丝腿| 亚洲精品国久久99热| 国产精品热久久久久夜色精品三区| 91精品婷婷国产综合久久性色| 一本色道久久综合亚洲精品按摩 | 色综合一区二区三区| 国产一区二区精品久久99| 日韩精品色哟哟| 午夜精品123| 亚洲国产你懂的| 亚洲靠逼com| 夜夜嗨av一区二区三区四季av| 中文字幕一区免费在线观看| 欧美极品少妇xxxxⅹ高跟鞋 | 欧美视频自拍偷拍| 色88888久久久久久影院野外| 99精品国产视频| 91香蕉视频污| 色综合久久99| 在线影院国内精品| 欧美猛男gaygay网站| 欧美精选一区二区| 日韩亚洲欧美中文三级| 看电影不卡的网站| 麻豆成人91精品二区三区| 婷婷久久综合九色综合伊人色| 亚洲国产日韩精品| 日本欧美在线看| 国产一区二区三区黄视频| 成人理论电影网| 日本久久一区二区| 欧美精品日韩精品| 欧美一级搡bbbb搡bbbb| 久久综合九色综合欧美就去吻| 久久精品人人爽人人爽| 不卡的av电影在线观看| 91丨porny丨蝌蚪视频| 欧美午夜精品一区二区蜜桃| 91精品国产综合久久精品图片| 精品福利av导航| 1区2区3区国产精品| 亚洲午夜久久久久中文字幕久| 毛片av一区二区| 大尺度一区二区| 在线播放91灌醉迷j高跟美女| 精品福利一区二区三区 | 成人免费福利片| 蜜臀av性久久久久蜜臀av麻豆| 精彩视频一区二区三区| 国产成人精品免费网站| 色94色欧美sute亚洲线路一ni| 欧美丝袜丝交足nylons| 久久亚洲捆绑美女| 亚洲综合一区二区三区| 激情都市一区二区| 99久久精品免费精品国产| 欧美一级黄色大片| 成人欧美一区二区三区小说| 香蕉影视欧美成人| 成人午夜看片网址| 欧美一区午夜精品| 一区二区三区日韩精品视频| 国产精品自拍三区| 欧美卡1卡2卡| 亚洲欧美视频一区| 国产精品原创巨作av|