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

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

?? model.c

?? A
?? C
?? 第 1 頁 / 共 3 頁
字號:

                base_freq [order] = cfreq;

                t = (freq [i] + 1) >> 1;
                freq [i] = t;
                i ++;

                cfreq += t;
        }

        for (; i < MAX_CHAR_CODE; i ++)
        {
                if (level [i] == order)
                {
                        t = (freq [i] + 1) >> 1;
                        freq [i] = t;
                        cfreq += t;
                }
        }

        active_state.order_cum_freq [order] = cfreq;
}


/*
        Determine symbol frequency counts for coder
*/

static void calc_symbol_freq (int ch)

{
        int i;

        active_state.match_level = level [ch];
        active_state.sym_freq = freq [ch];

        if (active_state.match_level > 1)
                active_state.base_count = base_freq [active_state.match_level];
        else
        {
                active_state.base_count = 0;
                for (i = 0; i < ch; i ++)
                {
                        if (level [i] == active_state.match_level)
                                active_state.base_count += freq [i];
                }
        }
}


/*
        Select state structure containing symbol to be output
        Generate coded symbol value if required

        Note that there is a one character delay during substring matching
        so that the non matching character at end of string is not output
        until after string replacement has occurred
*/

static void select_output_symbol (void)

{
        switch (string_state)
        {
                case STRING_START:
                        last_state = active_state;
                        string_state = STRING_ACTIVE;
                        break;

                case STRING_ACTIVE:
                        encode_symbol (&last_state);
                        last_state = active_state;
                        break;

                default:
                        encode_symbol (&active_state);
                        break;
        }
}


/*
        Generate coded value for symbol defined by input state variable
        State includes symbol frequencies and all values used by coder
*/

static void encode_symbol (struct model *cptr)

{
        int i;

        new_symbol_count = MAX_SYM;
        i = cptr -> match_level;
        while (i < cptr -> initial_level)
        {
                new_symbol_count -= cptr -> order_sym_count [cptr -> initial_level];
                generate_switch_code (cptr);
                cptr -> initial_level --;
        }

        new_symbol_count -= cptr -> order_sym_count [i];
        generate_symbol_code (cptr);
}


/*
        Generate code for switch character to select next lower context
        Input consists of state variable for symbol
*/

static void generate_switch_code (struct model *cptr)

{
        unsigned c1;
        unsigned n, m;

        n = cptr -> initial_level;
        c1 = cptr -> order_cum_freq [n];
        m = switch_char_freq (cptr -> order_sym_count [n], c1);

        EncodeArith (c1, m, c1 + m);
}


/*
        Generate code for symbol defined by input state variable
*/

static void generate_symbol_code (struct model *cptr)

{
        unsigned int c1, c2, c3;
        int n;

        n = cptr -> initial_level;
        c1 = cptr -> base_count;
        c2 = cptr -> sym_freq;
        c3 = cptr -> order_cum_freq [n];

        if (n > 0) c3 += switch_char_freq (cptr -> order_sym_count [n], c3);

        EncodeArith (c1, c2, c3);
}



/*
        Estimate frequency to be allocated to the switch character
        Use number of symbols referenced in current context and the
        number of unreferenced symbols so far

        Value should reflect probability of encountering a symbol
        already present in the active context
*/

static unsigned switch_char_freq (unsigned scount, unsigned cmax)

{       unsigned n;

        n = (scount + 1) * new_symbol_count / (scount + new_symbol_count);
        if (n + cmax > MAX_CUM_FREQ) n = MAX_CUM_FREQ + 1 - cmax;

        return n;
}


/*
        End of compression procedure
        Terminate active substring processing
        Close arithmetic coder and flush output
*/

void CloseModel (void)

{
        if (string_state == STRING_ACTIVE) clear_text_string ();
        CloseCoder ();
}



/*
        Decode next input symbol from input stream
        Test for context switch and repeat until non switch symbol encountered
*/

static int decode_symbol (void)

