亚洲欧美第一页_禁久久精品乱码_粉嫩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
 * override the default and the additional config file's settings, and are themselves
 * overridden by future -p parameters.  There must be whitespace between -f and -p commands
 * and their respective parameters
 ***********************************************************************
 */

#define INCLUDED_BY_CONFIGFILE_C

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

#if defined WIN32
  #include <io.h>
#else
  #include <unistd.h>
#endif
#include <fcntl.h>
#include <sys/stat.h>

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

#include "fmo.h"

       char *GetConfigFileContent (char *Filename);
static void ParseContent (char *buf, int bufsize);
static int ParameterNameToMapIndex (char *s);
static int InitEncoderParams();
static int TestEncoderParams(int bitdepth_qp_scale);
static int DisplayEncoderParams();
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 QPISlice=28 -p QPPSlice=28 -p QPBSlice=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 default parameters.
  printf ("Setting Default Parameters...\n");
  InitEncoderParams();

  // 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);
  if (NULL==content)
    error (errortext, 300);
  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]);
      if (NULL==content)
        error (errortext, 300);
      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();
  if (input->DisplayEncParams)
    DisplayEncoderParams();
}

/*!
 ***********************************************************************
 * \brief
 *    allocates memory buf, opens file Filename in f, reads contents into
 *    buf and returns buf
 * \param Filename
 *    name of config file
 * \return
 *    if successfull, content of config file
 *    NULL in case of error. Error message will be set in errortext
 ***********************************************************************
 */
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.", Filename);
      return NULL;
  }

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

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

  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;
      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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品盗摄一区二区三区| 久久99精品一区二区三区三区| 国产日产精品1区| 欧美日韩在线综合| 色综合久久久久综合体| 岛国精品一区二区| 国产在线精品免费av| 老鸭窝一区二区久久精品| 五月天一区二区| 亚洲一区二区三区中文字幕| 国产欧美一区二区精品久导航 | 欧美日韩一级大片网址| 成人精品亚洲人成在线| 国产精品1024| 高清在线不卡av| 国产成人a级片| 国产成人精品亚洲777人妖 | 欧美乱熟臀69xxxxxx| 色天天综合色天天久久| 色一区在线观看| 色婷婷av一区二区三区gif| 91久久精品国产91性色tv| 99视频精品全部免费在线| 94-欧美-setu| 欧美特级限制片免费在线观看| 欧美性高清videossexo| 欧美精品在线一区二区三区| 欧美哺乳videos| 国产精品午夜春色av| 又紧又大又爽精品一区二区| 午夜精品福利在线| 久久99精品一区二区三区三区| 国产凹凸在线观看一区二区| 99久久99精品久久久久久| 欧美中文字幕亚洲一区二区va在线 | 色999日韩国产欧美一区二区| 欧美在线免费观看亚洲| 日韩一区二区免费在线观看| 久久综合久久综合久久综合| 国产拍欧美日韩视频二区| 亚洲永久免费av| 久久精品国产99国产| av动漫一区二区| 欧美理论电影在线| 国产精品视频免费看| 午夜影院在线观看欧美| 国产在线精品一区二区三区不卡| a级高清视频欧美日韩| 欧美久久久久久久久久| 国产免费成人在线视频| 亚洲国产精品久久久久婷婷884| 精品一区免费av| 在线影院国内精品| 久久免费午夜影院| 蜜桃视频一区二区三区| 色婷婷精品久久二区二区蜜臂av | 国产精品久久777777| 蜜桃av一区二区| 在线免费不卡电影| 国产欧美日韩另类视频免费观看 | 亚洲欧美日韩国产一区二区三区| 激情综合五月婷婷| 91精品国产色综合久久不卡蜜臀| 亚洲欧美另类小说| 不卡一区中文字幕| 国产日韩在线不卡| 国产精品白丝jk黑袜喷水| 欧美一区二区三区在线电影| 亚洲福利一区二区三区| 色婷婷亚洲精品| 亚洲欧美区自拍先锋| 波多野结衣亚洲一区| 国产日产欧美一区二区视频| 国产自产视频一区二区三区| 精品美女在线观看| 麻豆免费精品视频| 精品国一区二区三区| 另类小说色综合网站| 日韩欧美第一区| 另类欧美日韩国产在线| 2欧美一区二区三区在线观看视频| 久久国产精品第一页| 日韩欧美一级二级| 精品在线一区二区三区| 久久久一区二区三区| 国产一区二区成人久久免费影院| 日韩美一区二区三区| 狠狠狠色丁香婷婷综合激情 | 日韩一区二区精品在线观看| 麻豆成人综合网| 久久午夜色播影院免费高清| 久久69国产一区二区蜜臀| 亚洲精品在线一区二区| 高清国产一区二区| 亚洲嫩草精品久久| 欧美日韩视频不卡| 蜜桃av噜噜一区二区三区小说| 精品国产免费久久| 成人黄色av电影| 亚洲一区二区成人在线观看| 欧美一级一级性生活免费录像| 激情五月播播久久久精品| 国产精品私人影院| 欧美三区免费完整视频在线观看| 老司机免费视频一区二区| 青青青爽久久午夜综合久久午夜| 日韩一级片在线观看| 粗大黑人巨茎大战欧美成人| 亚洲欧洲日本在线| 欧美日韩一级黄| 夜夜精品视频一区二区| 丰满放荡岳乱妇91ww| 精品成人私密视频| 成人性色生活片免费看爆迷你毛片| 亚洲国产精品综合小说图片区| 国产精品伦一区| 久久蜜桃av一区精品变态类天堂 | 亚洲二区在线观看| 亚洲特级片在线| 国产色一区二区| 欧美顶级少妇做爰| 成人爱爱电影网址| 精品一区二区三区不卡 | 欧美日韩一区二区在线观看| 国产精品911| 日韩精品色哟哟| 亚洲一区二区在线免费观看视频| 久久久久久久久久美女| 欧美一级生活片| 91精品福利视频| 成人黄色软件下载| 国产成人综合亚洲网站| 激情图区综合网| 美美哒免费高清在线观看视频一区二区| 亚洲欧美成aⅴ人在线观看| 久久精品一区八戒影视| 精品久久国产老人久久综合| 欧美日韩一卡二卡| 欧美午夜宅男影院| 色一情一伦一子一伦一区| 99视频精品在线| 97精品久久久午夜一区二区三区| 成人性生交大片| 99精品欧美一区二区三区小说 | 看国产成人h片视频| 久久精品99国产精品| 精品一区二区精品| 国产91高潮流白浆在线麻豆| 国产精品一区二区在线看| 国产精品中文字幕日韩精品 | 国产一区二三区好的| 国产精品亚洲第一| 夫妻av一区二区| 色网站国产精品| 在线一区二区视频| 日韩一区二区三区观看| 国产精品久久综合| 午夜精品福利在线| 久久精品国产澳门| 色综合网站在线| 日韩欧美一区二区免费| 中文字幕日韩一区| 久久99精品视频| 一本大道久久a久久综合婷婷 | 欧美唯美清纯偷拍| 久久亚洲捆绑美女| 洋洋av久久久久久久一区| 久久99久久99| 欧美日韩美女一区二区| 国产亚洲精品超碰| 午夜精品123| av激情综合网| 久久综合999| 丝袜a∨在线一区二区三区不卡| 盗摄精品av一区二区三区| 678五月天丁香亚洲综合网| 国产精品嫩草久久久久| 日本不卡在线视频| 色一情一乱一乱一91av| 国产精品天天摸av网| 精品一区二区三区免费| 这里只有精品99re| 亚洲图片一区二区| 一本大道久久a久久综合| 国产精品网站一区| 国产精品一品二品| 日韩欧美中文字幕一区| 日精品一区二区| 欧美日韩精品一二三区| 亚洲一区二区在线免费观看视频| 99在线精品观看| 自拍偷拍亚洲综合| 成人午夜伦理影院| 久久久久成人黄色影片| 蜜桃免费网站一区二区三区| 日韩一级视频免费观看在线| 日本成人中文字幕| 精品久久久久久久久久久久久久久| 奇米影视在线99精品| 精品久久久久一区|