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

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

?? configfile.c

?? 一個簡單的視頻會議VC++MFC工程文件
?? C
?? 第 1 頁 / 共 3 頁
字號:

/*!
 ***********************************************************************
 * \file
 *    configfile.c
 * \brief
 *    Configuration handling.
 * \author
 *  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.                         \n
 *                                                                                      \n
 *    For now, everything is just copied to the inp_par structure (gulp)
 *
 **************************************************************************************
 * \par Configuration File Format
 **************************************************************************************
 * Format is line oriented, maximum of one parameter per line                           \n
 *                                                                                      \n
 * Lines have the following format:                                                     \n
 * \<ParameterName\> = \<ParameterValue\> # Comments \\n                                    \n
 * Whitespace is space and \\t
 * \par
 * \<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.
 * \par
 * \<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).
 * \par
 * Any Parameters whose ParameterName is undefined lead to the termination of the program
 * with an error message.
 *
 * \par Known bug/Shortcoming:
 *    zero-length strings (i.e. to signal an non-existing file
 *    have to be coded as "".
 *
 * \par Rules for using command files
 *                                                                                      \n
 * 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
 ***********************************************************************
 */

#define INCLUDED_BY_CONFIGFILE_C

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

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


#include "fmo.h"

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


#define MAX_ITEMS_TO_PARSE  10000


/*!
 ***********************************************************************
 * \brief
 *   print help message and exit
 ***********************************************************************
 */
void JMHelpExit()
{
  fprintf( stderr, "\n   lencod [-h] [-p defenc.cfg] {[-f curenc1.cfg]...[-f curencN.cfg]}"
    " {[-p EncParam1=EncValue1]..[-p EncParamM=EncValueM]}\n\n"    
    "## Parameters\n\n"

    "## Options\n"
    "   -h :  prints function usage\n"
    "   -d :  use <defenc.cfg> as default file for parameter initializations.\n"
    "         If not used then file defaults to encoder.cfg in local directory.\n"
    "   -f :  read <curencM.cfg> for reseting selected encoder parameters.\n"
    "         Multiple files could be used that set different parameters\n"
    "   -p :  Set parameter <EncParamM> to <EncValueM>.\n"
    "         See default encoder.cfg file for description of all parameters.\n\n"
    
    "## Supported video file formats\n"
    "   RAW:  .yuv -> YUV 4:2:0\n\n"
    
    "## Examples of usage:\n"
    "   lencod\n"
    "   lencod  -h\n"
    "   lencod  -d default.cfg\n"
    "   lencod  -f curenc1.cfg\n"
    "   lencod  -f curenc1.cfg -p InputFile=\"e:\\data\\container_qcif_30.yuv\" -p SourceWidth=176 -p SourceHeight=144\n"  
    "   lencod  -f curenc1.cfg -p FramesToBeEncoded=30 -p QPFirstFrame=28 -p QPRemainingFrame=28 -p QPBPicture=30\n");

  exit(-1);
}

/*!
 ***********************************************************************
 * \brief
 *    Parse the command line parameters and read the config files.
 * \param ac
 *    number of command line parameters
 * \param av
 *    command line parameters
 ***********************************************************************
 */
void Configure(int ac, char *av[])
{
  char *content;
  int CLcount, ContentLen, NumberParams;
  char *filename=DEFAULTCONFIGFILENAME;

  memset (&configinput, 0, sizeof (InputParameters));
  //Set some initial parameters.
  configinput.LevelIDC   = LEVEL_IDC;
  configinput.ProfileIDC = PROFILE_IDC;
  // Process default config file
  CLcount = 1;

  if (ac==2)
  {
    if (0 == strncmp (av[1], "-h", 2))
    {
      JMHelpExit();
    }
  }

  if (ac>=3)
  {
    if (0 == strncmp (av[1], "-d", 2))
    {
      filename=av[2];
      CLcount = 3;
    }
    if (0 == strncmp (av[1], "-h", 2))
    {
      JMHelpExit();
    }
  }
  printf ("Parsing Configfile %s", filename);
  content = GetConfigFileContent (filename);
  ParseContent (content, strlen(content));
  printf ("\n");
  free (content);

  // Parse the command line

  while (CLcount < ac)
  {
    if (0 == strncmp (av[CLcount], "-h", 2))
    {
      JMHelpExit();
    }
    
    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


        if ((content = malloc (ContentLen))==NULL) no_mem_exit("Configure: content");;
        content[0] = '\0';

        // concatenate all parameters identified 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
      {
        snprintf (errortext, ET_SIZE, "Error in command line, ac %d, around string '%s', missing -f or -p parameters?", CLcount, av[CLcount]);
        error (errortext, 300);
      }
    }
  }
  printf ("\n");
  PatchInp();
}

