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

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

?? ldecod.c

?? TML的參考源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
***********************************************************************
* COPYRIGHT AND WARRANTY INFORMATION
*
* Copyright 2001, International Telecommunications Union, Geneva
*
* DISCLAIMER OF WARRANTY
*
* These software programs are available to the user without any
* license fee or royalty on an "as is" basis. The ITU disclaims
* any and all warranties, whether express, implied, or
* statutory, including any implied warranties of merchantability
* or of fitness for a particular purpose.  In no event shall the
* contributor or the ITU be liable for any incidental, punitive, or
* consequential damages of any kind whatsoever arising from the
* use of these programs.
*
* This disclaimer of warranty extends to the user of these programs
* and user's customers, employees, agents, transferees, successors,
* and assigns.
*
* The ITU does not represent or warrant that the programs furnished
* hereunder are free of infringement of any third-party patents.
* Commercial implementations of ITU-T Recommendations, including
* shareware, may be subject to royalty fees to patent holders.
* Information regarding the ITU-T patent policy is available from
* the ITU Web site at http://www.itu.int.
*
* THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE ITU-T PATENT POLICY.
************************************************************************
*/

/*!
 ***********************************************************************
 *  \mainpage
 *     This is the H.26L decoder reference software. For detailed documentation
 *     see the comments in each file.
 *
 *  \author
 *     The main contributors are listed in contributors.h
 *
 *  \version
 *     JM 1.0
 *
 *  \note
 *     tags are used for document system "doxygen"
 *     available at http://www.doxygen.org
 *
 *  \par Limitations:
 *     Using different NAL's the assignment of partition-id to containing
 *     syntax elements may got lost, if this information is not transmitted.
 *     The same has to be stated for the partitionlength if partitions are
 *     merged by the NAL.
 *  \par
 *     The presented solution in Q15-K-16 solves both of this problems as the
 *     departitioner parses the bitstream before decoding. Due to syntax element
 *     dependencies both, partition bounds and partitionlength information can
 *     be parsed by the departitioner.
 *
 *  \par Handling partition information in external file:
 *     As the TML is still a work in progress, it makes sense to handle this
 *     information for simplification in an external file, here called partition
 *     information file, which can be found by the extension .dp extending the
 *     original encoded H.26L bitstream. In this file partition-ids followed by its
 *     partitionlength is written. Instead of parsing the bitstream we get the
 *     partition information now out of this file.
 *     This information is assumed to be never sent over transmission channels
 *     (simulation scenarios) as it's information we allways get using a
 *     "real" departitioner before decoding
 *
 *  \par Extension of Interim File Format:
 *     Therefore a convention has to be made within the interim file format.
 *     The underlying NAL has to take care of fulfilling these conventions.
 *     All partitions have to be bytealigned to be readable by the decoder,
 *     So if the NAL-encoder merges partitions, >>this is only possible to use the
 *     VLC structure of the H.26L bitstream<<, this bitaligned structure has to be
 *     broken up by the NAL-decoder. In this case the NAL-decoder is responsable to
 *     read the partitionlength information from the partition information file.
 *     Partitionlosses are signaled with a partition of zero length containing no
 *     syntax elements.
 *
 */
/*!
 *  \file
 *     ldecod.c
 *  \brief
 *     TML decoder project main()
 *  \author
 *     Main contributors (see contributors.h for copyright, address and affiliation details)
 *     - Inge Lille-Lang鴜       <inge.lille-langoy@telenor.com>
 *     - Rickard Sjoberg         <rickard.sjoberg@era.ericsson.se>
 *     - Stephan Wenger          <stewe@cs.tu-berlin.de>
 *     - Jani Lainema            <jani.lainema@nokia.com>
 *     - Sebastian Purreiter     <sebastian.purreiter@mch.siemens.de>
 *     - Byeong-Moon Jeon        <jeonbm@lge.com>
 *     - Gabi Blaettermann       <blaetter@hhi.de>
 *     - Ye-Kui Wang                <wangy@cs.tut.fi>
 *
 ***********************************************************************
 */

#include "contributors.h"

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/timeb.h>

#if defined WIN32
  #include <conio.h>
#endif

#include "global.h"
#include "elements.h"
#include "bitsbuf.h"
#include "rtp.h"
#include "memalloc.h"
#include "mbuffer.h"
#include "leaky_bucket.h"

