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

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

?? tsvq.c

?? Vector Quantization壓縮算法
?? C
字號:
/****************************************************************************** * * NAME *    tsvq.c *    Jill R. Goldschneider *    February 1992 *    Last Revision: *       10/94  fixed mult_offset user input to float. *       12/94, added a test to slope() in slop_util.c so that a node *        cannot be added to the tree unless it has a minimum number of *        nodes.  This tries to ensure that each codeword has at least *        DEF_min_vectors training vectors per codeword. * * SYNOPSIS *    tsvq -t training_sequence -c codebook -s statistics -d dimension *         -r stopping_rate -m mult_offset -h threshold -B * * DESCRIPTION *    This program should be used to design a tree-structured VQ. *    The input is a blocked training vector sequence. *    Two files are output.  One is a codebook file which has the format: *        TYPE       SIZE          DESCRIPTION *        long       1             number of nodes in the tree (numnodes) *        integer    1             vector dimension (dim) *        short      numnodes      tree description array *        DISTTYPE   numnodes*dim  codewords *    where the tree description array is a preorder list where a 0 *    indicates that a node is terminal and a 1 indicates that a node *    is not terminal.  The second output file is also a preorder list *    with two values per tree node where 1 long is used for the count *    and 1 DISTTYPE is used for the distortion. * *    This program should produce any tree from (rate 0, highest distortion) *    to (highest rate, 0 distortion), where the rate is the average number of *    bits per vector and the distortion the the average mean squared error per *    vector.  To do this, the lloyd subroutine will try two different methods *    to split a cell.  The first attempted split is to use the centroid and a *    slightly perturbed version of the centroid.  Should this fail, then a *    second attempt to split is made by using the centroid and the vector *    that is the furthest distance from the centroid. To create different *    trees, try playing with the mult_offset parameter.  I do not recommend *    playing with the threshold parameter (defaulted to zero, but it can *    take values up to 1) since a non-zero threshold violates the local *    optimality condition that is assumed by the tree growing algorithm. *    This can lead to empty cells on the tree and wasted bits. See *    tsvq_util.c under lloyd for more details about the possible side *    effects.  This code does not try to correct any of the side effects *    caused by using a non-zero threshold, but it does detect empty cells *    and prints a warning to the user.  In addition, tsvq prints the following *    information to stdout:  rate and distortion as the tree grows, the number *    of nodes in the tree, and the empirical entropy of the codewords. * * OPTIONS *    -t  blocked training sequence file name      DEF_trsqname *    -c  codebook file name                       DEF_codebookname *    -s  statistics file name                     DEF_statname *    -d  vector dimension                         DEF_dim *    -r  desired stopping rate                    DEF_rate *    -m  multipicative offset for splitting nodes DEF_mult_offset *    -h  threshold for Lloyd algorithm            DEF_thresh *    -B  produce a balanced tree * * CALLS *    create_root() initialize_tree() initialize_slopelist() lloyd() *    update_rate() delete_slopelist() tree_clean() empirical_entropy *    write_codebook() write_stat() conditional_insert() forced_insert() *    find_maxslope() find_oldest_entry() * *****************************************************************************/#include "tsvq.h"char      *programname;int       dim;DISTTYPE  mult_offset;DISTTYPE  thresh;main(argc, argv)     int argc;     char *argv[];{  TreeNode  *root;               /* root of codebook tree */  SlopeList *(*get_next_node)(); /* pointer to maxnode() and top_of_list() */  SlopeList *nextslope;          /* the pointer to the node to be replaced */  FILE      *trsqfile;           /* blocked training sequence file */  FILE      *codebookfile;       /* file to contain codebook */  FILE      *statfile;           /* file to contain counts and distortions */  char      trsqname[NAME_MAX];  /* name of training sequence file */  char      codebookname[NAME_MAX]; /* name of codebook file */  char      statname[NAME_MAX];  /* name of stat file */  char      option;              /* used for command lint interpretation */  char      *cp;                 /* used for command lint interpretation */  DISTTYPE  distortion;          /* distortion of codebook and training set */  DISTTYPE  rate,stoppingrate;   /* current rate, and rate to stop algorithm */  DISTTYPE  tempdist;            /* temporary variable */  double    entropy;              /* the empirical entropy of the codebook */  float     userrate;            /* rate needs to be read as float */  float     userthresh;          /* a number from 0 to 1 */  float     useroffset;  long      bits;                /* number bits used to encode training set */  long      trsqcount;           /* number of training vectors */  long      numnodes;            /* number of nodes in the tree */  BOOLEAN  (*insert_slope)();    /* forced_insert() and conditional_insert() */  BOOLEAN   balanceflag;         /* if true, the tree is balanced */  /* assign defaults */  strcpy(trsqname, DEF_trsqname);  strcpy(codebookname, DEF_codebookname);  strcpy(statname, DEF_statname);  programname = *argv;  dim = DEF_dim;  mult_offset = DEF_mult_offset;  userthresh = DEF_thresh;  thresh = (DISTTYPE) userthresh;  userrate = DEF_rate;  stoppingrate = (DISTTYPE) userrate;  balanceflag = FALSE;  /* if no options entered, list all of the defaults */  if (argc == 1) {    printf("%s %s %s\n",USAGE,programname,HOWTOUSE_TSVQ);    printf("\nOPTIONS   DESCRIPTIONS                         DEFAULTS\n");    printf("-t        blocked training sequence            %s\n",trsqname);    printf("-c        codebook                             %s\n",codebookname);    printf("-s        codebook statistics                  %s\n",statname);    printf("-d        vector dimension                     %d\n",dim);    printf("-r        stopping rate (bits per vector)      %g\n",userrate);    printf("-m        multiplicative offset                %g\n",mult_offset);    printf("-h        convergence threshold                %g\n",userthresh);    printf("-B        produce a balanced tree\n");    printf("\n");    fflush(stdout);    exit(0);  }  /* read and interpret command line arguments */  while (--argc && ++argv) {    if (*argv[0]=='-' && strlen(*argv)==2) { /* each option has 1 letter */      option = *++argv[0];      if (option == 'B') {balanceflag = TRUE;} /* examine the flag */      else if (--argc && ++argv) { /* examine the option */        switch(option) { /* examine the option letter */        case 't':          strncpy(trsqname,*argv,NAME_MAX - 10);          break;        case 'c':          strncpy(codebookname,*argv,NAME_MAX);          break;        case 's':          strncpy(statname,*argv,NAME_MAX);          break;        case 'd':	  sscanf(*argv, "%d", &dim);          break;        case 'r':	  sscanf(*argv, "%f", &userrate);	  stoppingrate = ((DISTTYPE) userrate);          break;        case 'm':	  sscanf(*argv, "%f", &useroffset);	  mult_offset = (DISTTYPE) useroffset;          break;        case 'h':	  sscanf(*argv, "%f", &userthresh);	  thresh = ((DISTTYPE) userthresh);          break;        default:          fprintf(stderr,"%s: %c: %s\n",programname,option,NOTOPTION);          exit(1);          break;        }      }      else {        fprintf(stderr,"%s %s %s\n",USAGE,programname,HOWTOUSE_TSVQ);        exit(2);      }    }    else if (*argv[0] == '-') { /* user entered unknown option */      ++argv[0];      fprintf(stderr,"%s: %s: %s\n",programname,*argv,NOTOPTION);      exit(3);    }    else { /* user entered unknown string */      fprintf(stderr,"%s: %s: %s\n",programname,*argv,NOTOPTION);      exit(4);    }  }  /* user entered invalid arguments */  if (dim <= 0 || userrate < 0 || mult_offset <= 0 || thresh < 0 || thresh>1){    fprintf(stderr,"%s %s %s\n",USAGE,programname,HOWTOUSE_TSVQ);    exit(5);  }  /* user did not enter an file names */  if (strlen(trsqname) == 0) {    fprintf(stderr,"%s %s %s\n",USAGE,programname,HOWTOUSE_TSVQ);    exit(6);  }  if (strlen(codebookname) == 0) {    sprintf(codebookname,"%s%s",trsqname,DEF_APPEND_CDBK);  }  if (strlen(statname) == 0) {    sprintf(statname,"%s%s",trsqname,DEF_APPEND_STAT);  }  /* user entered an input name which is the same as an output name */  if (strncmp(cp = codebookname,trsqname,NAME_MAX) == 0 ||      strncmp(cp = statname,trsqname,NAME_MAX) == 0) {    fprintf(stderr,"%s: %s %s %s %s: %s\n",            programname,cp,AND,trsqname,ARESAME,ABORT_TSVQ);    exit(7);  }  if (strncmp(statname,codebookname,NAME_MAX) == 0) {    fprintf(stderr,"%s: %s %s %s %s: %s\n",            programname,statname,AND,trsqname,ARESAME,ABORT_TSVQ);    exit(8);  }  /* open files */  if(!(trsqfile = fopen(cp = trsqname,"r")) ||     !(codebookfile = fopen(cp = codebookname,"w")) ||     !(statfile = fopen(cp = statname,"w"))) {    fprintf(stderr,"%s: %s: %s\n",programname,cp,NOTFOUND);    exit(9);  }  printf("\nOPTIONS   DESCRIPTIONS                         SETTINGS\n");  printf("-t        blocked training sequence            %s\n",trsqname);  printf("-c        codebook                             %s\n",codebookname);  printf("-s        codebook statistics                  %s\n",statname);  printf("-d        vector dimension                     %d\n",dim);  printf("-r        stopping rate (bits per vector)      %g\n",stoppingrate);  printf("-m        multiplicative offset                %g\n",mult_offset);  printf("-h        convergence threshold                %g\n",thresh);  if(balanceflag) {    printf("-B        produce a balanced tree\n");  }  /* assign the appropriate slope node search function*/  if(balanceflag) {    get_next_node = find_oldest_entry;    insert_slope = forced_insert;  }  else {    get_next_node = find_maxslope;    insert_slope = conditional_insert;  }  /* create and initialize the root of the main tree, it there is no data,     then initialize_tree will return FALSE */  if(!(root = create_root())) exit(10);  if(!(initialize_tree(root,trsqfile,trsqname))) exit(11);  fclose(trsqfile);  trsqcount = root->count;  distortion = root->avmse * (DISTTYPE) trsqcount;  bits = 0;  rate = ((DISTTYPE) bits) / ((DISTTYPE) trsqcount);  tempdist = distortion / ((DISTTYPE) trsqcount);  printf("          number of training vectors           %d\n",root->count);  printf("\n");  printf("           RATE          DISTORTION\n");  printf("%15f     %15f\n", rate, tempdist);  fflush(stdout);  /* initialize the slopelist, split the root node and do the GLA     on the root's children, insert the root into the slopelist */  if(!(initialize_slopelist())) { exit(12); }  if(!(lloyd(root))) { exit(13); }  if(!(insert_slope(root))) { exit(14); }  /* until the stopping rate is achieved, grow the tree by adding to the     tree the children of the node with the largest slope. then split     those children and add the children to the slopelist */  while (rate < stoppingrate) {    /* find the node with the largest slope */    if(!(nextslope = get_next_node())) {      exit(15);    }    /* if the largest slope is 0 the tree cannot be grown anymore */    if (nextslope->slope <= 0.0) {      printf("%s: %s\n",programname,HALT_TSVQ);      fflush(stdout);      break;    }    /* include nextslope node's children in the codebook tree */    nextslope->node->left_child->designed = TRUE;    nextslope->node->right_child->designed = TRUE;    /* print the rate and distortion information */    update_rate(nextslope,&bits,&distortion);    rate = ((DISTTYPE) bits) / ((DISTTYPE) trsqcount);    tempdist = distortion / ((DISTTYPE) trsqcount);    printf("%15f     %15f\n", rate, tempdist);    fflush(stdout);    /* split the nextslope's children if possible and add to the list       to be considered for splitting if the slope is large enough */    if(!(lloyd(nextslope->node->left_child))) { exit(16); }    if(!(insert_slope(nextslope->node->left_child))) { exit(17); }    if(!(lloyd(nextslope->node->right_child))) { exit(18); }    if(!(insert_slope(nextslope->node->right_child))) { exit(19); }    /* remove the nextslope from further consideration */    delete_slopelist(nextslope);  }  /* find the number of nodes and print data to output files */  if((numnodes = tree_clean(root)) == 0) exit(20);  if((entropy = empirical_entropy(root,numnodes)) < 0) exit(21);  printf("\nThe number of nodes is %ld\n",numnodes);  printf("The empirical entropy is %lf bits per vector\n\n",entropy);  if(!(write_codebook(root,numnodes,codebookfile,codebookname))) {    exit(22);  }  if(!(write_stat(root,numnodes,statfile,statname))) {    exit(23);  }  exit(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产99国产精品| 亚洲激情综合网| 中文字幕一区av| 日韩电影在线一区二区三区| 国产成人自拍高清视频在线免费播放| 99re成人精品视频| 欧美大片国产精品| 一区二区三区精品| av午夜一区麻豆| 精品国产乱码久久久久久久| 一区二区成人在线观看| 丰满白嫩尤物一区二区| 日韩免费观看高清完整版| 亚洲一二三级电影| 91蝌蚪porny| 中文字幕巨乱亚洲| 国产夫妻精品视频| 久久综合色一综合色88| 日韩精品一区第一页| 欧美三级欧美一级| 亚洲一区二区在线免费看| 一本一本大道香蕉久在线精品| 久久久久久久综合| 国产一区二区导航在线播放| 日韩午夜中文字幕| 日本成人中文字幕在线视频 | 欧美a级理论片| 欧美日韩一区小说| 亚洲成精国产精品女| 91黄色激情网站| 亚洲精品美国一| 在线观看av一区| 污片在线观看一区二区| 欧美日韩一卡二卡| 午夜精品福利视频网站| 884aa四虎影成人精品一区| 日韩精品欧美精品| 欧美一区二区三区视频免费| 美日韩一级片在线观看| 久久综合给合久久狠狠狠97色69| 精久久久久久久久久久| 精品av综合导航| 国产99久久久国产精品| 国产精品成人免费在线| 91免费小视频| 天天射综合影视| 日韩久久久久久| 国产一区999| 1区2区3区精品视频| 欧洲色大大久久| 三级亚洲高清视频| 欧美第一区第二区| 成人美女在线观看| 亚洲一区在线视频观看| 这里只有精品免费| 国产精品18久久久| 亚洲曰韩产成在线| 精品免费视频一区二区| 成人在线综合网| 亚洲va欧美va人人爽| 欧美精品一区二区三| 成年人网站91| 青青草视频一区| 欧美国产精品中文字幕| 欧美日韩精品欧美日韩精品一综合| 日韩电影在线观看一区| 欧美国产日韩精品免费观看| 欧美日韩国产综合久久| 狠狠色狠狠色综合| 亚洲国产成人91porn| 精品久久久久av影院 | 亚洲毛片av在线| 欧美精品三级在线观看| 国产91富婆露脸刺激对白 | 国产精品久久久久久久久免费丝袜 | 免费高清在线视频一区·| 中国色在线观看另类| 欧美乱妇一区二区三区不卡视频 | 日本伊人精品一区二区三区观看方式| 精品国产网站在线观看| 在线一区二区三区四区| 国产高清亚洲一区| 日韩电影在线一区二区三区| 国产精品成人在线观看| 精品欧美久久久| 欧美色电影在线| 91在线观看一区二区| 国产呦精品一区二区三区网站| 亚洲精品成人天堂一二三| 久久久久久久久久久久久夜| 欧美老肥妇做.爰bbww| 色婷婷综合久久| 国产成人精品综合在线观看 | 亚洲bt欧美bt精品| 一区在线观看视频| 国产欧美视频在线观看| 91精品国产欧美一区二区18| 在线中文字幕不卡| 色综合色狠狠综合色| 国产二区国产一区在线观看| 青青草视频一区| 日本麻豆一区二区三区视频| 五月婷婷欧美视频| 亚洲二区在线观看| 亚洲观看高清完整版在线观看| 亚洲欧美在线观看| 国产精品久久久久久亚洲毛片| 国产日韩三级在线| 国产欧美精品在线观看| 精品播放一区二区| 久久久欧美精品sm网站| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 久久精品男人的天堂| 日韩女优电影在线观看| 日韩一区二区三区三四区视频在线观看| 在线这里只有精品| 欧美另类一区二区三区| 欧洲国产伦久久久久久久| 色视频成人在线观看免| 在线看一区二区| 欧美三级中文字| 91精品国产高清一区二区三区 | 欧美无砖专区一中文字| 欧美性猛片aaaaaaa做受| 色狠狠桃花综合| 欧美视频精品在线| 51午夜精品国产| 337p日本欧洲亚洲大胆色噜噜| 亚洲精品在线三区| 国产日韩成人精品| 亚洲最大成人网4388xx| 五月天欧美精品| 国产乱码一区二区三区| 99视频超级精品| 欧美视频一区二区| 精品久久五月天| 国产欧美视频一区二区三区| 亚洲欧美日韩国产手机在线| 午夜精品免费在线观看| 久久国产精品一区二区| 粉嫩av一区二区三区粉嫩| 色哟哟一区二区三区| 91精品久久久久久久91蜜桃| 国产视频一区二区三区在线观看| 日韩毛片视频在线看| 五月婷婷色综合| 成人激情文学综合网| 欧美日本韩国一区| 久久精品一区二区三区不卡牛牛| 自拍偷拍亚洲激情| 免费成人美女在线观看.| 成人性生交大片免费看中文网站| 日本高清不卡在线观看| 日韩欧美成人一区| 亚洲在线视频网站| 国产91色综合久久免费分享| 欧美日韩一区国产| 欧美高清在线精品一区| 午夜精品福利在线| 99综合电影在线视频| 日韩精品一区二区三区中文不卡 | 午夜国产精品影院在线观看| 国产精品羞羞答答xxdd| 欧美三区在线观看| 国产精品久久久久久一区二区三区| 午夜久久久久久电影| 99久久精品免费看国产| 久久伊人中文字幕| 天天免费综合色| 一本大道久久a久久精二百| 久久综合视频网| 日韩av网站在线观看| 色一情一伦一子一伦一区| 国产亚洲美州欧州综合国| 日本亚洲最大的色成网站www| av电影在线不卡| 久久久久久久久伊人| 美女视频免费一区| 欧美老肥妇做.爰bbww| 亚洲精品视频免费观看| 丰满亚洲少妇av| 久久综合丝袜日本网| 久久精品99国产精品| 91精品欧美一区二区三区综合在| 亚洲欧美另类小说视频| 成人深夜在线观看| 国产欧美在线观看一区| 激情五月播播久久久精品| 欧美一卡二卡在线观看| 性感美女久久精品| 91视频xxxx| 亚洲欧美日韩国产另类专区| aaa亚洲精品| 亚洲天堂久久久久久久| 99视频在线精品| **性色生活片久久毛片| 99在线精品一区二区三区| 亚洲男帅同性gay1069| 色乱码一区二区三区88| 亚洲色图一区二区三区|