/*!
 ***********************************************************************
 * \brief
 *    allocates memory buf, opens file Filename in f, reads contents into
 *    buf and returns buf
 * \param Filename
 *    name of config file
 ***********************************************************************
 */
char *GetConfigFileContent (char *Filename)
{
  long FileSize;
  FILE *f;
  char *buf;

  if (NULL == (f = fopen (Filename, "r")))
  {
    snprintf (errortext, ET_SIZE, "Cannot open configuration file %s.\n", Filename);
    error (errortext, 300);
  }

  if (0 != fseek (f, 0, SEEK_END))
  {
    snprintf (errortext, ET_SIZE, "Cannot fseek in configuration file %s.\n", Filename);
    error (errortext, 300);
  }

  FileSize = ftell (f);
  if (FileSize < 0 || FileSize > 60000)
  {
    snprintf (errortext, ET_SIZE, "Unreasonable Filesize %ld reported by ftell for configuration file %s.\n", FileSize, Filename);
    error (errortext, 300);
  }
  if (0 != fseek (f, 0, SEEK_SET))
  {
    snprintf (errortext, ET_SIZE, "Cannot fseek in configuration file %s.\n", Filename);
    error (errortext, 300);
  }

  if ((buf = malloc (FileSize + 1))==NULL) no_mem_exit("GetConfigFileContent: buf");

  // Note that ftell() gives us the file size as the 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);
  buf[FileSize] = '\0';


  fclose (f);
  return buf;
}


/*!
 ***********************************************************************
 * \brief
 *    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[]).
 * \param buf
 *    buffer to be parsed
 * \param bufsize
 *    buffer size of buffer
 ***********************************************************************
 */
