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

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

?? model-2a.c

?? 一個含有compress、expand、lzw等等壓縮算法的源碼
?? C
字號:
/*
 * Listing 17 -- model-2a.c
 *
 * This module is an order-1 highest order modeling unit that can
 * be using in conjunction with comp-2.c and expand-2.c to compress
 * and expand files.  It is a very simple implementation of an order-1
 * model, using the same techniques for storing counts as were used
 * in model-1.c.  This means that it uses a lot of memory, around
 * 140 Kbytes, and that it spends a lot of time updating the table.
 * Since it can loop up context tables with a simple index on the
 * context character, it is still pretty fast.
 *
 * Building the compression and expansion programs with this model
 * requires moving up to compact model.
 *
 * Building the compressor:
 *
 * Turbo C:     tcc -w -mc comp-2.c model-2a.c bitio.c coder.c
 * QuickC:      qcl /AC /W3 comp-2.c model-2a.c bitio.c coder.c
 * Zortech:     ztc -mc comp-2.c model-2a.c bitio.c coder.c
 * *NIX:        cc -o comp-2 comp-2.c model-1a.c bitio.c coder.c
 *
 * Building the decompressor:
 *
 * Turbo C:     tcc -w -mc expand-2.c model-2a.c bitio.c coder.c
 * QuickC:      qcl /AC /W3 expand-2.c model-2a.c bitio.c coder.c
 * Zortech:     ztc -mc expand-2.c model-2a.c bitio.c coder.c
 * *NIX:        cc -o expand-2 expand-2.c model-1a.c bitio.c coder.c
 */
#include <stdio.h>
#include <stdlib.h>
#include "coder.h"
#include "model.h"

/*
 * *totals[] is an array of pointers to context tables.  The EOF
 * character doesn't get a context table, since we stop encoding
 * as soon as that character appears.  Each context table is
 * an array of ints with indices ranging from -1 to 255.
 */
short int *totals[ 257 ];
/*
 * context is the last character encoded or decoded.  It is
 * used to index to the appropriate context table.  We start the
 * model with an arbitrary context of 0;
 */
int context = 0;
int current_order = 1;
int flushing_enabled=0;
int max_order=1;        /* Here for compatibility, not used */

/*
 * To initialize the model, I create all 256 context tables, and
 * set all the counts in the table to 0.  By default, the model
 * starts up in context 0, as if the last byte in was '\0'.  Since
 * each context table is supposed to be indexed from -1 to 255,
 * I increment the pointer to the table in totals[], so that the
 * array can be safely indexed with -1.  The only symbol with a
 * non-zero when the tables are initialized is the ESCAPE code,
 * which is set to a count of 1.
 */
void initialize_model()
{
    int i;
    short int j;
    int array_size;

    array_size = sizeof( short int * ) * ( 257 + 1 );
    for ( i = 0 ; i < 257 ; i++ )
    {
        totals[ i ] = (short int *) malloc( array_size ) ;
        if ( totals[ i ] == NULL )
        {
            printf( "Error allocating table space!\n" );
            exit( 1 );
        }
        totals[ i ]++;
	for ( j = -1 ; j <= ESCAPE ; j++ )
	    totals[ i ][ j ] = 0;
	totals[ i ][ ESCAPE+1 ] = 1;
    }
    for ( j = -1 ; j <= 257 ; j++ )
        totals[ ESCAPE ][ j ] = j + 1;
}

/*
 * When the table is updated, every count above "symbol" needs to
 * be incremented, which is somewhat expensive.  If the counts
 * have become to large, the table needs to be rescaled.  After the
 * rescaling is done, we have to make sure that the ESCAPE count
 * is not set to 0, otherwise we would have a problem. After the
 * update is complete, the context is changed to be the symbol that
 * was just updated, and the order is cranked back up to the maximum.
 */
void update_model( int symbol )
{
    int i;

    for ( i = symbol+1 ; i <= 257; i++ )
        totals[ context ][ i ]++;
    if ( totals[ context ][ 257 ] == MAXIMUM_SCALE )
    {
        for ( i = 0 ; i <= 257 ; i++ )
            totals[ context ][ i ] /= 2;
        if ( totals[ context ][ ESCAPE ] == totals[ context][ ESCAPE + 1 ] )
	    totals[ context ][ ESCAPE + 1 ]++;
    }
    context = symbol;
    current_order = 1;
}