#if _ERROR_CONCEALMENT_
#include "erc_api.h"
#endif

#define TML         "1"
#define VERSION     "1.00"
#define LOGFILE     "log.dec"
#define DATADECFILE "data.dec"
#define TRACEFILE   "trace_dec.txt"

#if _ERROR_CONCEALMENT_
extern objectBuffer_t *erc_object_list;
extern ercVariables_t *erc_errorVar;
#endif


/*!
 ***********************************************************************
 * \brief
 *    main function for TML decoder
 ***********************************************************************
 */
int main(int argc, char **argv)
{
  struct inp_par    *inp;         // input parameters from input configuration file
  struct snr_par    *snr;         // statistics
  struct img_par    *img;         // image parameters

    // allocate memory for the structures
  if ((inp =  (struct inp_par *)calloc(1, sizeof(struct inp_par)))==NULL) no_mem_exit("main: inp");
  if ((snr =  (struct snr_par *)calloc(1, sizeof(struct snr_par)))==NULL) no_mem_exit("main: snr");
  if ((img =  (struct img_par *)calloc(1, sizeof(struct img_par)))==NULL) no_mem_exit("main: img");

  // Read Configuration File
  if (argc != 2)
  {
    snprintf(errortext, ET_SIZE, "Usage: %s <config.dat> \n\t<config.dat> defines decoder parameters",argv[0]);
    error(errortext, 300);
  }

  // Initializes Configuration Parameters with configuration file
  init_conf(inp, argv[1]);

  if (inp->of_mode == PAR_OF_RTP)
  {
    extern FILE *bits;
    // Read the first RTP packet conmtaining a header packet, and set the initial parameter set
    RTPSequenceHeader (img, inp, bits);
  }
// printf ("In main: some pictrue information: %d x %d, with %d reference frames %d\n", img->height, img->width, img->buf_cycle, inp->buf_cycle);

  img->UseConstrainedIntraPred = inp->UseConstrainedIntraPred;

  // Allocate Slice data struct
  malloc_slice(inp,img);

  init(img);
  img->number=0;
  img->type = INTRA_IMG;
  img->tr_old = -1; // WYK: Oct. 8, 2001, for detection of a new frame
  img->refPicID = -1; // WYK: for detection of a new non-B frame

  img->mmco_buffer=NULL;

  // B pictures
  Bframe_ctr=0;

  // time for total decoding session
  tot_time = 0;
  while (decode_one_frame(img, inp, snr) != EOS);

  // B PICTURE : save the last P picture
  write_prev_Pframe(img, p_out);

  report(inp, img, snr);

  free_slice(inp,img);

  free_frame_buffers(inp, img);
  free_global_buffers(inp, img);

  CloseBitstreamFile();

  fclose(p_out);
  fclose(p_ref);
#if TRACE
  fclose(p_trace);
#endif

#if _ERROR_CONCEALMENT_
  ercClose(erc_errorVar);
#endif

  free (inp);
  free (snr);
  free (img);

  return 0;
}


/*!
 ***********************************************************************
 * \brief
 *    Initilize some arrays
 ***********************************************************************
 */
void init(struct img_par *img)  //!< image parameters
{
  int i;

  // initilize quad matrix used in snr routine
  for (i=0; i <  256; i++)
  {
    img->quad[i]=i*i; // fix from TML 1, truncation removed
  }
}

/*!
 ************************************************************************
 * \brief
 *    Read input from configuration file
 *
 * \par Input:
 *    Name of configuration filename
 *
 * \par Output
 *    none
 ************************************************************************
 */