void ParseContent (char *buf, int bufsize)
{

  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;
  double DoubleContent;
  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).

  while (p < bufend)
  {
    switch (*p)
    {
      case 13:
        p++;
        break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕中文乱码欧美一区二区| 五月婷婷久久丁香| 亚洲老妇xxxxxx| 国产一区二区中文字幕| 7799精品视频| 亚洲人成亚洲人成在线观看图片| 蜜桃av一区二区三区电影| 色婷婷亚洲一区二区三区| 久久久久久久久久电影| 欧美aaaaaa午夜精品| 精品视频一区二区三区免费| 国产精品天美传媒| 国产高清在线精品| 久久青草国产手机看片福利盒子| 性做久久久久久免费观看| 91久久久免费一区二区| 日韩一区日韩二区| bt欧美亚洲午夜电影天堂| 26uuu久久综合| 久久精品国产澳门| 日韩一区二区三区视频| 奇米影视一区二区三区| 欧美一级高清片| 青青草91视频| 精品国产污污免费网站入口 | 欧美一区永久视频免费观看| 亚洲手机成人高清视频| av不卡免费在线观看| 国产精品乱码一区二三区小蝌蚪| 国产白丝网站精品污在线入口| 久久久久久久免费视频了| 精久久久久久久久久久| 久久婷婷国产综合国色天香| 国产一区二区三区四区五区美女| 欧美电影免费观看高清完整版在| 久久99久久99小草精品免视看| 精品国产一区二区三区久久久蜜月 | 亚洲午夜电影在线观看| 欧美亚洲图片小说| 青青青伊人色综合久久| 日韩三区在线观看| 国内精品免费在线观看| 日本一二三不卡| 国产成a人无v码亚洲福利| 成人免费在线视频| 欧美日韩视频在线观看一区二区三区| 午夜天堂影视香蕉久久| 日韩欧美中文字幕精品| 国产精品综合二区| 综合精品久久久| 欧美日韩激情一区二区三区| 丝袜美腿亚洲色图| 欧美性猛交xxxx乱大交退制版 | 国产精品成人网| 91成人在线免费观看| 日本美女一区二区三区| 国产三级一区二区| 日本乱人伦一区| 蜜臀av在线播放一区二区三区| 久久久久成人黄色影片| 99久久伊人网影院| 亚洲无人区一区| 日韩欧美精品三级| 成人在线综合网| 日韩电影在线观看网站| 欧美激情一区二区三区全黄| 欧美色爱综合网| 国产91对白在线观看九色| 一区二区三区.www| 国产欧美日韩在线看| 欧美性猛交xxxxxx富婆| 国产高清一区日本| 日韩在线一区二区三区| 国产精品国产馆在线真实露脸 | 亚洲欧美福利一区二区| 91精品国产高清一区二区三区蜜臀| 精品一区二区在线视频| 一区二区成人在线视频| 久久精品视频免费观看| 欧美三级三级三级| 成人午夜又粗又硬又大| 人禽交欧美网站| 亚洲精品乱码久久久久久| 国产清纯白嫩初高生在线观看91| 欧美在线高清视频| 成人久久18免费网站麻豆| 日韩国产精品久久久久久亚洲| 综合久久国产九一剧情麻豆| 欧美精品一区男女天堂| 欧美伦理电影网| 在线免费观看成人短视频| 成人激情校园春色| 国产精品一区二区三区网站| 舔着乳尖日韩一区| 洋洋av久久久久久久一区| 中文字幕免费在线观看视频一区| 日韩午夜激情视频| 欧美日韩三级在线| 欧洲亚洲精品在线| 欧美在线免费播放| 波多野结衣中文字幕一区二区三区| 国产真实乱偷精品视频免| 日本va欧美va欧美va精品| 亚洲小说春色综合另类电影| 亚洲色图欧美偷拍| 中文字幕一区日韩精品欧美| 国产日韩欧美一区二区三区乱码 | 精品国产不卡一区二区三区| 欧美日韩不卡视频| 欧美体内she精视频| 色哟哟国产精品免费观看| 99精品欧美一区| 99久久精品国产毛片| 暴力调教一区二区三区| 国产91丝袜在线播放九色| 盗摄精品av一区二区三区| 风流少妇一区二区| 成人午夜免费电影| 95精品视频在线| 色综合天天性综合| 欧美色中文字幕| 69p69国产精品| 日韩一区二区不卡| 国产亚洲一区二区三区| 欧美极品美女视频| 亚洲最色的网站| 天堂一区二区在线| 久久成人久久爱| 国产一区二区电影| 99久久国产综合精品麻豆| 色999日韩国产欧美一区二区| 欧美自拍偷拍一区| 欧美一区二区三区免费大片| 欧美精品一区二区三区在线| 国产喷白浆一区二区三区| 亚洲欧洲www| 天天综合网天天综合色| 免费人成精品欧美精品| 国产91露脸合集magnet| 色av成人天堂桃色av| 91精品国产综合久久小美女| 久久久久久电影| 亚洲精品少妇30p| 日本美女一区二区三区| 成人手机电影网| 欧美日本免费一区二区三区| 国产亚洲一区二区三区四区| 亚洲精品中文字幕乱码三区| 蜜臀av性久久久久蜜臀av麻豆| 粉嫩欧美一区二区三区高清影视| 91黄色激情网站| 精品国产一区二区国模嫣然| 一区二区三区中文字幕| 精东粉嫩av免费一区二区三区| 色综合色狠狠综合色| 欧美第一区第二区| 亚洲精品成人少妇| 韩国精品久久久| 欧美群妇大交群的观看方式| 国产精品网站一区| 麻豆精品久久精品色综合| 91久久精品网| 国产欧美一区视频| 日本aⅴ免费视频一区二区三区| 白白色 亚洲乱淫| 欧美电影免费观看高清完整版| 亚洲三级电影网站| 国产精品一线二线三线| 欧美二区三区91| 亚洲另类春色校园小说| 国产成人精品一区二区三区网站观看 | 国产成人一级电影| 日韩网站在线看片你懂的| 一区二区三区日韩精品| 粉嫩一区二区三区在线看| 日韩久久久久久| 亚洲成人资源在线| 91丨九色porny丨蝌蚪| 国产亚洲一二三区| 极品瑜伽女神91| 欧美一区二区性放荡片| 亚洲五月六月丁香激情| 色妹子一区二区| 亚洲精品日日夜夜| 色综合天天综合网国产成人综合天| 久久影院视频免费| 久久99精品久久久| 日韩视频在线永久播放| 婷婷久久综合九色综合伊人色| 欧洲av在线精品| 亚洲一区二区在线观看视频| 一本久久精品一区二区| 亚洲人成电影网站色mp4| 成人精品高清在线| 国产农村妇女精品| 国产激情精品久久久第一区二区 | 亚洲超丰满肉感bbw| 91久久免费观看| 亚洲影视在线观看| 91视频在线观看免费|