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

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

?? model-2a.c

?? Lossless Data Compression Toolkit Version 1.1 of the lossless data compression toolkit by Nico deVri
?? 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()
{
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品网站导航| 99久久精品免费看国产| 678五月天丁香亚洲综合网| 亚洲资源中文字幕| 91精品国产色综合久久ai换脸| 亚洲国产成人精品视频| 制服丝袜av成人在线看| 日本一区中文字幕| 亚洲精品一区二区三区影院 | 日韩午夜精品视频| 韩国午夜理伦三级不卡影院| 国产日韩av一区| 不卡的av电影| 亚洲第一福利视频在线| 日韩精品专区在线影院观看| 国产精品综合一区二区三区| 国产精品免费久久| 在线免费不卡电影| 韩国理伦片一区二区三区在线播放 | 国产一区二区三区不卡在线观看 | 亚洲精品在线网站| av在线播放不卡| 亚洲二区视频在线| 久久影院电视剧免费观看| 播五月开心婷婷综合| 亚洲免费视频中文字幕| 欧美一区二区三区四区高清| 成人午夜免费电影| 日日嗨av一区二区三区四区| 欧美激情综合五月色丁香小说| 欧美三级韩国三级日本三斤| 激情偷乱视频一区二区三区| 亚洲三级免费观看| 精品日韩一区二区三区 | 国产精品66部| 一区二区日韩av| 精品欧美一区二区久久| 色婷婷国产精品| 国产精品资源网站| 亚洲成人激情自拍| 国产精品美女久久久久久| 欧美日韩国产高清一区| 成人a免费在线看| 麻豆精品国产91久久久久久| 中文字幕佐山爱一区二区免费| 欧美大胆一级视频| 欧美日韩精品是欧美日韩精品| 国产精品自拍三区| 蜜桃av噜噜一区| 亚洲一区二区精品久久av| 久久免费看少妇高潮| 欧美一区二区三区播放老司机| 成人免费的视频| 裸体健美xxxx欧美裸体表演| 亚洲一区二区在线免费观看视频| 久久美女艺术照精彩视频福利播放| 日本道精品一区二区三区| 国产精品一二三四五| 六月丁香婷婷久久| 手机精品视频在线观看| 中文字幕亚洲欧美在线不卡| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲欧美综合另类在线卡通| 日韩精品中文字幕一区| 欧美男女性生活在线直播观看| 99久久久久久99| 成人高清伦理免费影院在线观看| 黄色小说综合网站| 青娱乐精品视频| 日本成人在线电影网| 亚洲超碰97人人做人人爱| 一区二区三区不卡在线观看| 成人欧美一区二区三区视频网页| 国产精品美女久久久久久久久久久 | 中文av一区二区| 久久久影视传媒| 精品国产91亚洲一区二区三区婷婷| 欧美人狂配大交3d怪物一区| 欧美三级三级三级爽爽爽| 在线视频欧美精品| 色综合久久综合网欧美综合网| 99精品热视频| 日本精品一区二区三区高清| 欧美在线免费观看亚洲| 欧美男生操女生| 日韩免费福利电影在线观看| 日韩无一区二区| 欧美精品一区二区三区高清aⅴ| 欧美一区二区黄| 日韩精品专区在线影院重磅| 久久一夜天堂av一区二区三区| 亚洲精品在线免费观看视频| 国产三级精品在线| 最新热久久免费视频| 亚洲老司机在线| 午夜视频在线观看一区二区 | 黑人巨大精品欧美黑白配亚洲| 精品亚洲成a人在线观看| 激情六月婷婷久久| 成人中文字幕在线| 91在线观看免费视频| 欧美体内she精视频| 精品国产在天天线2019| 毛片av一区二区| 国产在线视视频有精品| 高清在线不卡av| 97久久久精品综合88久久| 欧美日韩视频在线第一区 | 丁香激情综合国产| 91一区在线观看| 欧美喷水一区二区| 久久精品夜色噜噜亚洲a∨| 中文字幕日本乱码精品影院| 亚洲图片欧美一区| 精东粉嫩av免费一区二区三区| 成人av动漫网站| 欧美精品第1页| 久久精品在这里| 亚洲成人免费视| 国产乱人伦偷精品视频免下载| 色婷婷国产精品久久包臀| 日韩视频一区二区| 亚洲免费观看高清完整版在线观看熊 | 亚洲国产成人在线| 午夜免费欧美电影| 成人一区二区三区视频在线观看| 91高清视频免费看| 久久久精品蜜桃| 婷婷夜色潮精品综合在线| 国产91精品在线观看| 欧美日本视频在线| 亚洲丝袜美腿综合| 激情深爱一区二区| 欧美日韩高清影院| 最新中文字幕一区二区三区| 国产一区二区在线电影| 欧美日韩国产小视频| 综合色中文字幕| 国产精品 欧美精品| 91精品国产色综合久久不卡电影| 亚洲精品视频在线看| 国产毛片精品视频| 日韩一区二区在线观看视频| 一区二区三区中文免费| 高清在线成人网| 久久久91精品国产一区二区精品| 免费久久精品视频| 欧美色综合网站| 一区二区三区在线看| www.99精品| 亚洲国产经典视频| 国产精华液一区二区三区| 日韩免费福利电影在线观看| 无码av免费一区二区三区试看| 91免费观看国产| 亚洲欧美另类久久久精品| 国产精品综合一区二区| 欧美一区二区啪啪| 免费观看日韩电影| 日韩午夜av一区| 蜜桃在线一区二区三区| 91精品国产入口| 久久精品噜噜噜成人av农村| 在线不卡免费av| 全国精品久久少妇| 日韩欧美国产一区二区三区| 人人爽香蕉精品| 麻豆精品视频在线观看视频| 亚洲人123区| 波多野结衣欧美| 国产婷婷色一区二区三区| 加勒比av一区二区| 一本久久综合亚洲鲁鲁五月天| 福利视频网站一区二区三区| 日韩欧美在线一区二区三区| 免费成人在线观看| 日韩三级高清在线| 久久成人久久鬼色| 久久伊人蜜桃av一区二区| 极品少妇xxxx偷拍精品少妇| 久久精品一区二区| 91网站在线播放| 亚洲高清免费一级二级三级| 欧美精品第一页| 国产在线观看一区二区| 国产欧美一区二区精品性色| 成人av中文字幕| 夜夜爽夜夜爽精品视频| 亚洲精品一区二区三区福利| 免费观看91视频大全| 精品少妇一区二区三区视频免付费 | 国产性做久久久久久| 国产99精品在线观看| 亚洲人成网站色在线观看| 欧美日韩综合色| 精品一区二区三区免费观看| 国产欧美精品一区二区三区四区 | 免费在线观看一区| 国产欧美日本一区视频| 日本道免费精品一区二区三区|