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

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

?? configfile.c

?? Mobile IP VCEG的信道模擬程序
?? C
字號:

#define INCLUDED_BY_CONFIGFILE_C
// *************************************************************************************
// *************************************************************************************
// Configfile.c	 Configuration handling
//
// Main contributors (see contributors.h for copyright, address and affiliation details)
//
// Stephan Wenger				   <stewe@cs.tu-berlin.de>
// *************************************************************************************
// *************************************************************************************
//
// Note: In the future this module should hide the Parameters and offer only
// Functions for their access.  Modules which make frequent use of some parameters
// (e.g. picture size in macroblocks) are free to buffer them on local variables.
// This will not only avoid global variable and make the code more readable, but also
// speed it up.  It will also greatly facilitate future enhancements such as the
// handling of different picture sizes in the same sequence.
//
// For now, everything is just copied to the inp_par structure (gulp)
//
// *************************************************************************************
// *************************************************************************************
// New configuration File Format
// *************************************************************************************
// *************************************************************************************
//
// Format is line oriented, maximum of one parameter per line
//
// Lines have the following format:
// <ParameterName> = <ParameterValue> # Comments \n
// Whitespace is space and \t
//
// <ParameterName> are the predefined names for Parameters and are case sensitive.
//   See configfile.h for the definition of those names and their mapping to configinput-> 
//   values.
// <ParameterValue> are either integers [0..9]* or strings.  
//   Integers must fit into the wordlengths, signed values are generally assumed.
//   Strings containing no whitespace characters can be used directly.  Strings containing
//   whitespace characters are to be inclosed in double quotes ("string with whitespace") 
//   The double quote character is forbidden (may want to implement something smarter here).
//
// Any Parameters whose ParameterName is undefined lead to the termination of the program
// with an error message.
//
// Known bug/Shortcoming:	zero-length strings (i.e. to signal an non-existing file
//							have to be coded as "".
//
//
// Rules for using command files
//
// All Parameters are initially taken from DEFAULTCONFIGFILENAME, defined in configfile.h.  
// If an -f <config> parameter is present in the command line then this file is used to 
// update the defaults of DEFAULTCONFIGFILENAME.  There can be more than one -f parameters 
// present.  If -p <ParameterName = ParameterValue> parameters are present then these 
// overide the default and the additional config file's settings, and are themselfes 
// overridden by future -p parameters.  There must be whitespace between -f and -p commands 
// and their respecitive parameters
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include "global.h"
#include "configfile.h"


static char *GetConfigFileContent (char *Filename);
static void ParseContent (char *buf, int bufsize);
static int ParameterNameToMapIndex (char *s);
static void PatchInp ();


#define MAX_ITEMS_TO_PARSE	10000



void Configure (int ac, char *av[]) {

	char *content;
	int CLcount, ContentLen, NumberParams;

	memset (&configinput, 0, sizeof (InputParameters));
	// Process default config file

	printf ("Parsing Configfile %s", DEFAULTCONFIGFILENAME);
	content = GetConfigFileContent (DEFAULTCONFIGFILENAME);
	ParseContent (content, strlen(content));
	printf ("\n");
	free (content);
	
	// Parse the command line

	CLcount = 1;
	while (CLcount < ac) {
// printf ("checking command line parameter %d\n", CLcount);
		if (0 == strncmp (av[CLcount], "-f", 2)) {			// A file parameter?
			content = GetConfigFileContent (av[CLcount+1]);
			printf ("Parsing Configfile %s", av[CLcount+1]);
			ParseContent (content, strlen (content));
			printf ("\n");
			free (content);
			CLcount += 2;
		} else {
			if (0 == strncmp (av[CLcount], "-p", 2)) {	// A config change?
				// Collect all data until next parameter (starting with -<x> (x is any character)),
				// put it into content, and parse content.

				CLcount++;
				ContentLen = 0;
				NumberParams = CLcount;	

				// determine the necessary size for content
				while (NumberParams < ac && av[NumberParams][0] != '-') 
					ContentLen += strlen (av[NumberParams++]);				// Space for all the strings
				ContentLen += 1000;											// Additional 1000 bytes for spaces and \0s


// printf ("Malloc %d for content\n", ContentLen);

				content = malloc (ContentLen);
				content[0] = '\0';

				// concatenate all parameters itendified before

				while (CLcount < NumberParams) {
					char *source = &av[CLcount][0];
					char *destin = &content[strlen (content)];

					while (*source != '\0') {
						if (*source == '=') {		// The Parser expects whitespace before and after '='
							*destin++=' '; *destin++='='; *destin++=' ';	// Hence make sure we add it
						} else
							*destin++=*source;
						source++;
					}
					*destin = '\0';
					CLcount++;
				}
				printf ("Parsing command line string '%s'", content);
				ParseContent (content, strlen(content));
				free (content);
				printf ("\n");
			} 
			else {
				printf ("Error in command line, ac %d, around string '%s', missing -f or -p parameters?", CLcount, av[CLcount]);
				exit (-300);
			}
		}
	}
	printf ("\n");
}