/*
 * Since the context table can be directly indexed with the
 * symbol, getting the low and high counts for the particular
 * symbol is nice and easy.  If we have fallen back to a lower
 * order following an ESCAPE code being emitted, we look at the
 * ESCAPE table, else we look at the table selected by the
 * previous context.  The complication arises if we are currently
 * at the maximum order and the symbol has a count of zero.  If
 * that happens, we select the ESCAPE character instead, and
 * return that information to the calling program.
 */
int convert_int_to_symbol( int c, SYMBOL *s )
{
    int local_context;

    if ( current_order == 0 )
        local_context = ESCAPE ;
    else
        local_context = context;

    s->scale = totals[ local_context ][ 257 ];
    s->low_count = totals[ local_context ][ c ];
    s->high_count = totals[ local_context ][ c + 1 ];
    if ( s->low_count != s->high_count )
        return( 0 );
    s->low_count = totals[ local_context ][ ESCAPE ];
    s->high_count = totals[ local_context ][ 257 ];
    current_order--;
    return( 1 );
}
/*
 * The symbol's scale is always in the same place, which is nice.
 */
void get_symbol_scale( SYMBOL *s )
{
    if ( current_order == 0 )
        s->scale = totals[ ESCAPE ][ 257 ];
    else
        s->scale = totals[ context ][ 257 ];
}
/*
 * To find the symbol whose low and high values straddle count
 * requires walking through the table until a match is found.
 * This is a lengthy operation, and helps to keep decoding
 * slower than encoding.
 */
int convert_symbol_to_int( int count, SYMBOL *s )
{
    int c;
    int local_context;

    if ( current_order == 0 )
        local_context = ESCAPE ;
    else
        local_context = context;


    for ( c = 257; count < totals[ local_context ][ c ] ; c-- )
        ;
    s->high_count = totals[ local_context ][ c + 1 ];
    s->low_count = totals[ local_context ][ c ];
    if ( c == ESCAPE )
        current_order--;
    return( c );
}

/*
 * These stubs are used by some of the more complicated modeling
 * modules.
 */
void add_character_to_model( int c )
{
}