{
        int ch;

        new_symbol_count = MAX_SYM;
        active_state.match_level = active_state.initial_level;

        new_symbol_count -= active_state.order_sym_count [active_state.match_level];
        ch = decode_active_state ();

        while (ch == SWITCH_SYM)
        {
                active_state.match_level --;
                new_symbol_count -= active_state.order_sym_count [active_state.match_level];
                ch = decode_active_state ();
        }

        if (ch == START_STRING) ch = start_decode_string ();

        return ch;
}



/*
        Start of string symbol encountered
        Extract string length and position from input stream
        Returns first character in string
*/

static int start_decode_string (void)

{
        unsigned i, j, k;
        unsigned n;

        string_len = decode_value (MAX_STR_CODE);
        if (string_len == MAX_STR_CODE - 1) string_len += decode_value (256);
        string_len += MIN_STR;

        i = decode_value (max_pos_size);
        if (i == 0)
        {
                i = 2;
                j = decode_value (2);
        }
        else
        if (i > 8)
        {
                j = decode_value (256);
                i -= 8;
                n = 1 << i;
                k = decode_value (n);
                k += n;
                k <<= 8;
                j += k;
        }
        else
        {
                n = 1 << i;
                j = decode_value (n);
                j += n;
        }

        string_pos = node < j + MAX_ORDER ? node + NDICT - j : node - j;

        return decode_string_char ();
}



/*
        Locate next character in text substring
        Increment string pointers and decrement length
        Set parameters used for updating state variable
*/

static int decode_string_char (void)

{
        int ch;
        unsigned int j;

        ch = dict [string_pos];
        active_state.match_level = level [ch];

        string_len --;
        if (++ string_pos == MAX_DICT) string_pos = MAX_ORDER;

        last_search_node = dict [node - 1] + MAX_DICT;
        j = NEXT_DICT (last_search_node);

        while (j != NIL_DICT_PTR)
        {
                last_search_node = j;
                j = NEXT_DICT (j);
        }

        return ch;
}


/*
        Extract next value from input stream
        Search frequency tables to convert to symbol
        Update arithmetic decoder using symbol frequencies
*/

static int decode_active_state (void)

{
        unsigned c1, c2, c3;
        unsigned sym;
        unsigned m;
        int i;
        int n;

        n = active_state.match_level;
        c2 = active_state.order_cum_freq [n];

        while (c2 > MAX_CUM_FREQ)
        {
                scale_freq_tbl (n, END_OF_FILE);
                c2 = active_state.order_cum_freq [n];
        }

        m = n > 0 ? switch_char_freq (active_state.order_sym_count [n], c2) : 0;
        c3 = c2 + m;

        sym = DecodeArith (c3);
        if (sym < c2)
        {
                c1 = 0;
                for (i = 0; i < MAX_SYM; i ++)
                {
                        if (level [i] == n)
                        {
                                m = freq [i];
                                c1 += m;
                                if (sym < c1) break;
                        }
                }

                c1 -= m;
        }
        else
        {
                c1 = c2;
                i = SWITCH_SYM;
        }

        UpdateDecoder (c1, m, c3);

        return i;
}



/*
        Generate coded output for a constant value within a fixed range
        Value is treated as a symbol with frequency one
*/

static void generate_value (unsigned value, unsigned range)

{
        EncodeArith (value, 1, range);
}


/*
        Extract constant value within fixed range
        Each possible value is treated as symbol with frequency one
*/

static unsigned decode_value (unsigned range)

{       unsigned value;

        value = DecodeArith (range);
        UpdateDecoder (value, 1, range);

        return value;
}



/*
        Determine integer value of base 2 logarithm of integer value
        Use smallest power of two less than input value
*/

static int log2 (unsigned n)

{
        int i;

        for (i = 0; n > 1; i ++, n >>= 1);
        return i;
}



/*
        Scale binary value as part of log calulation
        Input is a binary fraction (32 bits, 16 binary places)
        Extract integer log to base 2
        Return fractional part and accumulate integer part
*/

