www.pudn.com > H265+2008.8.rar > psnr_argcv.c


 
/* 
/////////////////////////////////////////////////////////////////////////////// 
//                                                                           // 
//   Copyright (C) 2006-2008  Beijing,  pengzhen (pengzhenxp@yahoo.com.cn)   // 
//                                                                           // 
/////////////////////////////////////////////////////////////////////////////// 
*/ 
 
#define get_parameter_flag(AA) ( strcmp( argv[mark], (AA) ) == 0 ) 
#define get_parameter_next() argc-- ; mark++ ;  
#define get_parameter_read() value = atoi( argv[mark] );  
 
/** 
* get parameter 
*/ 
static void get_parameter0(int argc, char **argv) 
{ 
 
    int mark = 1 ; int value = 0 ; 
	 
    argc-- ; /* skip name */ 
    while (argc > 0)  
	{ 
         
		if ( get_parameter_flag("-infile0") )  
		{ 
            get_parameter_next() ; /* next */ 
 
			strcpy( m_in_file_name0 , argv[mark] ); /* */ 
        } 
	 
		else if ( get_parameter_flag("-infile1") )  
		{ 
            get_parameter_next() ; /* next */ 
 
			strcpy( m_in_file_name1 , argv[mark] ); /* */ 
        } 
 
		else if ( get_parameter_flag("-frame_size") )  
		{ 
			char *arg_bak ; int width , height ;  
			 
			get_parameter_next() ; /* next */ 
			//get_parameter_read() ; 
			 
			arg_bak = argv[mark];  
			width = (int)strtol(arg_bak, (char **)&arg_bak, 10) ; /* width */ 
			arg_bak +=  (arg_bak != NULL )  ; 
			height = (int)strtol(arg_bak, (char **)&arg_bak, 10) ; /* height */ 
 
			width = (width >>4) << 4 ; /* picture width. (must be a multiple of 16) */ 
			height = (height >>4) << 4 ; /* picture height. (must be a multiple of 16) */ 
 
			m_width = width ; /* */ 
			m_height = height ; 
			 
        } 
 
        get_parameter_next() ; /* next */ 
 
	} 
	 
}