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

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

?? model-2a.c

?? 包含Lzw,Huff1,Dhuff等等多種壓縮算法的源代碼包
?? C
字號(hào):
/*
 * 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()
{
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91网站黄www| 欧美一级片在线| 五月天激情综合| 国产日产欧美一区二区三区| 欧美日韩在线观看一区二区 | 国产精品18久久久久久久久久久久| 国产精品天美传媒| 91精品国产手机| av不卡免费电影| 国内精品久久久久影院色 | 亚洲 欧美综合在线网络| 国产亚洲一二三区| 91精品国产乱码久久蜜臀| 99久久精品国产一区二区三区| 麻豆91免费观看| 亚洲成人tv网| 亚洲欧美电影院| 国产欧美一区二区精品性色| 91精品国模一区二区三区| 91国产成人在线| 成人h动漫精品一区二| 国产中文字幕精品| 男男gaygay亚洲| 午夜视频一区二区| 亚洲成人一区在线| 亚洲一区二区视频在线观看| 综合激情成人伊人| 最新日韩在线视频| 亚洲国产精品ⅴa在线观看| 亚洲精品在线免费播放| 精品伦理精品一区| 日韩视频一区在线观看| 欧美日韩精品一区二区三区四区 | 99精品欧美一区二区蜜桃免费| 国产精品白丝av| 加勒比av一区二区| 国模娜娜一区二区三区| 精品影视av免费| 老色鬼精品视频在线观看播放| 日韩国产欧美视频| 日本系列欧美系列| 日本中文一区二区三区| 日本aⅴ精品一区二区三区| 亚洲国产精品久久不卡毛片| 亚洲国产精品影院| 日本sm残虐另类| 精品一区二区三区在线视频| 精品一区二区三区久久| 国产精品自拍毛片| 成人久久视频在线观看| 成人午夜精品在线| 中文字幕精品综合| 国产精品超碰97尤物18| 日韩久久一区二区| 一区二区三区在线播放| 一区二区三区日本| 天堂在线亚洲视频| 免费成人你懂的| 黄色资源网久久资源365| 国产精品一区二区三区99| 岛国av在线一区| 91在线一区二区三区| 欧美少妇性性性| 欧美一区二区黄色| 国产欧美一区二区三区在线看蜜臀| 国产精品欧美经典| 亚洲自拍都市欧美小说| 青青草国产精品97视觉盛宴| 国产一区二区三区美女| 成人免费va视频| 欧美日韩免费观看一区二区三区 | 久久影院视频免费| **性色生活片久久毛片| 亚洲国产精品视频| 国产综合成人久久大片91| 粉嫩av一区二区三区在线播放| 99国产精品99久久久久久| 欧美日韩国产精品成人| 久久天堂av综合合色蜜桃网| 亚洲视频精选在线| 蜜臀久久99精品久久久久久9| 成人av资源在线| 欧美日韩不卡在线| 欧美激情一区二区在线| 一区二区三区在线播| 韩国精品主播一区二区在线观看 | 精品欧美久久久| 国产精品色眯眯| 亚洲图片自拍偷拍| 国产麻豆精品一区二区| 欧美性videosxxxxx| 久久蜜桃香蕉精品一区二区三区| 亚洲影视在线观看| 国产精品99久久久久久久女警| 欧美色电影在线| 国产日韩精品一区| 蜜桃av一区二区| 日本二三区不卡| 国产亚洲欧美日韩俺去了| 午夜精品一区二区三区电影天堂 | 日韩电影网1区2区| thepron国产精品| 日韩精品在线一区二区| 一区二区三区四区不卡在线| 国产精品一区三区| 亚洲午夜激情网页| 成人免费视频app| 日韩精品一区二区三区中文不卡 | 日韩精品成人一区二区三区| 99精品欧美一区二区三区综合在线| 精品欧美黑人一区二区三区| 一个色妞综合视频在线观看| 成人深夜在线观看| 久久综合狠狠综合久久激情 | 精品一二三四在线| 欧美熟乱第一页| 日韩毛片高清在线播放| 国模娜娜一区二区三区| 欧美一区二区在线观看| 亚洲超碰精品一区二区| 色哟哟亚洲精品| 国产精品欧美一区喷水| 国产高清无密码一区二区三区| 日韩午夜在线观看视频| 日韩中文字幕1| 欧美视频你懂的| 一二三区精品福利视频| 一本色道综合亚洲| 最新高清无码专区| 国产91在线观看丝袜| 久久精品一区四区| 国产成人av一区二区三区在线观看| 日韩免费观看2025年上映的电影| 亚洲成人一区二区在线观看| 欧美性生交片4| 亚洲一区国产视频| 欧美亚洲国产一区二区三区va | 亚洲另类在线一区| 99国产精品久久久| 亚洲欧美一区二区久久 | 欧美视频一区二区三区| 亚洲福中文字幕伊人影院| 欧美视频一二三区| 天天操天天综合网| 欧美一区二区三区小说| 人人狠狠综合久久亚洲| 日韩午夜在线影院| 国产综合成人久久大片91| 久久久电影一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 国产视频视频一区| 不卡一区二区三区四区| 亚洲精品免费视频| 欧美私模裸体表演在线观看| 日欧美一区二区| 精品免费99久久| 成人一区二区在线观看| 亚洲欧洲色图综合| 欧美亚洲综合在线| 免费久久99精品国产| 久久精品一区二区三区av| 99re在线视频这里只有精品| 中文字幕中文字幕一区| 91黄色免费版| 日韩在线一二三区| 久久久综合网站| 97超碰欧美中文字幕| 香蕉乱码成人久久天堂爱免费| 日韩欧美亚洲另类制服综合在线 | 5566中文字幕一区二区电影| 国内久久精品视频| 成人免费在线观看入口| 欧美日韩国产免费| 国产一区二区中文字幕| 国产精品国产自产拍高清av| 欧美三级韩国三级日本三斤| 久久国产精品色婷婷| 国产精品国产三级国产| 欧美日韩不卡一区| 高清视频一区二区| 亚洲国产精品麻豆| 欧美国产精品中文字幕| 精品视频在线看| 国产高清成人在线| 亚洲图片有声小说| 国产日本亚洲高清| 欧美人与禽zozo性伦| 丁香六月久久综合狠狠色| 一级中文字幕一区二区| 国产亚洲精品福利| 欧美午夜精品电影| 国产成人精品亚洲777人妖| 亚洲第一精品在线| 国产精品青草综合久久久久99| 日韩一区二区三| 色婷婷综合久久久久中文| 国产精品77777| 日韩av在线播放中文字幕| 亚洲日本在线观看| 久久久99精品免费观看|