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

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

?? comp-2.c

?? 包含Lzw,Huff1,Dhuff等等多種壓縮算法的源代碼包。
?? C
字號:
/*
 * Listing 10 -- comp-2.c
 *
 * This module is the driver program for a variable order
 * finite context compression program.  The maximum order is
 * determined by command line option.  This particular version
 * also monitors compression ratios, and flushes the model whenever
 * the local (last 256 symbols) compression ratio hits 90% or higher.
 *
 * To build this program:
 *
 * Turbo C:     tcc -w -mc comp-2.c model-2.c bitio.c coder.c
 * QuickC:      qcl /AC /W3 comp-2.c model-2.c bitio.c coder.c
 * Zortech:     ztc -mc comp-2.c model-2.c bitio.c coder.c
 * *NIX:        cc -o comp-2 comp-2.c model-2.c bitio.c coder.c
 *
 * Command line options:
 *
 *  -f text_file_name  [defaults to test.inp]
 *  -c compressed_file_name [defaults to test.cmp]
 *  -o order [defaults to 3 for model-2]
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "coder.h"
#include "model.h"
#include "bitio.h"

/*
 * The file pointers are used throughout this module.
 */
FILE *text_file;
FILE *compressed_file;

/*
 * Declarations for local procedures.
 */
void initialize_options( int argc, char **argv );
int check_compression( void );
void print_compression( void );

/*
 * The main procedure is similar to the main found in COMP-1.C.
 * It has to initialize the coder, the bit oriented I/O, the
 * standard I/O, and the model.  It then sits in a loop reading
 * input symbols and encoding them.  One difference is that every
 * 256 symbols a compression check is performed.  If the compression
 * ratio exceeds 90%, a flush character is encoded.  This flushes
 * the encoding model, and will cause the decoder to flush its model
 * when the file is being expanded.  The second difference is that
 * each symbol is repeatedly encoded until a succesfull encoding
 * occurs.  When trying to encode a character in a particular order,
 * the model may have to transmit an ESCAPE character.  If this
 * is the case, the character has to be retransmitted using a lower
 * order.  This process repeats until a succesful match is found of
 * the symbol in a particular context.  Usually this means going down
 * no further than the order -1 model.  However, the FLUSH and DONE
 * symbols do drop back to the order -2 model.  Note also that by
 * all rights, add_character_to_model() and update_model() logically
 * should be combined into a single routine.
 */
void main( int argc, char **argv )
{
    SYMBOL s;
    int c;
    int escaped;
    int flush = 0;
    long int text_count = 0;

    initialize_options( --argc, ++argv );
    initialize_model();
    initialize_output_bitstream();
    initialize_arithmetic_encoder();
    for ( ; ; )
    {
	if ( ( ++text_count & 0x0ff ) == 0 )
            flush = check_compression();
        if ( !flush )
            c = getc( text_file );
        else
            c = FLUSH;
        if ( c == EOF )
            c = DONE;
        do {
            escaped = convert_int_to_symbol( c, &s );
            encode_symbol( compressed_file, &s );
        } while ( escaped );
        if ( c == DONE )
	    break;
        if ( c == FLUSH )
	{
	    flush_model();
            flush = 0;
	}
        update_model( c );
        add_character_to_model( c );
    }
    flush_arithmetic_encoder( compressed_file );
    flush_output_bitstream( compressed_file );
    print_compression();
    fputc( '\n', stderr );
    exit( 0 );
}

/*
 * This routine checks for command line options, and opens the
 * input and output files.  The only other command line option
 * besides the input and output file names is the order of the model,
 * which defaults to 3.
 */
void initialize_options( int argc, char **argv )
{
    char text_file_name[ 81 ];
    char compressed_file_name[ 81 ];

    strcpy( compressed_file_name, "test.cmp" );
    strcpy( text_file_name, "test.inp" );
    while ( argc-- > 0 )
    {
        if ( strcmp( *argv, "-f" ) == 0 )
	{
	    argc--;
	    strcpy( text_file_name, *++argv );
	}
        else if ( strcmp( *argv, "-c" ) == 0 )
	{
	    argc--;
	    strcpy( compressed_file_name, *++argv );
	}
        else if ( strcmp( *argv, "-o" ) == 0 )
	{
	    argc--;
            max_order = atoi( *++argv );
	}
	else
	{
            fprintf( stderr, "\nUsage: COMP-2 [-o order] " );
            fprintf( stderr, "[-f text file] [-c compressed file]\n" );
            exit( -1 );
	}
	argc--;
	argv++;
    }
    text_file = fopen( text_file_name, "rb" );
    compressed_file = fopen( "test.cmp", "wb" );
    if ( text_file == NULL || compressed_file == NULL )
    {
        printf( "Had trouble opening one of the files!\n" );
        exit( -1 );
    }
    setvbuf( text_file, NULL, _IOFBF, 4096 );
    setbuf( stdout, NULL );
    printf( "Compressing %s to %s, order %d.\n",
            text_file_name,
            compressed_file_name,
            max_order );
}