void init_conf(struct inp_par *inp,
               char *config_filename)
{
  FILE *fd;
  int NAL_mode;

  // read the decoder configuration file
  if((fd=fopen(config_filename,"r")) == NULL)
  {
    snprintf(errortext, ET_SIZE, "Error: Control file %s not found\n",config_filename);
    error(errortext, 300);
  }

  fscanf(fd,"%s",inp->infile);                // H.26L compressed input bitsream
  fscanf(fd,"%*[^\n]");

  fscanf(fd,"%s",inp->outfile);               // YUV 4:2:2 input format
  fscanf(fd,"%*[^\n]");

  fscanf(fd,"%s",inp->reffile);               // reference file
  fscanf(fd,"%*[^\n]");

    // Symbol mode
  fscanf(fd,"%d,",&inp->symbol_mode);        // 0: UVLC 1: CABAC, may be overwritten ni case of RTP NAL
  fscanf(fd,"%*[^\n]");
  if (inp->symbol_mode != UVLC && inp->symbol_mode != CABAC)
  {
    snprintf(errortext, ET_SIZE, "Unsupported symbol mode=%d, use UVLC=0 or CABAC=1",inp->symbol_mode);
    error(errortext,1);
  }

  // UseConstrainedIntraPred
  fscanf(fd,"%d,",&inp->UseConstrainedIntraPred);        // 0: UsePred   1: ConstrainPred, may be overwritten in case of RTP NAL
  fscanf(fd,"%*[^\n]");
  if(inp->UseConstrainedIntraPred != 0 && inp->UseConstrainedIntraPred != 1)
  {
    snprintf(errortext, ET_SIZE, "Unsupported value=%d on constrained intra pred",inp->UseConstrainedIntraPred);
    error(errortext,1);
  }

  // Frame buffer size
  fscanf(fd,"%d,",&inp->buf_cycle);   // may be overwritten in case of RTP NAL
  fscanf(fd,"%*[^\n]");
  if (inp->buf_cycle < 1)
  {
    snprintf(errortext, ET_SIZE, "Frame Buffer Size is %d. It has to be at least 1",inp->buf_cycle);
    error(errortext,1);
  }

  fscanf(fd,"%d",&(NAL_mode));                // NAL mode
    fscanf(fd,"%*[^\n]");

  switch(NAL_mode)
  {
  case 0:
    inp->of_mode = PAR_OF_26L;
    // Note: Data Partitioning in 26L File Format not yet supported
    inp->partition_mode = PAR_DP_1;
    break;
  case 1:
    inp->of_mode = PAR_OF_RTP;
    inp->partition_mode = PAR_DP_3;         // DP_3 forces malloc_slcie to reserve memory
                                            // for three partitions.  In the RTP NAL, it can
                                            // be chanegd on a slice basis whether to use
                                            // one or three partitions
    break;
  default:
    snprintf(errortext, ET_SIZE, "NAL mode %i is not supported", NAL_mode);
    error(errortext,400);
  }

#ifdef _LEAKYBUCKET_
  fscanf(fd,"%ld,",&inp->R_decoder);             // Decoder rate
  fscanf(fd, "%*[^\n]");
  fscanf(fd,"%ld,",&inp->B_decoder);             // Decoder buffer size
  fscanf(fd, "%*[^\n]");
  fscanf(fd,"%ld,",&inp->F_decoder);             // Decoder initial delay
  fscanf(fd, "%*[^\n]"); 
  fscanf(fd,"%s",inp->LeakyBucketParamFile);    // file where Leaky Bucket params (computed by encoder) are stored
  fscanf(fd,"%*[^\n]");
#endif
#if TRACE
  if ((p_trace=fopen(TRACEFILE,"w"))==0)             // append new statistic at the end
  {
    snprintf(errortext, ET_SIZE, "Error open file %s!",TRACEFILE);
    error(errortext,500);
  }
#endif


  if (OpenBitstreamFile (inp->infile) < 0)
  {
    snprintf (errortext, ET_SIZE, "Cannot open bitstream file '%s'", inp->infile);
    error(errortext,500);
  }
  if ((p_out=fopen(inp->outfile,"wb"))==0)
  {
    snprintf(errortext, ET_SIZE, "Error open file %s ",inp->outfile);
    error(errortext,500);
  }

  fprintf(stdout,"--------------------------------------------------------------------------\n");
  fprintf(stdout," Decoder config file                    : %s \n",config_filename);
  fprintf(stdout,"--------------------------------------------------------------------------\n");
  fprintf(stdout," Input H.26L bitstream                  : %s \n",inp->infile);
  fprintf(stdout," Output decoded YUV 4:2:0               : %s \n",inp->outfile);
  fprintf(stdout," Output status file                     : %s \n",LOGFILE);
  if ((p_ref=fopen(inp->reffile,"rb"))==0)
  {
    fprintf(stdout," Input reference file                   : %s does not exist \n",inp->reffile);
    fprintf(stdout,"                                          SNR values are not available\n");
  }
  else
    fprintf(stdout," Input reference file                   : %s \n",inp->reffile);
  fprintf(stdout,"--------------------------------------------------------------------------\n");
#ifdef _LEAKYBUCKET_
  fprintf(stdout," Rate_decoder        : %8ld \n",inp->R_decoder);
  fprintf(stdout," B_decoder           : %8ld \n",inp->B_decoder);
  fprintf(stdout," F_decoder           : %8ld \n",inp->F_decoder);
  fprintf(stdout," LeakyBucketParamFile: %s \n",inp->LeakyBucketParamFile); // Leaky Bucket Param file
  calc_buffer(inp);
  fprintf(stdout,"--------------------------------------------------------------------------\n");
#endif
  fprintf(stdout,"Frame    TR    QP  SnrY    SnrU    SnrV   Time(ms)\n");
}