void flush_model()
{
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产另类一区| 色综合咪咪久久| 顶级嫩模精品视频在线看| av在线播放不卡| 91精品国产色综合久久| 久久影音资源网| 亚洲成av人影院在线观看网| 韩国午夜理伦三级不卡影院| 一本色道久久综合亚洲aⅴ蜜桃| 91精品在线一区二区| 中文字幕一区日韩精品欧美| 五月激情六月综合| 不卡的av在线| 欧美一区二区三区四区视频| 亚洲美女视频在线| 国产一区二区三区在线观看精品| 成人免费视频caoporn| 91精品欧美久久久久久动漫 | 国产在线精品免费av| 91视频在线观看免费| 精品理论电影在线| 亚洲综合在线免费观看| 久88久久88久久久| 精品视频1区2区3区| 亚洲视频在线观看三级| 不卡av在线免费观看| 秋霞午夜av一区二区三区| 亚洲另类色综合网站| 国产呦精品一区二区三区网站| 欧美色图免费看| 亚洲综合视频网| 丁香五精品蜜臀久久久久99网站| 日韩一区二区中文字幕| 亚洲狠狠爱一区二区三区| 99久久婷婷国产综合精品| 精品视频资源站| 亚洲欧美区自拍先锋| 成人av在线影院| 国产偷v国产偷v亚洲高清| 人人狠狠综合久久亚洲| 色噜噜久久综合| 亚洲你懂的在线视频| 成人精品国产一区二区4080| 国产精品久久久久久久午夜片| heyzo一本久久综合| 亚洲一区在线看| 91精品久久久久久久久99蜜臂| 久久精品国产澳门| 国产欧美日韩在线| 色综合久久中文字幕综合网 | 亚洲免费av网站| 欧美日韩综合色| 日本网站在线观看一区二区三区 | 中文无字幕一区二区三区| 不卡的电影网站| 一区二区三区四区中文字幕| 91精品国产综合久久蜜臀| 黄色日韩三级电影| 自拍视频在线观看一区二区| 欧美在线观看视频一区二区三区| 奇米色一区二区| 中文字幕久久午夜不卡| 欧美日韩一级视频| 国产一区二区伦理片| 亚洲欧美成aⅴ人在线观看| 日韩一区二区在线看| 国产成人三级在线观看| 一区二区高清在线| 久久你懂得1024| 欧美视频精品在线| 国产麻豆精品在线| 天堂一区二区在线| 中文字幕va一区二区三区| 欧美男男青年gay1069videost| 丰满白嫩尤物一区二区| 天天做天天摸天天爽国产一区| 亚洲国产精品成人综合| 欧美精品成人一区二区三区四区| 国产精品中文字幕一区二区三区| 亚洲一区二区在线视频| 欧美精品一区二区三区高清aⅴ| 一本一道久久a久久精品| 精品影视av免费| 亚洲午夜在线视频| 亚洲欧洲精品一区二区三区不卡| 日韩视频一区在线观看| 欧洲亚洲国产日韩| 成人免费毛片高清视频| 日本中文字幕一区二区有限公司| 中文字幕一区二区三| 久久这里只精品最新地址| 91精品欧美一区二区三区综合在 | 高清shemale亚洲人妖| 蜜臀国产一区二区三区在线播放| 亚洲欧洲中文日韩久久av乱码| 久久嫩草精品久久久精品| 日韩一区二区高清| 欧美男男青年gay1069videost| 成人看片黄a免费看在线| 韩国女主播成人在线观看| 午夜精品福利视频网站| 亚洲免费资源在线播放| 亚洲欧美偷拍三级| 亚洲欧美视频在线观看视频| 国产精品麻豆一区二区| 国产精品国产自产拍高清av | 91欧美一区二区| 成人亚洲一区二区一| 国产91在线观看丝袜| 精品系列免费在线观看| 激情欧美一区二区| 国产一区不卡精品| 国产福利精品导航| 成人小视频在线| av电影天堂一区二区在线| av亚洲精华国产精华精| 91麻豆视频网站| 日本精品一级二级| 欧美伦理视频网站| 欧美一区二区三区不卡| 日韩视频免费直播| 久久综合久久综合九色| 久久色中文字幕| 国产精品久久久久久亚洲毛片| 自拍av一区二区三区| 亚洲第一二三四区| 免费成人av资源网| 国产精品羞羞答答xxdd| 99久久久国产精品免费蜜臀| 欧洲一区在线电影| 欧美电影免费观看高清完整版在| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美经典三级视频一区二区三区| 综合婷婷亚洲小说| 日本欧美一区二区在线观看| 极品少妇xxxx偷拍精品少妇| 国产福利一区二区三区视频 | 欧美一区二区三区四区五区| 精品美女在线播放| 亚洲少妇最新在线视频| 亚洲一区在线观看视频| 久久av老司机精品网站导航| 粉嫩13p一区二区三区| 欧美在线free| 精品蜜桃在线看| 亚洲免费av网站| 久久国产人妖系列| 99re成人精品视频| 日韩欧美一区二区在线视频| 中文字幕+乱码+中文字幕一区| 夜夜嗨av一区二区三区中文字幕| 视频一区二区国产| 99麻豆久久久国产精品免费优播| 欧美精品乱码久久久久久| 日本一区二区三区国色天香 | 亚洲免费观看高清完整| 秋霞电影网一区二区| jvid福利写真一区二区三区| 91精品免费在线观看| 亚洲私人黄色宅男| 精品一区二区三区免费视频| 色94色欧美sute亚洲线路一久| 久久影院视频免费| 午夜av电影一区| 91视频在线看| 国产目拍亚洲精品99久久精品| 日韩二区三区在线观看| 99re热视频这里只精品 | 日韩午夜激情av| 亚洲激情网站免费观看| 国产99久久久国产精品| 欧美大胆人体bbbb| 五月综合激情网| 91黄视频在线观看| 久久亚洲春色中文字幕久久久| 亚洲与欧洲av电影| 波多野洁衣一区| 国产三级精品三级在线专区| 久久成人免费网| 538在线一区二区精品国产| 亚洲综合丝袜美腿| 91行情网站电视在线观看高清版| 国产欧美精品区一区二区三区| 久久99精品久久久久久| 欧美一二三区在线观看| 偷窥国产亚洲免费视频| 欧美日韩亚洲丝袜制服| 亚洲午夜一区二区三区| 色999日韩国产欧美一区二区| 中文字幕一区二区不卡| a美女胸又www黄视频久久| 国产清纯美女被跳蛋高潮一区二区久久w | 一区二区三区视频在线观看| 成人午夜视频网站| 国产精品美女久久久久aⅴ | 91精品国产高清一区二区三区蜜臀| 亚洲影院理伦片| 欧美日韩综合在线| 日本不卡视频一二三区| 日韩一区二区在线看片|