char *GetConfigFileContent (char *Filename) {
//	allocates memory buf, opens file Filename in f, reads contents into buf and returnz buf 

	unsigned FileSize;
	FILE *f;
	char *buf;

	if (NULL == (f = fopen (Filename, "r"))) {
		printf ("Cannot open configuration file %s, exit -300", Filename);
		exit (-300);
	}

	if (0 != fseek (f, 0, SEEK_END)) {
		printf ("Cannot fseek in configuration file %s, exit -301", Filename);
		exit (-301);
	}
		;
	FileSize = ftell (f);
	if (FileSize < 0 || FileSize > 60000) {
		printf ("Unreasonable Filesize %d reported by ftell for configuration file %s, exit -302\n", FileSize, Filename);
// getchar();
		exit (-302);
	}
	if (0 != fseek (f, 0, SEEK_SET)) {
		printf ("Cannot fseek in configuration file %s, exit -301", Filename);
		exit (-303);
	}

	buf = malloc (FileSize);
	assert (NULL != buf);

	// Note that ftell() gives us the file size as teh file system sees it.  The actual file size,
	// as reported by fread() below will be often smaller due to CR/LF to CR conversion and/or
	// control characters after the dos EOF marker in the file.  

	FileSize = fread (buf, 1, FileSize, f);
	

	fclose (f);
	return buf;
}



void ParseContent (char *buf, int bufsize) {
// Parses the character array buf and writes global variable input, which is defined in 
// configfile.h.  This hack will continue to be necessary to facilitate the addition of
// new parameters through the Map[] mechanism (Need compiler-generated addresses in map[]).

	char *items[MAX_ITEMS_TO_PARSE];
	int MapIdx;
	int item = 0;
	int InString = 0, InItem = 0;
	char *p = buf;
	char *bufend = &buf[bufsize];
	int IntContent; 
	int i;
	
// Stage one: Generate an argc/argv-type list in items[], without comments and whitespace.
// This is context insensitive and could be done most easily with lex(1).

// printf ("In ParseContent, string is '%s'\n", buf);
// printf ("strlen(content)=%d\n", strlen(buf));
// getchar();
	while (p < bufend) {
		switch (*p) {
			case 13:
				p++;
				break;
			case '#': 								// Found comment
				*p = '\0';							// Replace '#' with '\0' in case of comment immediately following integer or string
				while (*p != '\n' && p < bufend)	// Skip till EOL or EOF, whichever comes first
					p++;
				InString = 0;
				InItem = 0;
				break;
			case '\n':
				InItem = 0;
				InString = 0;
				*p++='\0';
				break;
			case ' ':
			case '\t':						// Skip whitespace, leave state unchanged
				if (InString)
					p++;
				else {						// Terminate non-strings once whitespace is found
					*p++ = '\0';
					InItem = 0;
				}
				break;

			case '"':						// Begin/End of String
				*p++ = '\0';
				if (!InString)  {
					items[item++] = p;
					InItem = ~InItem;
				}
				else
					InItem = 0;
				InString = ~InString;		// Toggle
				break;

			default:
				if (!InItem) {
					items[item++] = p;
					InItem = ~InItem;
				}
				p++;
		}
	}

	item--;
/*
	for (i=0; i<item; i+=3) {
		printf ("%s\t\t%s\t%s\n", items[i], items[i+1], items[i+2]);
		getchar();
	}
*/
	for (i=0; i<item; i+= 3) {
		if (0 > (MapIdx = ParameterNameToMapIndex (items[i]))) {
			printf (" Parsing error in config file: Parameter Name '%s' not recognized, exiting\n", items[0]);
			getchar();
			exit (-308);
		}
		if (strcmp ("=", items[i+1])) {
			printf (" Parsing error in config file: '\"' expected as the second token in each line\n");
			exit (-303);
		}

		// Now interprete the Value, context sensitive...

		switch (Map[MapIdx].Type) {
			case 0:						// Numerical
				if (1 != sscanf (items[i+2], "%d", &IntContent)) {
					printf (" Parsing error: Expected numerical value for Parameter of %s, found '%s', exiting\n", items[i], items[i+2]);
					exit (-304);
				}
				* (int *) (Map[MapIdx].Place) = IntContent;
				printf (".");
				break;
			case 1:
				strcpy ((char *) Map[MapIdx].Place, items [i+2]);
				printf (".");
				break;
			default:
				assert ("Unknown value type in the map definition of configfile.h");
		}
	}
	memcpy (input, &configinput, sizeof (InputParameters));
	PatchInp();
}


