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

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

?? ihisto.c

?? LastWave
?? C
字號:
/*..........................................................................*//*                                                                          *//*      L a s t W a v e    P a c k a g e 'compress2d' 2.1                   *//*                                                                          *//*      Copyright (C) 1998-2002 Geoff Davis, Emmanuel Bacry, Jerome Fraleu. *//*                                                                          *//*      The original program was written in C++ by Geoff Davis.             *//*      Then it has been translated in C and adapted to LastWave by         *//*      J. Fraleu and E. Bacry.                                             *//*                                                                          *//*      If you are interested in the C++ code please go to                  *//*          http://www.cs.dartmouth.edu/~gdavis                             *//*                                                                          *//*      emails : geoffd@microsoft.com                                       *//*               fraleu@cmap.polytechnique.fr                               *//*               lastwave@cmap.polytechnique.fr                             *//*                                                                          *//*..........................................................................*//*                                                                          *//*      This program is a free software, you can redistribute it and/or     *//*      modify it under the terms of the GNU General Public License as      *//*      published by the Free Software Foundation; either version 2 of the  *//*      License, or (at your option) any later version                      *//*                                                                          *//*      This program is distributed in the hope that it will be useful,     *//*      but WITHOUT ANY WARRANTY; without even the implied warranty of      *//*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *//*      GNU General Public License for more details.                        *//*                                                                          *//*      You should have received a copy of the GNU General Public License   *//*      along with this program (in a file named COPYRIGHT);                *//*      if not, write to the Free Software Foundation, Inc.,                *//*      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA             *//*                                                                          *//*..........................................................................*/#include "lastwave.h"#include "ihisto.h"/* * IHISTOGRAM  */IHISTOGRAM NewIHistogram(int n, int maxct){  IHISTOGRAM ih;  int i;    ih = (IHISTOGRAM) Malloc(sizeof(IHistogram));  ih->onelog2 = 1/log(2.0);  ih->nsyms = n;  ih->maxCt = maxct;  ih->totalCount = 0;  ih->count = IntAlloc(ih->nsyms);  ih->treeCount = IntAlloc(ih->nsyms);  ih->symToPos = IntAlloc(ih->nsyms);  ih->posToSym = IntAlloc(ih->nsyms);  for (i = 0; i < ih->nsyms; i++) {	ih->count[i] = 0;	ih->treeCount[i] = 0;	ih->symToPos[i] = i;	ih->posToSym[i] = i;  }        return(ih);}void DeleteIHistogram(IHISTOGRAM ih){  Free(ih->count);  Free(ih->treeCount);  Free(ih->symToPos);  Free(ih->posToSym);  Free(ih);}static int Parent(int child) { return (child - 1) >> 1; }static int Lchild(int parent) { return parent + parent + 1; }static int Rchild(int parent) { return parent + parent + 2; }int TotalCountIHistogram(IHISTOGRAM ih){  return(ih->totalCount);}int LeftCountIHistogram(IHISTOGRAM ih, int sym){    int lc = 0;    int pos = ih->symToPos[sym];    int parent;        lc = ih->treeCount[pos];    while (pos) {	  parent = Parent(pos);	  if (Rchild(parent) == pos) lc += ih->treeCount[parent] + ih->count[parent];	  pos = parent;    }    return (lc);}int CountIHistogram(IHISTOGRAM ih, int sym) {  return ih->count[ih->symToPos[sym]];}static void BuildTreeCountIHistogram(IHISTOGRAM ih){    int i;    int pos;    int parent;        for (i = 0; i < ih->nsyms; i++) { ih->treeCount[i] = 0; }    for (i = ih->nsyms - 1; i > 0; i--) {	pos = i;	while (pos > 0) {	    parent = Parent(pos);	    if (pos == Lchild(parent)) {		ih->treeCount[parent] += ih->count[i];	    }	    pos = parent;	}    }}static void ScaleCountsIHistogram(IHISTOGRAM ih){ int i;     ih->totalCount = 0;    for (i = 0; i < ih->nsyms; i++) {	if (ih->count[i] == 0) {	    ;			/* skip this one */	} else {	    ih->count[i] = ih->count[i] / 2;	    if (!ih->count[i]) {		ih->count[i] = 1;	    }	    ih->totalCount += ih->count[i];	}    }}static void ReorganiseIHistogram(IHISTOGRAM ih,int sym){    int pos = ih->symToPos[sym];  int right, left,middle;  int rsym;      if (!pos || ih->count[pos - 1] > ih->count[pos]) {	return;    }    /* find leftmost count == count[pos], then swap values */    right = pos;    left  = 0;    /* make sure it isn't under left at start. We'll never put it      there later. */    if (ih->count[left] == ih->count[pos]) { right = left; }    while (left != right) {	middle = (left + right) / 2;	if (ih->count[middle] > ih->count[pos]) {	    /*middle is to left of leftmost count == count[pos] */	    left = middle + 1;	} else {	    /*leftmost count == count[pos] is either under middle, or to left	    of middle. */	    right = middle;	}    }    rsym = ih->posToSym[right];    ih->symToPos[sym] = right;    ih->posToSym[pos] = ih->posToSym[right];    ih->symToPos[rsym] = pos;    ih->posToSym[right] = sym;}static void SwapSyms(IHISTOGRAM ih,int pos_a, int pos_b){    int sym_a = ih->posToSym[pos_a];    int sym_b = ih->posToSym[pos_b];    int t;        ih->symToPos[sym_a] = pos_b;    ih->symToPos[sym_b] = pos_a;        ih->posToSym[pos_a] = sym_b;    ih->posToSym[pos_b] = sym_a;        t = ih->count[pos_a];    ih->count[pos_a] = ih->count[pos_b];    ih->count[pos_b] = t;}static int Sorted(IHISTOGRAM ih, int from, int to){  int i;      for (i = from; i < to - 1; i++) {	  if (ih->count[i] < ih->count[i + 1]) return 0;    }    return 1;}static void Qs(IHISTOGRAM ih, int from, int to){    int pivot = from;    int ub = to;           if (Sorted(ih,from, to)) return;    SwapSyms(ih,pivot, (from + to) / 2); /* pivot on middle */        while (pivot + 1 < ub) {	if (ih->count[pivot + 1] < ih->count[pivot]) {	    ub--;	    SwapSyms(ih,pivot + 1, ub);	} else {	    SwapSyms(ih,pivot, pivot + 1);		    pivot++;	}    }    Qs(ih,from, pivot);    Qs(ih,pivot + 1, to);    }static void QSortSyms(IHISTOGRAM ih){    Qs(ih,0, ih->nsyms);}void InitCounts1IHistogram(IHISTOGRAM ih, int *cnts){  int i;      ih->totalCount = 0;    for (i = 0; i < ih->nsyms; i++) {	ih->symToPos[i] = i;	ih->posToSym[i] = i;	ih->totalCount += cnts[i];	ih->count[i] = cnts[i];    }    while (ih->totalCount >= ih->maxCt) { ScaleCountsIHistogram(ih); }    QSortSyms(ih);    BuildTreeCountIHistogram(ih);}void InitCounts2IHistogram(IHISTOGRAM ih, IHistBinFun *f, void *closure){  int i;      ih->totalCount = 0;    f(closure, ih->count);    for (i = 0; i < ih->nsyms; i++) {	 ih->symToPos[i] = i;	 ih->posToSym[i] = i;	 ih->totalCount +=  ih->count[i];    }    while ( ih->totalCount >=  ih->maxCt) { ScaleCountsIHistogram(ih); }    QSortSyms(ih);    BuildTreeCountIHistogram(ih);}void IncCountIHistogram(IHISTOGRAM ih, int sym){  int pos,parent;      ReorganiseIHistogram(ih,sym);    pos = ih->symToPos[sym];    ih->count[pos]++;    ih->totalCount++;    while(pos > 0) {	parent = Parent(pos);	if (pos == Lchild(parent)) {	    ih->treeCount[parent]++;	}	pos = parent;    }    if (ih->totalCount >= ih->maxCt) {	ScaleCountsIHistogram(ih); 	BuildTreeCountIHistogram(ih);    }}int SymbolIHistogram(IHISTOGRAM ih, int val){   int pos = 0;        int leftSum = 0;        while(1) {	if (leftSum + ih->treeCount[pos] > val) {	    /* look at left subtree */	    pos = Lchild(pos);	} else {	    if (val >= leftSum + ih->treeCount[pos] + ih->count[pos]) {		/* look at right subtree */		leftSum += ih->treeCount[pos] + ih->count[pos];		pos = Rchild(pos);	    } else {		return ih->posToSym[pos];	    }	}    }}LWFLOAT  EntropyIHistogram(IHISTOGRAM ih, int sym) {     return -log(CountIHistogram(ih,sym)/(LWFLOAT)ih->totalCount) * ih->onelog2;  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文一区在线播放| 日韩免费观看2025年上映的电影| 久久综合色播五月| 国内精品久久久久影院色| 久久先锋影音av| 国产成人精品三级麻豆| 国产精品视频看| 成人av网在线| 亚洲成人福利片| 欧美日韩国产区一| 精品一区二区三区免费| 久久你懂得1024| 99久久婷婷国产综合精品电影| 中文字幕在线不卡| 欧美亚洲高清一区| 日韩成人精品在线观看| 国产三级欧美三级日产三级99 | 一区二区三区四区在线播放| 91蜜桃免费观看视频| 午夜精品久久久久久久蜜桃app| 日韩欧美一二区| 97精品久久久午夜一区二区三区| 一区二区三区四区蜜桃| 日韩欧美国产一区二区在线播放 | 4438x亚洲最大成人网| 国产一区二区中文字幕| 亚洲黄色片在线观看| 91麻豆精品国产91久久久使用方法| 精品一区二区三区在线播放视频| 亚洲色图欧美偷拍| 日韩一区二区高清| 91亚洲精品乱码久久久久久蜜桃 | 美女诱惑一区二区| 国产精品色在线| 91麻豆精品国产91久久久使用方法| 国产精品99久久久久久有的能看| 亚洲精品精品亚洲| 26uuu国产电影一区二区| 在线观看av不卡| 丁香婷婷综合激情五月色| 亚洲r级在线视频| 国产精品网站在线观看| 日韩欧美成人一区| 欧美午夜不卡视频| 成人精品鲁一区一区二区| 三级亚洲高清视频| 亚洲免费伊人电影| 国产日韩精品视频一区| 欧美一二三区精品| 精品视频免费在线| 91在线视频网址| 国产精品1区2区3区在线观看| 首页国产丝袜综合| 亚洲精品欧美激情| 国产精品三级视频| 久久五月婷婷丁香社区| 欧美精品xxxxbbbb| 91国内精品野花午夜精品| 成人少妇影院yyyy| 国产精品原创巨作av| 久久精品国产99久久6| 亚洲国产综合色| 中文字幕制服丝袜一区二区三区| 久久综合一区二区| 欧美xxxxxxxxx| 91精品国产综合久久精品麻豆| 日本韩国精品在线| eeuss鲁一区二区三区| 高清不卡在线观看av| 国产成人亚洲综合色影视| 国产精品资源在线| 国产东北露脸精品视频| 国产成人精品三级| 成人在线视频一区| 床上的激情91.| 成人激情黄色小说| 不卡视频一二三四| 97aⅴ精品视频一二三区| 99re成人精品视频| 在线观看国产精品网站| 在线观看日韩精品| 欧美三级韩国三级日本一级| 欧美日精品一区视频| 7777女厕盗摄久久久| 51久久夜色精品国产麻豆| 日韩一区二区三区精品视频| 日韩欧美一区二区免费| 欧美成人艳星乳罩| 久久午夜免费电影| 国产精品女人毛片| 一区二区三区在线观看国产| 亚洲成人免费在线| 精品综合久久久久久8888| 国产一区二区三区视频在线播放| 国产精品一级黄| 99re66热这里只有精品3直播| 色婷婷激情综合| 欧美日韩高清在线| 26uuu精品一区二区在线观看| 国产欧美一区二区三区鸳鸯浴 | 亚洲午夜在线电影| 石原莉奈在线亚洲三区| 精品一区二区在线播放| 成人av集中营| 欧美日产国产精品| 日韩一级大片在线| 欧美韩日一区二区三区四区| 亚洲伦理在线免费看| 日韩av一区二| 成人免费视频一区| 欧美精品电影在线播放| 国产三级一区二区| 午夜私人影院久久久久| 韩国三级电影一区二区| 色婷婷久久久久swag精品 | 欧美xxxxx牲另类人与| 国产精品国产三级国产普通话99| 亚洲专区一二三| 国产精品综合久久| 欧美日韩精品欧美日韩精品| 国产日产精品一区| 五月天婷婷综合| 成人丝袜18视频在线观看| 欧美日韩aaaaaa| 国产精品国产a| 久久精品国产精品青草| 日本高清不卡视频| 久久久久高清精品| 日韩一区欧美二区| 99国产精品久久久久久久久久 | 丝瓜av网站精品一区二区| 粉嫩久久99精品久久久久久夜| 在线不卡欧美精品一区二区三区| 欧美精彩视频一区二区三区| 美女在线视频一区| 色悠悠久久综合| 日本一区二区三区视频视频| 日本欧美一区二区在线观看| 色狠狠一区二区三区香蕉| 国产午夜一区二区三区| 免费观看30秒视频久久| 色综合激情久久| 国产精品私人影院| 国产伦精品一区二区三区免费| 欧美日韩精品欧美日韩精品一| 日韩美女久久久| 成人黄色软件下载| 久久亚洲精华国产精华液 | 激情小说欧美图片| 欧美日本一道本| 一区二区三区欧美日韩| 成人高清免费在线播放| 久久久亚洲精品石原莉奈| 美女免费视频一区二区| 欧美高清视频不卡网| 亚洲亚洲精品在线观看| 色久综合一二码| 一级中文字幕一区二区| 91丨porny丨国产入口| 国产精品久久久久久久久久免费看| 狠狠色丁香婷婷综合久久片| 日韩一卡二卡三卡国产欧美| 日韩精品每日更新| 日韩一区二区视频在线观看| 日本视频在线一区| 51精品国自产在线| 裸体一区二区三区| 日韩一级二级三级精品视频| 日本女优在线视频一区二区| 欧美精品日韩一本| 免费在线观看不卡| 日韩女优视频免费观看| 国内精品视频一区二区三区八戒| 欧美成va人片在线观看| 国产一区 二区| 国产精品视频第一区| 一本色道**综合亚洲精品蜜桃冫| 一区二区三区在线观看动漫| 欧美三级在线视频| 久久精品99国产精品日本| 精品久久一区二区三区| 国产aⅴ综合色| 亚洲视频图片小说| 欧美日韩成人综合在线一区二区| 日韩精品一二三| 26uuu另类欧美亚洲曰本| 成人免费精品视频| 亚洲精品乱码久久久久久| 欧美日韩三级一区二区| 人人精品人人爱| 久久久久久毛片| 99视频精品在线| 亚洲午夜免费视频| 日韩美女一区二区三区四区| 国产成人综合网站| 一区二区三区国产精华| 日韩西西人体444www| 成人不卡免费av| 亚洲国产人成综合网站| 日韩欧美你懂的|