static void scale_binary_value (long x, int *nbits, unsigned *frac)

{
        int i;

        i = log2 ((unsigned) (x >> 16));
        *nbits += i;
        *frac = (unsigned) (x >> i);
}


/*
        Estimate bit size of arithmetic coded values

        Input consists of symbol frequency (p) and cumulative frequency (q)
        Actual bit size is log to base 2 of (q / p)
        
        Maintain intermediate values as:
        
                n + log2 (1 + f)

        where n is integer and f is the remainder (between 0 and 1.0)
        stored as a 16 bit binary fraction.

        The pair (nbits, frac) contains the starting value for the bit length
        This is updated to include the latest symbol size
*/

static void update_bit_len (unsigned p, unsigned q, int *nbits, unsigned *frac)

{
        long x;
        unsigned f2;

        x = ((long) q << 16) / p;
        scale_binary_value (x, nbits, &f2);

        x = (long) f2 * (long) *frac;
        x >>= 16;
        x += f2;
        x += *frac;
        x += 0x10000L;
        scale_binary_value (x, nbits, frac);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美狂野另类xxxxoooo| 国产精品久久久99| 国产欧美一区二区三区鸳鸯浴 | 国产精品一级黄| 91丝袜高跟美女视频| 日韩美女视频一区二区在线观看| 国产欧美精品一区二区色综合 | 91麻豆国产自产在线观看| 日韩视频免费直播| 一区二区三区在线看| 国产毛片精品视频| 日韩精品一区二区三区在线播放| 亚洲精品久久嫩草网站秘色| 国产曰批免费观看久久久| 欧美日本一区二区| 亚洲欧美日韩在线| 国产91精品入口| 精品欧美一区二区久久| 日韩精品乱码av一区二区| 91久久免费观看| 欧美国产综合色视频| 国产精品羞羞答答xxdd| 亚洲精品在线网站| 蜜臀av一区二区三区| 7799精品视频| 亚洲国产精品一区二区久久| 91浏览器打开| 亚洲美女在线一区| 91黄色激情网站| 亚洲毛片av在线| 在线观看日韩电影| 亚洲一区二区三区中文字幕在线 | 国产欧美日韩麻豆91| 久久精品二区亚洲w码| 91精品国产91久久久久久最新毛片| 一区二区三区免费| 在线观看视频一区二区| 亚洲第一主播视频| 欧美麻豆精品久久久久久| 五月天一区二区| 日韩欧美成人激情| 国产福利91精品一区二区三区| www国产精品av| 成人黄色片在线观看| 国产精品婷婷午夜在线观看| a4yy欧美一区二区三区| 亚洲精品午夜久久久| 欧美色偷偷大香| 奇米在线7777在线精品 | 日韩精品五月天| 日韩一区二区三区电影在线观看| 麻豆精品视频在线观看视频| 欧美大白屁股肥臀xxxxxx| 国产在线不卡视频| 最近日韩中文字幕| 欧美日韩精品专区| 国产综合成人久久大片91| 国产精品乱码一区二区三区软件| 91看片淫黄大片一级在线观看| 一区二区三区国产精品| 欧美一区二区三区免费观看视频| 紧缚捆绑精品一区二区| 国产精品二三区| 欧美丰满嫩嫩电影| 国产麻豆91精品| 樱花草国产18久久久久| 日韩西西人体444www| 国产成人免费在线| 亚洲高清视频的网址| 久久久亚洲国产美女国产盗摄| 色丁香久综合在线久综合在线观看| 日韩二区在线观看| 亚洲欧洲制服丝袜| 26uuu久久天堂性欧美| 一本大道av伊人久久综合| 免费一级片91| 亚洲一区二区综合| 欧美激情综合在线| 日韩欧美一级二级| 欧美优质美女网站| 国产成+人+日韩+欧美+亚洲| 午夜精品福利一区二区三区av | 欧美三级日韩在线| 国产98色在线|日韩| 日日骚欧美日韩| 1区2区3区欧美| 久久一区二区三区国产精品| 欧美在线免费观看视频| 成人性生交大片| 久久99国产精品麻豆| 亚洲高清免费一级二级三级| 国产精品灌醉下药二区| 亚洲精品在线免费观看视频| 欧美日韩中字一区| 91浏览器打开| av欧美精品.com| 国内精品不卡在线| 美国毛片一区二区三区| 亚洲一区二区三区四区的| 国产精品免费看片| 久久久久久久一区| 日韩一级大片在线| 欧美麻豆精品久久久久久| 色拍拍在线精品视频8848| 成人午夜激情在线| 国产高清视频一区| 国产原创一区二区| 国产一区二区三区精品视频| 久久精品国产99国产精品| 免费看欧美美女黄的网站| 日韩激情视频网站| 日韩国产欧美在线观看| 午夜精品福利视频网站| 亚洲国产成人av好男人在线观看| 亚洲视频电影在线| 亚洲欧美日本在线| 一区二区三区日韩在线观看| 亚洲私人黄色宅男| 亚洲精品久久嫩草网站秘色| 亚洲伦理在线免费看| 亚洲男人都懂的| 亚洲一区二区三区四区的| 亚洲一线二线三线视频| 午夜成人免费电影| 日韩精品欧美成人高清一区二区| 日本vs亚洲vs韩国一区三区二区| 午夜精品久久久久影视| 麻豆极品一区二区三区| 久久精品国产亚洲5555| 国产乱码精品1区2区3区| 国产精华液一区二区三区| 99久久伊人网影院| 91成人网在线| 69av一区二区三区| 精品国精品自拍自在线| 中文字幕乱码一区二区免费| 中文字幕日韩av资源站| 一区二区国产盗摄色噜噜| 日韩不卡手机在线v区| 狠狠色狠狠色合久久伊人| 岛国精品在线观看| 一本大道久久a久久综合婷婷| 欧美性生活一区| 欧美r级在线观看| 中文字幕一区二区三区不卡在线| 亚洲蜜臀av乱码久久精品 | 韩国欧美国产一区| av爱爱亚洲一区| 欧美一区二区精品| 国产午夜精品福利| 亚洲制服丝袜av| 国产一区二区三区四区在线观看| 99久久国产综合精品女不卡 | 不卡的电影网站| 欧美日高清视频| 欧美国产欧美亚州国产日韩mv天天看完整 | 精品成人一区二区三区| 中文字幕在线不卡一区| 日日噜噜夜夜狠狠视频欧美人| 国产一区二区调教| 在线精品亚洲一区二区不卡| 久久美女高清视频| 亚洲va韩国va欧美va精品| 国产成人亚洲综合a∨婷婷图片| 在线观看91视频| 国产清纯在线一区二区www| 亚洲综合男人的天堂| 国产成人高清视频| 欧美久久久久久久久久| 国产精品不卡在线| 国产一区二区成人久久免费影院| 在线亚洲精品福利网址导航| 国产亚洲欧美日韩日本| 日韩成人一级片| 亚洲丶国产丶欧美一区二区三区| 欧日韩精品视频| 免费观看一级特黄欧美大片| 国产精品毛片久久久久久久| 午夜激情一区二区三区| 97久久超碰国产精品| 精品欧美一区二区久久 | 精品一区二区三区免费| 欧美在线观看视频一区二区| 国产精品视频第一区| 麻豆91在线观看| 在线播放中文一区| 亚洲一区二区三区视频在线播放 | 色噜噜夜夜夜综合网| 国产欧美日韩在线| 国产精品中文欧美| 2023国产精华国产精品| 老司机精品视频在线| 日韩三级电影网址| 免费的国产精品| 日韩视频免费观看高清完整版在线观看 | 91福利资源站| 一级日本不卡的影视| 欧美在线你懂得| 亚洲午夜在线观看视频在线| 91久久奴性调教|