static int ParameterNameToMapIndex (char *s) {
	int i = 0;

	while (Map[i].TokenName != NULL)
		if (0==strcmp (Map[i].TokenName, s))
			return i;
		else
			i++;
	return -1;
};


static void PatchInp () {


	// consistency check of QPs
	if (input->qp0 > 31 || input->qp0 <= 0)
	{
		printf("Error input parameter quant_0,check configuration file\n");
		exit (-401);
	}

	if (input->qpN > 31 || input->qpN <= 0)
	{
		printf("Error input parameter quant_n,check configuration file\n");
		exit (-402);
	}

	if (input->qpB > 31 || input->qpB <= 0)             
	{
		printf("Error input parameter quant_B,check configuration file\n");
		exit (0);
	}

	// consistency check Search_range

	if (input->search_range > 39)		// StW
	{
		printf("Error in input parameter search_range, check configuration file\n");
		exit (-403);
	}

	// consistency check no_multpred
	if (input->no_multpred<1) input->no_multpred=1;
#if 0   // Do not check anymore
	// consistency check no_multpred
	if(input->no_multpred > MAX_MULT_PRED)
	{
		printf("Error : input parameter 'no_multpred' exceeds limit (1...5), check configuration file \n");
		exit(-404);
	}
#endif

	// consistency check size information

	if (input->img_height % 16 != 0 || input->img_width % 16 != 0)
	{
		printf("Unsupported image format x=%d,y=%d, must be a multiple of 16\n",input->img_width,input->img_height);
		exit(0);
	}
	
	// Set block sizes

	// First, initialize input->blc_size to all zeros
	memset (input->blc_size,0, 4*8*2);

	// set individual items
	if (input->InterSearch16x16) {
		input->blc_size[1][0]=16;
		input->blc_size[1][1]=16;
	}
	if (input->InterSearch16x8) {
		input->blc_size[2][0]=16;
		input->blc_size[2][1]= 8;
	}
	if (input->InterSearch8x16) {
		input->blc_size[3][0]= 8;
		input->blc_size[3][1]=16;
	}
	if (input->InterSearch16x16) {
		input->blc_size[4][0]= 8;
		input->blc_size[4][1]= 8;
	}
	if (input->InterSearch8x4) {
		input->blc_size[5][0]= 8;
		input->blc_size[5][1]= 4;
	}
	if (input->InterSearch4x8) {
		input->blc_size[6][0]= 4;
		input->blc_size[6][1]= 8;
	}
	if (input->InterSearch4x4) {
		input->blc_size[7][0]= 4;
		input->blc_size[7][1]= 4;
	}

	if (input->partition_mode < 0 || input->partition_mode > 2) {
		printf("Unsupported Partition mode, must be between 0 and 2\n");
		exit(-405);
	}

	if (input->of_mode < 0 || input->of_mode > 1) {
		printf("Unsupported Outpout file mode, must be between 0 and 1\n");
		exit(-405);
	}

	// B picture consistency check
	if(input->successive_Bframe > input->jumpd) 
	{
		printf("Number of B-frames %d can not exceed the number of frames skipped\n", input->successive_Bframe);
		exit (-406);
	}

	// Cabac/UVLC consistency check
	if (input->symbol_mode != UVLC && input->symbol_mode != CABAC)
	{
		printf ("Unsupported symbol mode=%d, use UVLC=0 or CABAC=1\n",input->symbol_mode);
		exit (-407);
	}
	
	

	//Open Files

	if ((p_in=fopen(input->infile,"rb"))==NULL)  
	{
		printf("Input file %s does not exist \n",input->infile);
		exit(0);
	}

	if (strlen (input->ReconFile) > 0 && (p_dec=fopen(input->ReconFile, "wb"))==NULL)
	{
		printf("Error open file test.dec \n");
		exit(0);
	}

	if (strlen (input->TraceFile) > 0 && (p_trace=fopen(input->TraceFile,"w"))==NULL)
	{
		printf("Error open file trace_enc.txt\n");
		exit(0);
	}
}