/*
 * This routine is called to print the current compression ratio.
 * It prints out the number of input bytes, the number of output bytes,
 * and the bits per byte compression ratio.   This is done both as a
 * pacifier and as a seat-of-the-pants diagnostice.  A better version
 * of this routine would also print the local compression ratio.
 */
void print_compression()
{
    long total_input_bytes;
    long total_output_bytes;

    total_input_bytes  =  ftell( text_file );
    total_output_bytes = bit_ftell_output( compressed_file );
    if ( total_output_bytes == 0 )
        total_output_bytes = 1;

    fprintf( stderr,"%ld/%ld, %2.3f\r",
	     total_input_bytes,
	     total_output_bytes,
             8.0 * total_output_bytes / total_input_bytes );
}

/*
 * This routine is called once every 256 input symbols.  Its job is to
 * check to see if the compression ratio hits or exceeds 90%.  If the
 * output size is 90% of the input size, it means not much compression
 * is taking place, so we probably ought to flush the statistics in the
 * model to allow for more current statistics to have greater impactic.
 * This heuristic approach does seem to have some effect.
 */
int check_compression()
{
    static long local_input_marker = 0L;
    static long local_output_marker = 0L;
    long total_input_bytes;
    long total_output_bytes;
    int local_ratio;

    print_compression();
    total_input_bytes  =  ftell( text_file ) - local_input_marker;
    total_output_bytes = bit_ftell_output( compressed_file );
    total_output_bytes -= local_output_marker;
    if ( total_output_bytes == 0 )
        total_output_bytes = 1;
    local_ratio = (int)( ( total_output_bytes * 100 ) / total_input_bytes );

    local_input_marker = ftell( text_file );
    local_output_marker = bit_ftell_output( compressed_file );

    if ( local_ratio > 90 && flushing_enabled )
    {
        fprintf( stderr, "Flushing... \r" );
        return( 1 );
    }
    return( 0 );
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美sm极限捆绑bd| 成人国产精品免费观看动漫| 国产精品国模大尺度视频| 精品嫩草影院久久| 日韩女优制服丝袜电影| 欧美精品一区二区三| 国产三级精品在线| 国产精品乱码妇女bbbb| 亚洲色图在线视频| 91黄色免费网站| 日本精品一级二级| 国产精品剧情在线亚洲| 欧美一级淫片007| 免费久久99精品国产| 国产欧美一区二区精品性色| 色一情一乱一乱一91av| 日韩激情在线观看| 久久久久国产一区二区三区四区 | 7878成人国产在线观看| 久久电影网电视剧免费观看| 国产精品视频一二三区| 欧美日韩美少妇| 在线视频一区二区三区| 老鸭窝一区二区久久精品| 久久久久久久性| 欧美主播一区二区三区美女| 日本欧美一区二区| 国产精品久久久久久久久搜平片| 欧美色老头old∨ideo| 国产美女精品在线| 亚洲色图欧美激情| 欧美tickling网站挠脚心| 91偷拍与自偷拍精品| 美女视频免费一区| 亚洲三级在线免费观看| 日韩欧美视频在线| 91官网在线观看| 成人一区二区三区在线观看| 日韩激情视频网站| 亚洲女同ⅹxx女同tv| 久久日韩粉嫩一区二区三区| 欧美性大战久久| 成人精品免费网站| 激情图片小说一区| 日日嗨av一区二区三区四区| 亚洲欧美在线另类| 久久尤物电影视频在线观看| 精品视频1区2区3区| 粗大黑人巨茎大战欧美成人| 毛片av中文字幕一区二区| 一区二区三区四区乱视频| 久久只精品国产| 欧美变态tickle挠乳网站| 欧美最猛性xxxxx直播| 成人精品小蝌蚪| 国产91精品一区二区麻豆网站| 日韩 欧美一区二区三区| 亚洲欧美另类小说视频| 欧美高清在线精品一区| 久久午夜羞羞影院免费观看| 欧美一区二区三区四区久久| 日本韩国精品在线| 色综合中文字幕国产 | 丁香六月综合激情| 亚洲色图19p| 亚洲丝袜另类动漫二区| 欧美日韩中文字幕精品| 精品一区二区三区免费播放| 国产日本一区二区| 一本到三区不卡视频| 久久99热99| 专区另类欧美日韩| 26uuu精品一区二区| 亚洲激情av在线| 中文字幕电影一区| wwww国产精品欧美| 2欧美一区二区三区在线观看视频| 欧美裸体一区二区三区| 欧美丝袜丝交足nylons| 欧美日韩久久一区| 欧美一卡2卡三卡4卡5免费| 欧美日韩免费高清一区色橹橹| 欧美在线999| 欧美理论片在线| 日韩亚洲欧美在线观看| 精品国产一区二区三区久久久蜜月| 日韩一区二区三区高清免费看看| 日韩欧美亚洲国产另类| 国产亚洲欧美日韩在线一区| 久久免费美女视频| 国产精品久久久久影视| 亚洲精选免费视频| 亚洲一区二区综合| 免费日韩伦理电影| 精品久久免费看| 国产午夜精品久久久久久免费视| 久久精品夜夜夜夜久久| 国产精品欧美一级免费| 亚洲精品写真福利| 三级精品在线观看| 国产剧情一区在线| 色综合天天综合色综合av | 国产精品99久久不卡二区| 大白屁股一区二区视频| 91官网在线观看| 日韩欧美中文字幕公布| 国产亚洲午夜高清国产拍精品 | 亚洲综合一区二区三区| 免费在线看成人av| 风间由美一区二区三区在线观看 | 精品一区二区精品| 成人99免费视频| 欧美日韩国产高清一区二区三区| www日韩大片| 一区av在线播放| 精品一区二区在线视频| 一本大道久久a久久精二百| 欧美一区二区三区白人| 国产精品国产三级国产aⅴ中文 | 亚洲免费在线视频一区 二区| 五月综合激情日本mⅴ| 国产v综合v亚洲欧| 欧美色图一区二区三区| 国产丝袜美腿一区二区三区| 亚洲午夜一区二区三区| 国产成人免费xxxxxxxx| 6080日韩午夜伦伦午夜伦| 中文字幕欧美一| 韩国av一区二区三区四区 | 日韩三级精品电影久久久| 中文字幕一区在线观看视频| 美洲天堂一区二卡三卡四卡视频| 91蜜桃传媒精品久久久一区二区| 777xxx欧美| 69久久99精品久久久久婷婷| 亚州成人在线电影| 成年人网站91| 久久久99精品免费观看不卡| 天天亚洲美女在线视频| 成人美女视频在线看| 成人的网站免费观看| 麻豆国产精品一区二区三区| 日韩精品一区二区三区中文不卡| 国产精品亚洲а∨天堂免在线| 中文字幕一区免费在线观看| 欧美三级视频在线播放| 蜜桃视频在线观看一区| 91日韩精品一区| 欧美国产一区在线| 高清av一区二区| 亚洲欧美偷拍三级| 精品午夜一区二区三区在线观看| 欧美日韩和欧美的一区二区| 亚洲乱码中文字幕| 欧美日韩国产成人在线91| 三级欧美在线一区| 91精品在线麻豆| 国产91精品一区二区麻豆网站 | 欧美日韩高清一区| 奇米影视一区二区三区| 精品国产1区二区| 国产91丝袜在线观看| 伊人一区二区三区| 日韩一级精品视频在线观看| 国产曰批免费观看久久久| ...中文天堂在线一区| 欧美另类z0zxhd电影| 国产精品综合一区二区三区| 亚洲欧美区自拍先锋| 日韩一区二区在线免费观看| 国产福利一区二区三区视频在线 | 亚洲美女偷拍久久| 欧美日韩视频在线第一区| 精彩视频一区二区三区| 亚洲欧美自拍偷拍色图| 91精品午夜视频| 不卡一区二区在线| 蜜桃久久av一区| 亚洲同性同志一二三专区| 欧美精品黑人性xxxx| 成人午夜av影视| 五月婷婷综合在线| 中文字幕制服丝袜一区二区三区 | 欧洲亚洲国产日韩| 极品少妇xxxx精品少妇| 亚洲精品国产精品乱码不99| 久久久久亚洲综合| 欧美日韩国产免费| 99久久久久久| 久久精品国产亚洲5555| 一区二区三区中文字幕| 久久久精品免费网站| 欧美在线999| caoporen国产精品视频| 蜜桃免费网站一区二区三区| 亚洲精品一二三四区| 国产亚洲精品久| 欧美一区二区视频在线观看2022| 99精品一区二区| 国产成人精品免费|