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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stdvqe.c

?? Vector Quantization壓縮算法
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************** * * NAME *    stdvqe.c *    J. R. Goldschneider 5/93 * * MODIFICATIONS *    11/93 modified to display defaults values. The -s option was added so *    that three programs were no longer maintained. JRG * *    3/94 JRG changed codebook so it is smart. It know knows the codebook size *    and dimension.  The format is: *        TYPE       SIZE            DESCRIPTION *        long       1               number of codewords (size) *        integer    1               vector dimension (dimension) *        double     size*dimension  codewords * *    12/95 JRG changed log2() to log()/M_LN2() * *    1/3/96 JRG changed one line in annulus() and sphere_annulus() *    to correct for an error in the sorting routine that ordered the *    codebook based on the norm. * *    9/4/97 JRG changed one line in annulus() and sphere_annulus() *    to correct for an index error in accessing the codeword. * * SYNOPSIS *    stdvqe -c codebook -i input -o f3 -s speedup -D * * DESCRIPTION *    stdvqe encodes file f1 using codewords from the codebook f2 that yield *    the lowest mean squared error.  The reproduction file is placed in f3. *    There are three options to speed up the search.  The first uses *    partial distortion for speedup.  The second two use constraints *    imposed by ordering the codewords. See  Huang, Bi, Stiles, *    and Harris in the IEEE Transactions on Image Processing July 1992. *    All three versions use the mean square error as the metric. * * OPTIONS *    -i  input file name *    -c  codebook file name *    -o  output file name *    -s  type of constrained search or speedup * * FLAGS *    -D  print cell counts and distortions * *    See vq.h for definitions of default values * * CALLS * *****************************************************************************/#include <stdio.h>#include <string.h>#include <math.h>#include "vq.h"#include "stdvq.def"#include "stdvq.h"FILE    *inputfile;        /* image to encode */FILE    *outputfile;       /* reproduction image */char    outputname[NAME_MAXIMUM]; /* name of reproduction image */double  fullsearch();double  annulus();double  sphere_annulus();int main(argc, argv)     int  argc;     char *argv[];{  char    option;          /* used for command line interpretation */  char    inputname[NAME_MAXIMUM]; /* name of input image */  FILE    *codebookfile;   /* pointer to codebook file */  double  **codebook;      /* codewords stored [index][dimension] */  double  *celldistortion; /* distortion of each voronoi region */  double (*method)();      /* pointer to function */  double  distortion;      /* total average distortion of encoded image */  double  entropy;         /* entropy of encoded image */  long    *count;          /* number of cells in each voronoi region */  long    numbervectors;   /* number of vectors encoded */  long    i;               /* index */  int     speedup;         /* indicates which type of speedup to use */  /* set default values */  display_info = FALSE;  programname = *argv;  speedup = DEF_SPEEDUP;  sprintf(inputname,DEF_INNAME);  sprintf(outputname,DEF_OUTNAME);  sprintf(codebookname,DEF_INNAME);  /* if no options entered, list all of the defaults */  if (argc == 1) {    printf("%s %s %s\n",USAGE,programname,HOWTOUSE_STDVQE);    printf("\nOPTIONS   DESCRIPTIONS                         DEFAULTS\n");    printf("-c        codebook name                        %s\n",codebookname);    printf("-i        input name                           %s\n",inputname);    printf("-o        output name                          %s\n",outputname);    printf("-D        print cell counts and distortions\n");    printf("-s        constrained search choice            %d\n",speedup);    printf("          0 for partial distortion only\n");    printf("          1 for p.d. and constrained search\n");    printf("          2 for p.d. and more constrained search\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 == 'D') {display_info = TRUE;}/* examine the flag */      else if (--argc && ++argv) { /* examine the option */	switch(option) { /* examine the option letter */	case 'i':	  strncpy(inputname,*argv,NAME_MAX);	  break;	case 'c':	  strncpy(codebookname,*argv,NAME_MAX);	  break;	case 'o':	  strncpy(outputname,*argv,NAME_MAX);	  break;	case 's':          sscanf(*argv,"%d",&speedup);          break;	default:	  fprintf(stderr,"%s: %c: %s\n",programname,option,NOTOPTION);	  exit(1);	  break;	}      }      else {	fprintf(stderr,"%s %s %s\n",USAGE,programname,HOWTOUSE_STDVQE);	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 did not enter an input file name or a codebook file name */  if (strlen(inputname) == 0 || strlen(codebookname) == 0 ) {    fprintf(stderr,"%s %s %s\n",USAGE,programname,HOWTOUSE_STDVQE);    exit(5);  }  /* find speedup option */  switch (speedup)    {    case 0:      method = fullsearch;      break;    case 1:      method = annulus;      break;    case 2:      method = sphere_annulus;      break;    default:      fprintf(stderr,"%s %s %s\n",USAGE,programname,HOWTOUSE_STDVQ);      exit(6);    }  /* user entered an input name which is the same as the output name */  if (strncmp(inputname,outputname,NAME_MAX) == 0) {    fprintf(stderr,"%s: %s %s %s %s: %s\n",	    programname,inputname,AND,outputname,ARESAME,ABORT_STDVQE);    exit(7);  }  /* user entered a codebook name which is the same as the output name */  if (strncmp(codebookname,outputname,NAME_MAX) == 0) {    fprintf(stderr,"%s: %s %s %s %s: %s\n",	    programname,codebookname,AND,outputname,ARESAME,ABORT_STDVQE);    exit(8);  }  /* user entered an input name which is the same as the codebook name */  if (strncmp(inputname,codebookname,NAME_MAX) == 0) {    fprintf(stderr,"%s: %s %s %s %s: %s\n",	    programname,inputname,AND,codebookname,ARESAME,ABORT_STDVQE);    exit(9);  }  /* if an input file is given but not an output file, assign output name */  if (strlen(outputname) == 0) {    sprintf(outputname,"%s%s",inputname,DEF_APPEND_VQ);  }  /* open the files */  if((inputfile = fopen(inputname,"r")) == NULL){    fprintf(stderr,"%s: %s: %s\n",programname,inputname,NOTFOUND);    exit(10);  }  if((codebookfile = fopen(codebookname,"r")) == NULL){    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOTFOUND);    exit(11);  }  if((outputfile = fopen(outputname,"w")) == NULL){    fprintf(stderr,"%s: %s: %s\n",programname,outputname,NOTFOUND);    exit(12);  }  /* allocate memory for each codeword, read the codeword, and     initialize its count and distortion */  rewind(codebookfile);  /* find the codebooksize */  if (fread(&codebooksize,sizeof(long),1,codebookfile) != 1) {    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOREAD);    exit(13);  }  /* find the dimension */  if (fread(&dimension,sizeof(int),1,codebookfile) != 1) {    fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOREAD);    exit(14);  }  /* allocate memory for the codebook, cell counts, and cell distortions */  if (!(codebook = (double **) calloc(codebooksize,sizeof(double *))) ||      !(count = (long *) calloc(codebooksize,sizeof(long))) ||      !(celldistortion  = (double *) calloc(codebooksize,sizeof(double)))) {    fprintf(stderr,"%s: %s\n",programname,NOMEMORY);    exit(15);  }  for(i = 0; i < codebooksize; i++) {    if (!(codebook[i] = (double *) calloc(dimension,sizeof(double)))) {      fprintf(stderr,"%s: %s\n",programname,NOMEMORY);      exit(16);    }    if (fread(codebook[i],sizeof(double),dimension,codebookfile)!=dimension ||	feof(codebookfile) || ferror(codebookfile) ) {      fprintf(stderr,"%s: %s: %s\n",programname,codebookname,NOREAD);      exit(17);    }    count[i] = 0;    celldistortion[i] = 0.0;  }  fclose(codebookfile);  /* encode the data */  if((distortion = method(codebook,count,celldistortion)) < 0) {    exit(18);  }  /* normalize the distortions and find the entropy */  numbervectors = 0;  entropy = 0.0;  for (i = 0; i < codebooksize; i++) {    if (count[i] != 0) {      celldistortion[i] = celldistortion[i] / (double) count[i];      entropy += (count[i]) * log( (double) count[i] );    }    numbervectors += count[i];  }  if (numbervectors != 0) {    distortion /= (double) numbervectors;    entropy = (log( (double) numbervectors) - entropy/numbervectors) / M_LN2;  }  /* output the statistics */  printf("\n");  printf("File to encode:       %s\n", inputname);  printf("Codebook file:        %s\n", codebookname);  printf("Number of Codewords:  %d\n", codebooksize);  printf("Encoded file:         %s\n", outputname);  printf("Vectors encoded:      %d\n", numbervectors);  printf("Average distortion:   %f\n", distortion);  printf("Rate (bpv):           %f\n", (log((double) codebooksize)/M_LN2));  printf("Empirical entropy:    %f\n\n",entropy);  /* Print the cell information if requested */  if (display_info) {    printf("\nCodeword  Count     Distortion\n\n");    for (i = 0; i < codebooksize; i++) {      printf("%-10d%-10d%-10f\n",i,count[i],celldistortion[i]);    }  }  fflush(stdout);  fclose(inputfile);  fclose(outputfile);  exit(0);}double fullsearch(codebook,count,celldistortion)     double **codebook;     long   *count;     double *celldistortion;{  DATA    *tempvector;    /* vector to be encoded */  double  distortion;     /* total image distortion */  double  bestdistortion; /* distortion between vector and best codeword */  double  tempdistortion; /* temporary variable */  double  temp;           /* temporary variable */  long    bestcodeword;   /* index of closest codeword */  long    i,j;            /* counters and indices */  /* allocate memory for the temporary vector */  if(!(tempvector = (DATA *) calloc(dimension,sizeof(DATA)))) {    fprintf(stderr,"%s: %s\n",programname,NOMEMORY);    return(-1.0);  }  /* encode the data and write them to the output file, also find statistics */  rewind(inputfile);  distortion = 0.0;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美高清性hdvideosex| 久久综合九色综合97婷婷| 中文一区二区在线观看| 成人网页在线观看| 亚洲国产高清不卡| 91行情网站电视在线观看高清版| 亚洲精品免费一二三区| 欧美日韩卡一卡二| 卡一卡二国产精品 | 国产成人午夜高潮毛片| 国产精品欧美一区喷水| 色婷婷久久久综合中文字幕| 亚洲第一搞黄网站| 欧美一区二区视频在线观看| 国内精品国产三级国产a久久| 国产欧美视频在线观看| 色综合天天性综合| 日韩av电影免费观看高清完整版 | 欧美综合久久久| 日本成人在线视频网站| 国产日韩av一区二区| 在线看日本不卡| 裸体歌舞表演一区二区| 国产精品丝袜一区| 欧美情侣在线播放| 国产风韵犹存在线视精品| 一区二区在线观看免费| 欧美成人精品福利| 在线亚洲+欧美+日本专区| 乱一区二区av| 亚洲男人的天堂一区二区 | 在线免费不卡电影| 久久69国产一区二区蜜臀| 亚洲天堂中文字幕| 日韩免费观看高清完整版| 99久久99精品久久久久久| 免费视频最近日韩| 中文字幕色av一区二区三区| 欧美一区二区啪啪| 色先锋资源久久综合| 国产在线观看免费一区| 亚洲线精品一区二区三区| 久久蜜桃香蕉精品一区二区三区| 色综合色综合色综合色综合色综合 | 国产成人精品免费| 在线观看亚洲精品| 成人中文字幕电影| 久久精品国产亚洲a| 亚洲午夜成aⅴ人片| 国产精品国产精品国产专区不片| 91精品国产全国免费观看| 91浏览器在线视频| 国产白丝精品91爽爽久久| 青青草国产成人av片免费| 樱桃国产成人精品视频| 国产三级三级三级精品8ⅰ区| 69堂国产成人免费视频| 色播五月激情综合网| 懂色av一区二区三区蜜臀| 精品亚洲国产成人av制服丝袜| 亚洲图片欧美色图| 亚洲精品写真福利| 国产精品不卡一区| 国产亚洲精品bt天堂精选| 欧美一区二区三区视频在线| 欧美日韩美少妇| 欧美午夜电影在线播放| 色婷婷香蕉在线一区二区| 91香蕉视频mp4| 不卡av在线网| av一本久道久久综合久久鬼色| 国产精品中文字幕欧美| 久久精品国产久精国产| 男人的j进女人的j一区| 日韩成人午夜电影| 日日夜夜免费精品| 男男视频亚洲欧美| 免费欧美日韩国产三级电影| 美女在线视频一区| 九九视频精品免费| 国内外成人在线| 国产一区二区三区在线观看免费视频| 久久黄色级2电影| 久久狠狠亚洲综合| 国产酒店精品激情| 国产成人免费在线视频| 成人午夜短视频| 91视频一区二区| 欧美日韩一卡二卡| 欧美一区二区三区性视频| 日韩一区二区三区电影在线观看| 日韩欧美一二区| 国产三级三级三级精品8ⅰ区| 国产精品网站在线| 亚洲美女免费视频| 亚洲国产毛片aaaaa无费看| 三级影片在线观看欧美日韩一区二区 | 欧美日韩久久不卡| 日韩欧美中文一区二区| 久久精品在线观看| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 久久精品999| 国产999精品久久久久久| 99综合影院在线| 欧美日韩国产中文| 久久先锋影音av| 亚洲婷婷综合久久一本伊一区| 亚洲在线成人精品| 精品在线一区二区三区| 99r精品视频| 欧美精品丝袜久久久中文字幕| 日韩精品一区二区三区老鸭窝| 国产无遮挡一区二区三区毛片日本| 国产精品乱码一区二三区小蝌蚪| 亚洲综合成人在线视频| 老色鬼精品视频在线观看播放| 成人视屏免费看| 欧美精品久久久久久久多人混战| 欧美精品一区二区三区高清aⅴ| 中文字幕在线不卡一区| 日韩精品亚洲专区| 成人性视频免费网站| 色网站国产精品| 欧美草草影院在线视频| 亚洲欧洲www| 蜜桃一区二区三区四区| jvid福利写真一区二区三区| 欧美一区二区三区白人| 中文字幕亚洲不卡| 经典三级视频一区| 欧美日韩中字一区| 久久精品网站免费观看| 亚洲福利视频三区| 成人免费高清视频在线观看| 欧美日本视频在线| 亚洲女同一区二区| 国产在线精品免费| 欧美一区二区三区的| 亚洲一区二区三区国产| 国产91丝袜在线观看| 欧美日韩国产免费| 亚洲欧美偷拍另类a∨色屁股| 精品在线观看视频| 9191久久久久久久久久久| 亚洲私人影院在线观看| 国产精品99久久久久久久vr| 欧美久久久久久久久| 亚洲综合无码一区二区| 成人国产精品视频| 久久精品男人天堂av| 日韩高清中文字幕一区| 91美女福利视频| 日本一二三不卡| 国产成人高清在线| 国产欧美精品一区| 极品少妇xxxx精品少妇偷拍| 欧美久久免费观看| 亚洲福利视频导航| 色综合久久久久综合体桃花网| 国产女人水真多18毛片18精品视频| 美女被吸乳得到大胸91| 欧美老人xxxx18| 三级欧美在线一区| 欧美日韩激情一区| 日韩影院免费视频| 91精品麻豆日日躁夜夜躁| 香港成人在线视频| 亚洲精品国产高清久久伦理二区| av在线一区二区三区| 国产精品午夜春色av| 成人精品免费网站| 中文字幕中文字幕在线一区| hitomi一区二区三区精品| 综合在线观看色| 日本精品一级二级| 亚洲资源在线观看| 欧美精品亚洲一区二区在线播放| 亚洲成人动漫在线观看| 欧美日韩精品电影| 蜜桃精品在线观看| 久久免费视频一区| 成人av动漫网站| 亚洲精品国产成人久久av盗摄| 欧美日韩综合不卡| 乱一区二区av| 国产精品你懂的在线| 99re这里只有精品首页| 日本欧美一区二区| 中文字幕在线不卡一区二区三区| 欧美精品日韩精品| 91丨九色丨蝌蚪富婆spa| 蜜乳av一区二区| 日本美女一区二区三区视频| 日韩高清一区二区| 日韩av网站在线观看| 亚洲一区二区五区| 亚洲欧美日韩国产另类专区 | 色偷偷成人一区二区三区91| 日韩精品亚洲专区| 青青草原综合久久大伊人精品优势|