/*!
 ************************************************************************
 * \brief
 *    Reports the gathered information to appropriate outputs
 *
 * \par Input:
 *    struct inp_par *inp,
 *    struct img_par *img,
 *    struct snr_par *stat
 *
 * \par Output:
 *    None
 ************************************************************************
 */
void report(struct inp_par *inp, struct img_par *img, struct snr_par *snr)
{
  #define OUTSTRING_SIZE 255
  char string[OUTSTRING_SIZE];
  FILE *p_log;

#ifndef WIN32
  time_t  now;
  struct tm *l_time;
#else
  char timebuf[128];
#endif

  fprintf(stdout,"-------------------- Average SNR all frames ------------------------------\n");
  fprintf(stdout," SNR Y(dB)           : %5.2f\n",snr->snr_ya);
  fprintf(stdout," SNR U(dB)           : %5.2f\n",snr->snr_ua);
  fprintf(stdout," SNR V(dB)           : %5.2f\n",snr->snr_va);
  fprintf(stdout," Total decoding time : %.3f sec \n",tot_time*0.001);
  fprintf(stdout,"--------------------------------------------------------------------------\n");
  fprintf(stdout," Exit JM %s decoder, ver %s \n",TML,VERSION);

  // write to log file

  snprintf(string, OUTSTRING_SIZE, "%s", LOGFILE);
  if (fopen(string,"r")==0)                    // check if file exist
  {
    if ((p_log=fopen(string,"a"))==0)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情久久五月天| 国产成人免费网站| a4yy欧美一区二区三区| 美国十次综合导航| av资源站一区| 亚洲第一主播视频| 精品福利一二区| 亚洲国产精品一区二区久久| 日本不卡在线视频| 欧美日韩在线综合| 亚洲免费资源在线播放| eeuss鲁一区二区三区| 久久久久国产一区二区三区四区| 天天色天天爱天天射综合| 色狠狠色噜噜噜综合网| 国产精品色哟哟| 国产福利精品导航| 国产人成一区二区三区影院| 亚洲一区av在线| 欧美浪妇xxxx高跟鞋交| 日日夜夜免费精品| 欧美一级夜夜爽| 精品一区二区三区在线视频| 日韩视频免费观看高清完整版| 午夜视频在线观看一区二区 | 欧美日韩免费在线视频| 亚洲成人av电影在线| 在线91免费看| 激情图片小说一区| 亚洲欧美在线高清| 精品视频一区三区九区| 青青青爽久久午夜综合久久午夜| 日韩色在线观看| 99精品视频在线观看免费| 亚洲欧美日韩久久| 欧美一区日韩一区| 丁香激情综合五月| 石原莉奈在线亚洲三区| 久久精品免视看| 欧美视频一区二区三区| 国产jizzjizz一区二区| 天天综合色天天综合| 欧美—级在线免费片| 91.麻豆视频| 色综合天天综合网国产成人综合天| 日欧美一区二区| 精品国产乱码久久久久久老虎| 不卡的电视剧免费网站有什么| 日韩电影免费在线| 亚洲黄色录像片| 成人欧美一区二区三区视频网页| 欧美在线免费观看亚洲| 国产一区二区精品久久| 日韩不卡一二三区| 午夜精品视频一区| 一区二区三区四区激情| 国产精品色哟哟| 国产三区在线成人av| 精品免费一区二区三区| 91免费视频大全| 99久久精品免费看| 成人av免费在线播放| av在线播放不卡| 99久久99久久久精品齐齐| 成人av网站在线| 日本乱人伦aⅴ精品| 在线精品视频小说1| 国产.精品.日韩.另类.中文.在线.播放| 国产欧美一区视频| 国产精品国产三级国产有无不卡| 欧美性videosxxxxx| 欧美三级欧美一级| 91福利在线播放| 成人免费高清在线观看| 一区二区三区精品视频在线| 日韩一区二区三区视频在线| 国产一区二区不卡老阿姨| 看电视剧不卡顿的网站| 亚洲伊人色欲综合网| jiyouzz国产精品久久| 亚洲国产精品久久久久秋霞影院 | 精品亚洲porn| 波多野结衣中文字幕一区二区三区 | 国产精品天天看| 26uuuu精品一区二区| 欧美性高清videossexo| 国产女人aaa级久久久级| 欧美精品一区二区三区四区| 久久你懂得1024| 国产欧美精品日韩区二区麻豆天美| 亚洲乱码精品一二三四区日韩在线| 精品播放一区二区| 一区二区三区成人| 高清视频一区二区| 色乱码一区二区三区88| 欧美成人福利视频| 亚洲色图欧洲色图婷婷| 激情综合色播激情啊| 国产亚洲欧美色| 轻轻草成人在线| 精品欧美一区二区三区精品久久| 亚洲福利一区二区| 欧美三级日韩在线| 亚洲成人在线免费| 欧美日韩高清一区二区不卡| 日韩国产在线观看一区| 欧美三级一区二区| 亚洲国产日韩一级| 精品精品国产高清a毛片牛牛| 午夜精品久久久久久久久久久| 91精品国产一区二区三区蜜臀| 国产一区二区视频在线| 日精品一区二区| 国产亚洲福利社区一区| 欧美精品色一区二区三区| 国v精品久久久网| 久久99深爱久久99精品| 4438亚洲最大| 欧美一级黄色大片| av激情综合网| 午夜影院在线观看欧美| 欧美电影免费观看高清完整版 | 欧美成人午夜电影| 成人av动漫网站| 亚洲二区视频在线| 欧美mv日韩mv国产网站app| 国产一区二区h| 日本不卡123| 国产精品成人网| 91麻豆精品91久久久久久清纯 | 99视频精品全部免费在线| 亚洲国产高清aⅴ视频| 欧美日韩一区小说| 成人综合婷婷国产精品久久免费| 亚洲天堂av一区| 久久婷婷色综合| 555www色欧美视频| av男人天堂一区| 国产精品一线二线三线精华| 亚洲一区二区三区小说| 国产精品五月天| 精品国产免费久久| 欧美午夜免费电影| 成人激情校园春色| 国产福利一区二区三区在线视频| 午夜精品福利久久久| 国产精品无人区| 精品视频免费看| 欧美日韩视频在线第一区| 国产精品夜夜爽| 久久成人久久爱| 日韩经典一区二区| 日韩理论片中文av| 国产精品毛片久久久久久| 26uuu精品一区二区三区四区在线| 欧美日韩亚洲综合一区| 99re成人精品视频| 不卡电影一区二区三区| 国产aⅴ精品一区二区三区色成熟| 蜜桃av一区二区| 日本 国产 欧美色综合| 奇米影视一区二区三区| 亚洲精品中文字幕乱码三区| 亚洲一区二区三区在线播放| 五月婷婷激情综合网| 毛片av一区二区| 久久电影网电视剧免费观看| 麻豆一区二区三| 丁香激情综合五月| 色中色一区二区| 欧美videofree性高清杂交| 精品福利二区三区| 中文成人综合网| 国产精品萝li| 免费日本视频一区| av色综合久久天堂av综合| 在线免费观看不卡av| 欧美一区二区网站| 国产日本一区二区| 亚洲免费观看高清完整| 蜜臀av一区二区在线观看| 成人av在线资源网站| 7777女厕盗摄久久久| 国产日产亚洲精品系列| 一区二区三区国产精华| 国产成人无遮挡在线视频| 色悠久久久久综合欧美99| 日韩欧美在线观看一区二区三区| 一区精品在线播放| 韩国女主播成人在线观看| 欧美视频一区二区在线观看| 欧美高清在线精品一区| 韩国三级在线一区| 91麻豆精品国产91久久久久| 亚洲欧洲av一区二区三区久久| 日韩毛片视频在线看| 成人午夜电影网站| 久久色视频免费观看| 久久国产乱子精品免费女| 日韩午夜精品视频|