?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区自拍| 国产欧美视频在线观看| 色菇凉天天综合网| 不卡免费追剧大全电视剧网站| 久久狠狠亚洲综合| 另类欧美日韩国产在线| 极品美女销魂一区二区三区免费| 蜜臀久久99精品久久久久久9| 日韩中文字幕一区二区三区| 天涯成人国产亚洲精品一区av| 亚洲国产aⅴ天堂久久| 午夜国产不卡在线观看视频| 日韩专区一卡二卡| 精品一区二区成人精品| 久久99精品国产麻豆婷婷| 国产一区二区影院| 91网址在线看| 91精品久久久久久蜜臀| 欧美xingq一区二区| 国产色一区二区| 亚洲视频小说图片| 丝袜a∨在线一区二区三区不卡| 免费观看久久久4p| 国产成人综合精品三级| 一本大道久久精品懂色aⅴ| 欧美猛男男办公室激情| 久久综合色鬼综合色| 欧美国产激情一区二区三区蜜月| 亚洲精品日日夜夜| 日本不卡中文字幕| 成人精品国产一区二区4080| 91成人在线观看喷潮| 欧美成人三级在线| 亚洲人123区| 日韩—二三区免费观看av| 国产一区二区三区视频在线播放| 99久久精品免费精品国产| 91精品啪在线观看国产60岁| 国产日产亚洲精品系列| 偷拍日韩校园综合在线| 成人黄色免费短视频| 欧美高清激情brazzers| 亚洲三级在线看| 美洲天堂一区二卡三卡四卡视频 | 亚洲欧洲精品一区二区三区 | 寂寞少妇一区二区三区| 日本二三区不卡| 久久久久久久久99精品| 亚洲一区二区三区美女| 成人自拍视频在线| 4438亚洲最大| 亚洲午夜精品在线| av在线这里只有精品| 日韩三级伦理片妻子的秘密按摩| 亚洲日本免费电影| 国产一区二区久久| 这里只有精品99re| 亚洲欧美日韩成人高清在线一区| 国产精品综合网| 日韩精品中文字幕在线一区| 亚洲国产精品久久艾草纯爱| 99九九99九九九视频精品| 久久久久久久综合| 男人的天堂亚洲一区| 欧美乱熟臀69xxxxxx| 亚洲精品日韩专区silk| 成人丝袜视频网| 国产日韩高清在线| 国产福利一区二区三区视频| 精品对白一区国产伦| 免费在线观看精品| 在线播放亚洲一区| 日韩电影免费在线看| 在线播放视频一区| 肉色丝袜一区二区| 91精品国产色综合久久久蜜香臀| 一个色在线综合| 欧美日韩国产综合草草| 天使萌一区二区三区免费观看| 在线播放亚洲一区| 毛片基地黄久久久久久天堂| 日韩一区二区三区免费看| 日韩在线a电影| 日韩精品中午字幕| 国产露脸91国语对白| 欧美国产亚洲另类动漫| 成人精品免费看| 国产精品第四页| 一本一道久久a久久精品| 亚洲青青青在线视频| 欧美色图一区二区三区| 日韩vs国产vs欧美| 久久久久久亚洲综合影院红桃| 国产99精品视频| 亚洲私人影院在线观看| 欧美日韩国产一级二级| 久久精品国产亚洲高清剧情介绍 | 中文字幕va一区二区三区| 91在线观看高清| 亚洲一区在线视频观看| 日韩午夜在线播放| 国产福利91精品一区二区三区| 国产精品乱人伦中文| 91久久久免费一区二区| 蜜臀久久99精品久久久久久9| 久久久99免费| 91福利国产精品| 精品一区二区三区视频在线观看 | 亚洲成人免费观看| 精品国产青草久久久久福利| 91亚洲精品久久久蜜桃| 免费高清在线视频一区·| 国产精品美日韩| 777欧美精品| 99re热这里只有精品免费视频| 亚洲第一电影网| 欧美国产精品中文字幕| 欧美一级欧美一级在线播放| eeuss国产一区二区三区| 日本色综合中文字幕| 亚洲蜜臀av乱码久久精品蜜桃| 日韩三级高清在线| 91麻豆视频网站| 国产综合久久久久久鬼色 | 26uuu色噜噜精品一区| 一本到不卡免费一区二区| 国内偷窥港台综合视频在线播放| 亚洲精品福利视频网站| 久久久91精品国产一区二区精品| 欧美人牲a欧美精品| 97精品国产露脸对白| 国产精品白丝jk黑袜喷水| 三级在线观看一区二区| 亚洲免费观看视频| 国产精品午夜久久| 精品国产99国产精品| 日韩一区二区三区电影| 欧美在线看片a免费观看| 99国产一区二区三精品乱码| 国产揄拍国内精品对白| 免费看日韩精品| 日本亚洲视频在线| 天天色综合成人网| 亚洲国产成人高清精品| 亚洲图片一区二区| 一区二区三区四区不卡在线 | 久久青草欧美一区二区三区| 日韩一区二区三区视频在线| 欧美精品成人一区二区三区四区| 欧美天天综合网| 日本精品一区二区三区高清| 波波电影院一区二区三区| 国产aⅴ精品一区二区三区色成熟| 精品亚洲成a人在线观看| 麻豆国产一区二区| 精油按摩中文字幕久久| 国产精品自拍三区| 国产伦精品一区二区三区免费| 免费不卡在线观看| 狠狠色丁香九九婷婷综合五月| 国内偷窥港台综合视频在线播放| 久久成人综合网| 国产一区二区三区国产| 国产大陆亚洲精品国产| av午夜精品一区二区三区| 972aa.com艺术欧美| 欧美亚洲愉拍一区二区| 6080日韩午夜伦伦午夜伦| 日韩欧美一区二区视频| 久久影院午夜论| 日韩理论片在线| 日本怡春院一区二区| 国产大陆精品国产| 色系网站成人免费| 宅男在线国产精品| 国产亚洲精品资源在线26u| 国产精品久久久久三级| 亚洲码国产岛国毛片在线| 午夜在线成人av| 国产酒店精品激情| 色综合久久综合| 欧美v日韩v国产v| 成人免费视频在线观看| 亚洲第一在线综合网站| 狠狠色丁香久久婷婷综合丁香| 大尺度一区二区| 欧美三级电影一区| 26uuu国产电影一区二区| ...xxx性欧美| 捆绑变态av一区二区三区 | 一区二区三区四区蜜桃| 免费成人在线观看视频| 99热在这里有精品免费| 欧美丰满少妇xxxxx高潮对白| 亚洲国产高清在线| 免费观看成人av| 日本精品裸体写真集在线观看 | 色悠悠久久综合| 精品国产乱码久久久久久久| 亚洲午夜久久久久|