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

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

?? write_util.c

?? Vector Quantization壓縮算法
?? C
字號:
/****************************************************************************** * NAME *    write_util.c *    J. R. Goldschneider *    February 1994 *    Last Revision * * SYNOPSIS *    BOOLEAN  write_codebook(root,numnodes,codebookfile,codebookname) *    BOOLEAN  write_stat(root,numnodes,statfile,statname) *    BOOLEAN  write_nested_subtree(root,numnodes,subtreefile,subtreename) * * DESCRIPTION *    write_codebook writes the codebook tree to the codebook file. The *    format is: *        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 *    The format of the tree description array is that a 1 is a node that is *    not a terminal node and a 0 is a terminal node. It is a preorder list. * *    write_stat writes the counts and distortions to the stat file. *    The order is a preorder listing as is the codebook.  The format is *    two values per node.  One long is used for the count, and one double *    is used for the distortion. * *    write_nested_subtree writes the subtree number to the subtree file. *    The order is a preorder listing as is the codebook.  The format is *    one values per node, the subtree number is a long int. * * RETURN VALUE *    write_codebook returns TRUE if there are no problems writing the *    codebook.  Otherwise an error message is printed and FALSE is returned. * *    write_stat returns TRUE if there are no problems, otherwise FALSE is *    returned and an error message is printed. * *    write_nested_subtree returns TRUE if there are no problems, *    otherwise FALSE is returned and an error message is printed. * * PARAMETERS *    root is the root of the codebook tree. *    numnodes is the total number of nodes in the tree. *    codebookfile is the file in which the codebook is written. *    codebookname is the name of the codebookfile. * *    root is the root of the codebook tree. *    numnodes is the total number of nodes in the tree. *    statfile is the file in which the information is written. *    statnmae is the name of the statfile. * *    root is the root of the codebook tree. *    numnodes is the total number of nodes in the tree. *    subtreefile is the file in which the information is written. *    subtreenmae is the name of the nested subtree. * * CALLS *    newnode() * *****************************************************************************/#include "tsvq.h"int  dim;char *programname;BOOLEAN write_codebook(root,numnodes,codebookfile,codebookname)     TreeNode *root;     long     numnodes;     FILE     *codebookfile;     char     *codebookname;{  long      i,n;           /* counters */  TreeNode *node;          /* node used to point to the tree */  short    *tree_descrip;  /* array containing tree structure (in bytes) */  /* allocate memory for tree description */  if(!(tree_descrip = (short *) calloc(numnodes,sizeof(short)))) {    fprintf(stderr,"%s: %s\n",programname,NOMEMORY);    return(FALSE);  }  /* create a node to search the tree */  if(!(node = newnode())) {    fprintf(stderr,"%s: %s\n",programname,NOMEMORY);    return(FALSE);  }  node = root;  /* create the tree description array */  n = 0; /* count the number of nodes */  for (i = 0; i < numnodes; i++) {    /* determine node position and from this find the next node to use */    if (node->left_child == NULL) { /* node is terminal */      if(node->right_child != NULL) {  /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTREE);        return(FALSE);      }      tree_descrip[n] = 0; /* enter a terminal node in tree description */      n++; /* increment count of nodes */      /* find next node to examine */      while ((node != root) && (node == node->parent->right_child)) {        node = node->parent; /* continue with the leaf node's parent */      }      if (node == root) break;      else {        node = node->parent->right_child;      }    }    else { /* node has a child, go to left child */      if(node->right_child == NULL) { /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTREE);        return(FALSE);      }      tree_descrip[n] = 1; /* enter a non-terminal node in tree description */      n++; /* increment count of nodes */      node = node->left_child;    }  }  /* when done constructing the tree, node should be the root */  if (node != root || n != numnodes) {    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTREE);    return(FALSE);  }  /* write numnodes, dim and tree_descrip */  if ((fwrite((char *) &numnodes,sizeof(long),1,codebookfile) != 1) ||      ferror(codebookfile) || feof(codebookfile)) {    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOWRITE);    return(FALSE);  }  if ((fwrite((char *) &dim,sizeof(int),1,codebookfile) != 1) ||      ferror(codebookfile) || feof(codebookfile)) {    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOWRITE);    return(FALSE);  }  if (fwrite((char *) tree_descrip,sizeof(short), (int) numnodes,codebookfile)      != numnodes || ferror(codebookfile) || feof(codebookfile)){    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOWRITE);    return(FALSE);  }  /* free allocated space */  free((char *) tree_descrip);  /* now write the codewords */  node = root;  n = 0; /* count the number of nodes */  for (i = 0; i < numnodes; i++) {    /* write the node's data */    if (fwrite((char *) node->data,sizeof(DISTTYPE),dim,codebookfile)!= dim ||	ferror(codebookfile) || feof(codebookfile)){      fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOWRITE);      return(FALSE);    }    /* determine node position and from this find the next node to use */    if (node->left_child == NULL) { /* node is terminal, find next node */      if(node->right_child != NULL) {  /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTREE);        return(FALSE);      }      n++; /* increment count of nodes */      /* find the next node */      while ((node != root) && (node == node->parent->right_child)) {        node = node->parent; /* continue with the leaf node's parent */      }      if (node == root) break;      else {        node = node->parent->right_child;      }    }    else { /* node has a child, go to left child */      if(node->right_child == NULL) { /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTREE);        return(FALSE);      }      n++; /* increment count of nodes */      node = node->left_child;    }  }  /* when done constructing the tree, node should be the root */  if (node != root || n != numnodes) {    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTREE);    return(FALSE);  }  fflush(codebookfile);  return(TRUE);}BOOLEAN write_stat(root,numnodes,statfile,statname)     TreeNode *root;     long     numnodes;     FILE     *statfile;     char     *statname;{  long      i,n;           /* counters */  TreeNode *node;          /* node used to point to the tree */  if(!(node = newnode())) {    fprintf(stderr,"%s: %s\n",programname,NOMEMORY);    return(FALSE);  }  node = root;  n = 0; /* count the number of nodes */  for (i = 0; i < numnodes; i++) {    /* write the node's count */    if (fwrite((char *) &(node->count),sizeof(long),1,statfile)!= 1 ||	ferror(statfile) || feof(statfile)){      fprintf(stderr,"%s: %s: %s\n",programname,statname,NOWRITE);      return(FALSE);    }    if (fwrite((char *) &(node->avmse),sizeof(double),1,statfile)!= 1 ||	ferror(statfile) || feof(statfile)){      fprintf(stderr,"%s: %s: %s\n",programname,statname,NOWRITE);      return(FALSE);    }    /* determine node position and from this find the next node to use */    if (node->left_child == NULL) { /* node is terminal, find next node */      if(node->right_child != NULL) {  /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,statname,NOTREE);        return(FALSE);      }      n++; /* increment count of nodes */      /* find the next node to use */      while ((node != root) && (node == node->parent->right_child)) {        node = node->parent; /* continue with the leaf node's parent */      }      if (node == root) break;      else {        node = node->parent->right_child;      }    }    else { /* node has a child, go to left child */      if(node->right_child == NULL) { /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,statname,NOTREE);        return(FALSE);      }      n++; /* increment count of nodes */      node = node->left_child;    }  }  /* when done constructing the tree, node should be the root */  if (node != root || n != numnodes) {    fprintf(stderr,"%s: %s: %s\n",programname,statname,NOTREE);    return(FALSE);  }  fflush(statfile);  return(TRUE);}BOOLEAN write_nested_subtree(root,numnodes,subtreefile,subtreename)     TreeNode *root;     long     numnodes;     FILE     *subtreefile;     char     *subtreename;{  long      i,n;           /* counters */  TreeNode *node;          /* node used to point to the tree */  if(!(node = newnode())) {    fprintf(stderr,"%s: %s\n",programname,NOMEMORY);    return(FALSE);  }  node = root;  n = 0; /* count the number of nodes */  for (i = 0; i < numnodes; i++) {    /* write the node's count */    if (fwrite((char *) &(node->count),sizeof(long),1,subtreefile)!= 1 ||	ferror(subtreefile) || feof(subtreefile)){      fprintf(stderr,"%s: %s: %s\n",programname,subtreename,NOWRITE);      return(FALSE);    }    /* determine node position and from this find the next node to use */    if (node->left_child == NULL) { /* node is terminal, find next node */      if(node->right_child != NULL) {  /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,subtreename,NOTREE);        return(FALSE);      }      n++; /* increment count of nodes */      /* find the next node to use */      while ((node != root) && (node == node->parent->right_child)) {        node = node->parent; /* continue with the leaf node's parent */      }      if (node == root) break;      else {        node = node->parent->right_child;      }    }    else { /* node has a child, go to left child */      if(node->right_child == NULL) { /* test tree fidelity */        fprintf(stderr,"%s: %s: %s\n",programname,subtreename,NOTREE);        return(FALSE);      }      n++; /* increment count of nodes */      node = node->left_child;    }  }  /* when done constructing the tree, node should be the root */  if (node != root || n != numnodes) {    fprintf(stderr,"%s: %s: %s\n",programname,subtreename,NOTREE);    return(FALSE);  }  fflush(subtreefile);  return(TRUE);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区三区三区| 成人av先锋影音| 亚洲欧美日韩国产综合| 91精品欧美福利在线观看| 成人av电影在线网| 麻豆一区二区三| 亚洲成人精品一区| 专区另类欧美日韩| 国产精品网站在线播放| 日韩一级大片在线观看| 欧美在线|欧美| 99久久精品国产网站| 国产成人一区在线| 久久99最新地址| 六月丁香综合在线视频| 天天操天天色综合| 青青草精品视频| 亚洲成人免费在线观看| 一级中文字幕一区二区| 亚洲影院在线观看| 亚洲一区电影777| 亚洲一级二级在线| 亚洲美女视频一区| 亚洲制服丝袜av| 日韩av一区二区在线影视| 亚洲最色的网站| 亚洲男人的天堂一区二区| 中文幕一区二区三区久久蜜桃| 亚洲一区在线看| 久久一夜天堂av一区二区三区 | 久久综合狠狠综合久久激情| 国产美女精品一区二区三区| 一区二区成人在线视频| 在线观看日韩电影| 精品国产成人在线影院| 久久超级碰视频| 国产免费成人在线视频| 成人一区二区在线观看| 一区二区在线免费观看| 99re热这里只有精品免费视频| 91国偷自产一区二区三区观看| 精品综合久久久久久8888| 亚洲成人综合网站| 午夜激情久久久| 黄色日韩网站视频| 99视频一区二区| 国产一区二区在线视频| 精品一区二区免费| 国产成人综合在线| 成人黄色小视频在线观看| 91美女片黄在线观看91美女| 91精品国产丝袜白色高跟鞋| 91免费观看视频在线| 色婷婷综合视频在线观看| 日本乱码高清不卡字幕| 久久亚洲欧美国产精品乐播 | 日韩一区精品字幕| youjizz久久| 日韩一区二区影院| 亚洲一区二区三区在线看| 99精品欧美一区二区三区综合在线| 在线视频国产一区| 一区在线观看视频| 国产成人精品免费| 26uuu色噜噜精品一区二区| 日本欧美加勒比视频| 色久综合一二码| 亚洲男人都懂的| 99精品欧美一区二区三区小说| 久久伊99综合婷婷久久伊| 国产成人在线电影| 26uuu国产电影一区二区| 极品美女销魂一区二区三区免费| 在线成人av网站| 婷婷中文字幕一区三区| 欧美偷拍一区二区| 亚洲美女屁股眼交3| 狠狠色丁香久久婷婷综合丁香| 在线精品国精品国产尤物884a| 日韩av网站在线观看| 亚洲国产高清在线观看视频| 欧美日韩电影在线播放| 丁香桃色午夜亚洲一区二区三区| 亚洲午夜视频在线观看| 国产网站一区二区三区| 7777精品伊人久久久大香线蕉的 | 欧美丝袜丝nylons| 婷婷夜色潮精品综合在线| 日韩精品中文字幕一区二区三区| 国产在线播放一区| 亚洲综合一二区| 精品国产一区二区精华| 91麻豆福利精品推荐| 亚洲一区二区黄色| 26uuu久久天堂性欧美| 色94色欧美sute亚洲13| 看电影不卡的网站| 亚洲人成在线播放网站岛国 | 国产精品久久久久久久久免费樱桃 | 国内不卡的二区三区中文字幕 | 一区二区三区高清| 久久久.com| 欧美mv日韩mv国产网站| 欧美三级电影在线观看| 成人免费毛片app| 老司机一区二区| 亚洲国产综合在线| 亚洲免费高清视频在线| 国产精品久久久久一区二区三区共 | 国产欧美日韩激情| 8x8x8国产精品| 欧美日韩精品二区第二页| 99久久精品一区| 成人黄色免费短视频| 国内外成人在线视频| 日本美女视频一区二区| 性做久久久久久免费观看欧美| 一区二区三区在线播放| 国产精品的网站| 国产精品美女一区二区在线观看| 精品国产乱码久久久久久久| 日韩欧美国产系列| 日韩欧美三级在线| 精品久久久久久综合日本欧美 | 日韩理论片中文av| 亚洲欧美在线视频观看| 亚洲欧洲国产日韩| 亚洲视频在线一区| 一区二区三区**美女毛片| 亚洲综合色自拍一区| 亚洲成人av一区二区三区| 日韩精品三区四区| 久草中文综合在线| 欧美一卡二卡三卡| 欧美一区二区播放| 欧美国产欧美综合| 亚洲欧美日韩人成在线播放| 午夜精品一区二区三区三上悠亚| 日韩在线一区二区| 国产一区二区三区国产| 99视频在线精品| 日韩一区二区三区在线视频| 久久久亚洲精华液精华液精华液| 亚洲欧美自拍偷拍| 蜜臀av性久久久久蜜臀aⅴ四虎 | 成人小视频在线观看| 欧美三级三级三级爽爽爽| 久久亚洲私人国产精品va媚药| 国产精品高潮久久久久无| 婷婷成人综合网| www.成人在线| 日韩午夜在线影院| 一二三区精品视频| 狠狠色丁香九九婷婷综合五月| 日本韩国欧美国产| 国产欧美日韩久久| 男人的天堂久久精品| 欧美亚洲国产一区在线观看网站| 精品福利在线导航| 视频一区在线播放| 日本高清不卡一区| 亚洲国产高清在线| 国产传媒日韩欧美成人| 精品国产髙清在线看国产毛片| 94色蜜桃网一区二区三区| 日韩欧美的一区| 亚洲成人av免费| 欧美日韩成人在线一区| 一级中文字幕一区二区| 色播五月激情综合网| 亚洲欧美色图小说| 91热门视频在线观看| 中文字幕亚洲综合久久菠萝蜜| 国产成人自拍网| 国产午夜三级一区二区三| 国产一区二区视频在线播放| 久久久亚洲精华液精华液精华液| 国产在线一区观看| 久久久777精品电影网影网| 国产精品夜夜爽| 中文字幕欧美区| 91国产精品成人| 亚洲一区二区三区四区不卡| 欧洲av一区二区嗯嗯嗯啊| 亚洲国产欧美一区二区三区丁香婷| 91久久奴性调教| 日韩精品91亚洲二区在线观看| 日韩午夜电影在线观看| 精品午夜久久福利影院| 国产日韩欧美制服另类| 91在线视频播放地址| 亚洲高清视频中文字幕| 欧美一区二区三区影视| 成人综合在线观看| 亚洲第一福利视频在线| 精品久久久久久久久久久院品网 | 欧美日韩一卡二卡| 国产做a爰片久久毛片| 亚洲欧美日韩小说| 日韩欧美中文字幕制服|