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

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

?? model-2a.c

?? 包含Lzw,Huff1,Dhuff等等多種壓縮算法的源代碼包。
?? 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()
{
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久成人免费网| 在线这里只有精品| 日韩久久一区二区| 91精品国产综合久久蜜臀| 国产成人亚洲精品青草天美| 一区二区三区精品久久久| 日韩免费观看高清完整版| 99视频一区二区三区| 免费在线看成人av| 亚洲理论在线观看| 久久久久国产精品厨房| 欧美日本一道本在线视频| www.亚洲色图.com| 国产精品一区二区在线看| 天堂va蜜桃一区二区三区| 最新日韩在线视频| 久久精品欧美日韩精品| 91精品国产色综合久久ai换脸| 91在线观看下载| 国产1区2区3区精品美女| 麻豆精品精品国产自在97香蕉| 一区二区三区欧美在线观看| 国产精品全国免费观看高清| 精品国产凹凸成av人导航| 欧美一区二视频| 欧美日韩不卡一区二区| 色哟哟国产精品| 99精品一区二区三区| 成人黄色大片在线观看| 国产精品一区久久久久| 国产剧情一区在线| 国产一区欧美二区| 久久国产精品99久久久久久老狼| 午夜伊人狠狠久久| 五月激情综合网| 图片区日韩欧美亚洲| 婷婷夜色潮精品综合在线| 亚洲国产欧美在线| 亚洲成人www| 一区av在线播放| 亚洲一区在线视频观看| 亚洲一区二区三区不卡国产欧美| 亚洲精选一二三| 一区二区三区资源| 夜夜嗨av一区二区三区中文字幕| 一区二区三区**美女毛片| 亚洲人吸女人奶水| 亚洲精品成人少妇| 亚洲国产精品精华液网站| 亚洲香肠在线观看| 日日摸夜夜添夜夜添国产精品 | 免费在线观看一区| 久久国产人妖系列| 国产精品一区二区久久不卡| 国产91富婆露脸刺激对白| 成人在线综合网| 色老汉av一区二区三区| 欧美亚洲一区二区在线| 欧美日韩成人高清| 亚洲精品一区二区精华| 国产清纯美女被跳蛋高潮一区二区久久w| 国产亚洲成aⅴ人片在线观看| 国产精品热久久久久夜色精品三区 | 亚洲综合男人的天堂| 亚洲国产cao| 麻豆精品一区二区| 成人黄色免费短视频| 欧美亚洲一区三区| 精品国产网站在线观看| 国产午夜精品一区二区三区四区| 亚洲欧洲av另类| 午夜精品在线看| 国产麻豆91精品| 91麻豆免费在线观看| 4hu四虎永久在线影院成人| 精品va天堂亚洲国产| 中文字幕在线免费不卡| 亚洲国产精品一区二区www| 国内精品久久久久影院一蜜桃| gogogo免费视频观看亚洲一| 欧美日韩国产综合一区二区| 欧美精品一区二区三区蜜桃视频 | 欧美日韩aaaaaa| 久久久国产精华| 亚洲综合在线免费观看| 国内不卡的二区三区中文字幕| 96av麻豆蜜桃一区二区| 日韩午夜精品视频| 亚洲丝袜美腿综合| 精品一区二区三区影院在线午夜| 972aa.com艺术欧美| 精品入口麻豆88视频| 亚洲精品老司机| 国产精品一级二级三级| 欧美色图天堂网| 欧美高清一级片在线观看| 日韩激情在线观看| 91网上在线视频| 2023国产精品自拍| 视频在线观看国产精品| 成人禁用看黄a在线| 欧美r级在线观看| 亚洲影视在线播放| 不卡的av在线| 久久久久9999亚洲精品| 视频一区视频二区在线观看| 99久久久免费精品国产一区二区| 日韩欧美电影一区| 亚洲电影你懂得| 99在线热播精品免费| 久久精品一区蜜桃臀影院| 美女网站视频久久| 欧美喷潮久久久xxxxx| 亚洲色欲色欲www| 成人涩涩免费视频| 精品久久人人做人人爽| 人人超碰91尤物精品国产| 欧洲另类一二三四区| 亚洲欧美综合色| 成人高清免费观看| 亚洲国产精华液网站w| 狠狠色综合日日| 日韩亚洲欧美高清| 日韩国产在线一| 欧美日韩精品专区| 亚洲国产精品天堂| 欧美探花视频资源| 亚洲综合免费观看高清完整版在线 | 国产福利一区在线观看| 日韩美女天天操| 蜜桃传媒麻豆第一区在线观看| 欧美日韩视频不卡| 午夜精品一区二区三区电影天堂 | 九九九精品视频| 日韩欧美精品在线视频| 奇米影视7777精品一区二区| 欧美三片在线视频观看| 亚洲午夜久久久久久久久电影院| 色欧美片视频在线观看| 亚洲精品中文在线观看| 91在线云播放| 亚洲精品久久久蜜桃| 色婷婷av一区二区三区之一色屋| 亚洲黄色免费电影| 欧洲生活片亚洲生活在线观看| 亚洲一区二三区| 欧美日韩高清一区二区三区| 亚洲成a人v欧美综合天堂| 欧美日韩三级视频| 男人的j进女人的j一区| 精品日韩在线观看| 丰满白嫩尤物一区二区| ㊣最新国产の精品bt伙计久久| 在线亚洲高清视频| 爽爽淫人综合网网站| 精品国产免费一区二区三区香蕉| 国产乱码字幕精品高清av| 欧美国产一区二区在线观看 | 欧美不卡视频一区| 国产精品 欧美精品| 最新热久久免费视频| 在线看日本不卡| 日本vs亚洲vs韩国一区三区| 精品对白一区国产伦| 成人av在线资源| 亚洲午夜三级在线| 精品播放一区二区| 色综合一区二区| 日本美女一区二区三区| 久久久99免费| 91成人网在线| 久久www免费人成看片高清| 国产精品免费视频观看| 欧美日韩一本到| 国产一区二区在线观看免费| 最新日韩av在线| 欧美一区二区三区四区久久 | 色婷婷综合在线| 成人教育av在线| 日韩一区二区三区在线视频| 国产精品欧美经典| 久久五月婷婷丁香社区| 中文字幕在线不卡| 国产精品视频一二| 裸体一区二区三区| 欧美白人最猛性xxxxx69交| 成人久久久精品乱码一区二区三区 | 亚洲免费伊人电影| 精品少妇一区二区三区在线播放| 成人av电影在线网| 日本一不卡视频| 综合欧美亚洲日本| 欧美videofree性高清杂交| 色综合久久久网| 国内精品国产成人| 婷婷综合另类小说色区| 中文字幕日韩一区| 久久色.com| 在线播放日韩导航| 色综合色综合色综合色综合色综合|