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

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

?? sei.c

?? 一個(gè)簡(jiǎn)單的視頻會(huì)議VC++MFC工程文件
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
  else
    fp = fopen( map_file_name, "ab" );
  get_mem2D(&y, img->height, img->width);
#endif
  get_mem2D(&map_sp, img->height/16, img->width/16);

  if (fb->picbuf_short[2]->used!=0) possible_spare_pic_num = 2;
  else possible_spare_pic_num = 1;
  // loop over the spare pictures
  for (m=0; m<possible_spare_pic_num; m++)
  {
    // clear the temporal bitstream buffer
    tmpBitstream->bits_to_go  = 8;
    tmpBitstream->byte_pos    = 0;
    tmpBitstream->byte_buf    = 0;
    memset( tmpBitstream->streamBuffer, 0, MAXRTPPAYLOADLEN);

    // set delta_spare_frame_num
    // the order of the following lines cannot be changed.
    if (m==0)
      CandidateSpareFrameNum = seiSparePicturePayload.target_frame_num - 1; // TargetFrameNum - 1;
    else
      CandidateSpareFrameNum = SpareFrameNum - 1;
    if ( CandidateSpareFrameNum < 0 ) CandidateSpareFrameNum = MAX_FN - 1;
    SpareFrameNum = fb->picbuf_short[m+1]->frame_num_256;
    delta_spare_frame_num = CandidateSpareFrameNum - SpareFrameNum;
    assert( delta_spare_frame_num == 0 );

    // calculate the spare macroblock map of one spare picture
    // the results are stored into map_sp[][]
    for (i=0; i < img->height/16; i++)
      for (j=0; j < img->width/16; j++)
      {
        tmp = 0;
        for (i0=0; i0<16; i0++)
          for (j0=0; j0<16; j0++)
            tmp+=abs(fb->picbuf_short[m+1]->Refbuf11[(i*16+i0)*img->width+j*16+j0]-
                       fb->picbuf_short[0]->Refbuf11[(i*16+i0)*img->width+j*16+j0]);
        tmp = (tmp<=threshold1? 255 : 0);
        map_sp[i][j] = (tmp==0? 1 : 0);
#ifdef WRITE_MAP_IMAGE
//        if (m==0)
        {
        for (i0=0; i0<16; i0++)
          for (j0=0; j0<16; j0++)
            y[i*16+i0][j*16+j0]=tmp;
        }
#endif
      }

    // based on map_sp[][], compose the spare picture information
    // and write the spare picture information to a temp bitstream
    tmp = 0;
    for (i=0; i < img->height/16; i++)
      for (j=0; j < img->width/16; j++)
        if (map_sp[i][j]==0) tmp++;
    if ( tmp > threshold2 )
      ref_area_indicator = 0;
    else if ( !CompressSpareMBMap(map_sp, tmpBitstream) )
      ref_area_indicator = 1;
    else
      ref_area_indicator = 2;

//    printf( "ref_area_indicator = %d\n", ref_area_indicator );

#ifdef WRITE_MAP_IMAGE
    // write the map to a file
//    if (m==0)
    {
      // write the map image
      for (i=0; i < img->height; i++)
        for (j=0; j < img->width; j++)
        {
          if ( ref_area_indicator == 0 ) fputc(255, fp);
          else fputc(y[i][j], fp);
        }

      for (k=0; k < 2; k++)
        for (i=0; i < img->height/2; i++)
          for (j=0; j < img->width/2; j++)
            fputc(128, fp);
    }
#endif

    // Finnally, write the current spare picture information to 
    // the global variable: seiSparePicturePayload
    ComposeSparePictureMessage(delta_spare_frame_num, ref_area_indicator, tmpBitstream);
    seiSparePicturePayload.num_spare_pics++;
  }  // END for (m=0; m<2; m++)

  free_mem2D( map_sp );
  free( tmpBitstream->streamBuffer );
  free( tmpBitstream );

#ifdef WRITE_MAP_IMAGE
  free_mem2D( y );
  fclose( fp );
#undef WRITE_MAP_IMAGE
#endif
  */
}

/*!
 ************************************************************************
 *  \brief
 *      compose the spare picture information.
 *  \param delta_spare_frame_num
 *      see FCD
 *  \param ref_area_indicator
 *      Indicate how to represent the spare mb map
 *  \param tmpBitstream
 *      pointer to a buffer to save the payload
 *  \par Output
 *      bitstream: the composed spare picture payload are 
 *        ready to put into the sei_message. 
 ************************************************************************
 */
void ComposeSparePictureMessage(int delta_spare_frame_num, int ref_area_indicator, Bitstream *tmpBitstream)
{
  Bitstream *bitstream = seiSparePicturePayload.data;
  SyntaxElement sym;

  sym.type = SE_HEADER;
  sym.mapping = ue_linfo;

  sym.value1 = delta_spare_frame_num;
  writeSyntaxElement2Buf_UVLC(&sym, bitstream);
  sym.value1 = ref_area_indicator;
  writeSyntaxElement2Buf_UVLC(&sym, bitstream);

  AppendTmpbits2Buf( bitstream, tmpBitstream );
}

/*!
 ************************************************************************
 *  \brief
 *      test if the compressed spare mb map will occupy less mem and
 *      fill the payload buffer.
 *  \param map_sp
 *      in which the spare picture information are stored.
 *  \param bitstream
 *      pointer to a buffer to save the payload
 *  \return
 *      TRUE: If it is compressed version, \n
 *             FALSE: If it is not compressed.
 ************************************************************************
 */
Boolean CompressSpareMBMap(unsigned char **map_sp, Bitstream *bitstream)
{
  int j, k;
  int noc, bit0, bit1, bitc;
  SyntaxElement sym;
  int x, y, left, right, bottom, top, directx, directy;

  // this is the size of the uncompressed mb map:
  int size_uncompressed = (img->height/16) * (img->width/16);
  int size_compressed   = 0;
  Boolean ret;

  // initialization
  sym.type = SE_HEADER;
  sym.mapping = ue_linfo;
  noc = 0;
  bit0 = 0;
  bit1 = 1;
  bitc = bit0;

  // compress the map, the result goes to the temporal bitstream buffer
  x = ( img->width/16 - 1 ) / 2;
  y = ( img->height/16 - 1 ) / 2;
  left = right = x;
  top = bottom = y;
  directx = 0;
  directy = 1;
  for (j=0; j<img->height/16; j++)
    for (k=0; k<img->width/16; k++)
    {
      // check current mb
      if ( map_sp[y][x] == bitc ) noc++;
      else
      {
        sym.value1 = noc;
        size_compressed += writeSyntaxElement2Buf_UVLC(&sym, bitstream);    // the return value indicate the num of bits written
        noc=0;
      }
      // go to the next mb:
      if ( directx == -1 && directy == 0 )
      {
        if (x > left) x--;
        else if (x == 0)
        {
          y = bottom + 1;
          bottom++;
          directx = 1;
          directy = 0;
        }
        else if (x == left)
        {
          x--;
          left--;
          directx = 0;
          directy = 1;
        }
      }
      else if ( directx == 1 && directy == 0 )
      {
        if (x < right) x++;
        else if (x == img->width/16 - 1)
        {
          y = top - 1;
          top--;
          directx = -1;
          directy = 0;
        }
        else if (x == right)
        {
          x++;
          right++;
          directx = 0;
          directy = -1;
        }
      }
      else if ( directx == 0 && directy == -1 )
      {
        if ( y > top) y--;
        else if (y == 0)
        {
          x = left - 1;
          left--;
          directx = 0;
          directy = 1;
        }
        else if (y == top)
        {
          y--;
          top--;
          directx = -1;
          directy = 0;
        }
      }
      else if ( directx == 0 && directy == 1 )
      {
        if (y < bottom) y++;
        else if (y == img->height/16 - 1)
        {
          x = right+1;
          right++;
          directx = 0;
          directy = -1;
        }
        else if (y == bottom)
        {
          y++;
          bottom++;
          directx = 1;
          directy = 0;
        }
      }
    }
  if (noc!=0)
  {
    sym.value1 = noc;
    size_compressed += writeSyntaxElement2Buf_UVLC(&sym, bitstream);
  }

  ret = (size_compressed<size_uncompressed? TRUE : FALSE);
  if ( !ret ) // overwrite the streambuffer with the original mb map
  {
    // write the mb map to payload bit by bit
    bitstream->byte_buf = 0;
    bitstream->bits_to_go = 8;
    bitstream->byte_pos = 0;
    for (j=0; j<img->height/16; j++)
    {
      for (k=0; k<img->width/16; k++)
      {
        bitstream->byte_buf <<= 1;
        if (map_sp[j][k]) bitstream->byte_buf |= 1;
        bitstream->bits_to_go--;
        if (bitstream->bits_to_go==0)
        {
          bitstream->bits_to_go = 8;
          bitstream->streamBuffer[bitstream->byte_pos++]=bitstream->byte_buf;
          bitstream->byte_buf = 0;
        }
      }
    }
  }

  return ret;
}

/*!
 ************************************************************************
 *  \brief
 *      Finalize the spare picture SEI payload.
 *        The spare picture paylaod will be ready for encapsulation, and it
 *        should be called before current picture packetized.
 *  \par Input
 *      seiSparePicturePayload.data: points to the payload starting from
 *        delta_spare_frame_num. (See FCD)
 *  \par Output
 *      seiSparePicturePayload.data is updated, pointing to the whole spare
 *        picture information: spare_picture( PayloadSize ) (See FCD)
 *        Make sure it is byte aligned.
 ************************************************************************
 */
void FinalizeSpareMBMap()
{
  int CurrFrameNum = img->number % MAX_FN;
  int delta_frame_num;
  SyntaxElement sym;
  Bitstream *dest, *source;

  sym.type = SE_HEADER;
  sym.mapping = ue_linfo;

  source = seiSparePicturePayload.data;
  dest = malloc(sizeof(Bitstream));
  if ( dest == NULL ) no_mem_exit("FinalizeSpareMBMap: dest");
  dest->streamBuffer = malloc(MAXRTPPAYLOADLEN);
  if ( dest->streamBuffer == NULL ) no_mem_exit("FinalizeSpareMBMap: dest->streamBuffer");
  dest->bits_to_go  = 8;
  dest->byte_pos    = 0;
  dest->byte_buf    = 0;
  memset( dest->streamBuffer, 0, MAXRTPPAYLOADLEN);

  //    delta_frame_num
  delta_frame_num = CurrFrameNum - seiSparePicturePayload.target_frame_num;
  if ( delta_frame_num < 0 ) delta_frame_num += MAX_FN;
  sym.value1 = delta_frame_num;
  writeSyntaxElement2Buf_UVLC(&sym, dest);

  // num_spare_pics_minus1
  sym.value1 = seiSparePicturePayload.num_spare_pics - 1;
  writeSyntaxElement2Buf_UVLC(&sym, dest);

  // copy the other bits
  AppendTmpbits2Buf( dest, source);

  // make sure the payload is byte aligned, stuff bits are 10..0
  if ( dest->bits_to_go != 8 )
  {
    (dest->byte_buf) <<= 1;
    dest->byte_buf |= 1;
    dest->bits_to_go--;
    if ( dest->bits_to_go != 0 ) (dest->byte_buf) <<= (dest->bits_to_go);
    dest->bits_to_go = 8;
    dest->streamBuffer[dest->byte_pos++]=dest->byte_buf;
    dest->byte_buf = 0;
  }
  seiSparePicturePayload.payloadSize = dest->byte_pos;

  // the payload is ready now
  seiSparePicturePayload.data = dest;
  free( source->streamBuffer );
  free( source );
}

/*
 **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 *  \functions on subseq information sei messages
 *  \brief
 *      JVT-D098
 *  \author
 *      Dong Tian                 <tian@cs.tut.fi>
 **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 */

Boolean seiHasSubseqInfo = FALSE;
subseq_information_struct seiSubseqInfo[MAX_LAYER_NUMBER];

/*!
 ************************************************************************
 *  \brief
 *      init subseqence info
 ************************************************************************
 */
void InitSubseqInfo(int currLayer)
{
  static unsigned short id = 0;

  seiHasSubseqInfo = TRUE;
  seiSubseqInfo[currLayer].subseq_layer_num = currLayer;
  seiSubseqInfo[currLayer].subseq_id = id++;
  seiSubseqInfo[currLayer].last_picture_flag = 0;
  seiSubseqInfo[currLayer].stored_frame_cnt = -1;
  seiSubseqInfo[currLayer].payloadSize = 0;

  seiSubseqInfo[currLayer].data = malloc( sizeof(Bitstream) );
  if ( seiSubseqInfo[currLayer].data == NULL ) no_mem_exit("InitSubseqInfo: seiSubseqInfo[currLayer].data");
  seiSubseqInfo[currLayer].data->streamBuffer = malloc( MAXRTPPAYLOADLEN );
  if ( seiSubseqInfo[currLayer].data->streamBuffer == NULL ) no_mem_exit("InitSubseqInfo: seiSubseqInfo[currLayer].data->streamBuffer");
  seiSubseqInfo[currLayer].data->bits_to_go  = 8;
  seiSubseqInfo[currLayer].data->byte_pos    = 0;
  seiSubseqInfo[currLayer].data->byte_buf    = 0;
  memset( seiSubseqInfo[currLayer].data->streamBuffer, 0, MAXRTPPAYLOADLEN );
}

/*!
 ************************************************************************
 *  \brief
 *      update subseqence info
 ************************************************************************
 */
void UpdateSubseqInfo(int currLayer)
{
  if (img->type != B_SLICE)
  {
    seiSubseqInfo[currLayer].stored_frame_cnt ++;
    seiSubseqInfo[currLayer].stored_frame_cnt = seiSubseqInfo[currLayer].stored_frame_cnt % MAX_FN;
  }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕亚洲不卡| 一本大道久久a久久综合婷婷| 欧美三级乱人伦电影| 国产精品久久久久四虎| 国产毛片精品国产一区二区三区| 欧美日产国产精品| 一区二区三区美女视频| 波多野结衣亚洲| 亚洲欧洲另类国产综合| 成人a区在线观看| 国产精品二区一区二区aⅴ污介绍| 国产原创一区二区三区| 久久久精品免费网站| 狠狠色综合播放一区二区| 精品国产人成亚洲区| 国产一区二区三区四区五区入口| 久久精品夜色噜噜亚洲a∨| 成人污污视频在线观看| 国产精品美女久久久久久2018| 成人ar影院免费观看视频| 一区二区三区四区在线播放| 欧美影视一区在线| 精一区二区三区| 国产精品美女久久久久久久久久久 | 色婷婷av一区二区三区大白胸| 亚洲午夜影视影院在线观看| 日韩一本二本av| 成人动漫一区二区在线| 视频一区二区不卡| 欧美国产日本韩| 日韩一区二区三区高清免费看看| 国产一区二区三区| 午夜伊人狠狠久久| 中文字幕免费不卡| 日韩精品一区二区三区在线观看| 国产69精品一区二区亚洲孕妇| 丝袜美腿亚洲综合| 亚洲精选视频免费看| 久久久久久久久久久99999| 精品视频在线免费观看| 9人人澡人人爽人人精品| 九九精品视频在线看| 亚洲综合区在线| 欧美日韩国产另类不卡| 狠狠色丁香婷婷综合久久片| 日韩精品电影一区亚洲| 国产精品乱人伦| 欧美日本国产一区| 在线视频一区二区三区| 午夜伦理一区二区| 一区二区欧美视频| 国产精品三级av在线播放| 欧美日韩成人激情| 91免费版在线| 色综合久久99| 色老汉一区二区三区| 成人ar影院免费观看视频| 国产一区二区在线看| 久久精品国产亚洲a| 亚洲成人av一区二区三区| 亚洲午夜久久久久久久久久久| 亚洲欧洲成人精品av97| 中文字幕欧美激情| 国产精品视频观看| 成人免费在线播放视频| 中文字幕av一区二区三区高| 久久精品这里都是精品| 日韩欧美在线观看一区二区三区| 7777精品伊人久久久大香线蕉最新版| 欧美日韩在线播| 欧美日本高清视频在线观看| 91麻豆精品国产91久久久久久久久| 色综合视频在线观看| 91在线视频18| 91麻豆精品国产91久久久使用方法| 欧美久久久久久蜜桃| 精品久久久网站| 欧美激情一区在线观看| 亚洲综合色区另类av| 婷婷亚洲久悠悠色悠在线播放| 日韩国产高清在线| 国产精品一区二区在线观看网站| 成人va在线观看| 91精品欧美综合在线观看最新| 精品国产凹凸成av人导航| 2021久久国产精品不只是精品 | 亚洲黄色小视频| 蜜桃久久久久久| 91视频你懂的| 欧美日韩视频不卡| 国产精品久久久久久久久快鸭 | 精品视频一区三区九区| 欧美日韩一区小说| 国产视频一区在线播放| 天涯成人国产亚洲精品一区av| 99久久免费视频.com| 91精品国模一区二区三区| 国产色综合久久| 另类小说色综合网站| 在线观看欧美日本| 日韩午夜三级在线| 亚洲精品成人a在线观看| 美女免费视频一区二区| 欧美日韩黄色一区二区| 亚洲人快播电影网| 99vv1com这只有精品| 自拍偷拍欧美激情| 国产精品一区在线观看乱码| 精品91自产拍在线观看一区| 美女mm1313爽爽久久久蜜臀| 日韩一区二区三区精品视频| 日本视频一区二区| 精品日本一线二线三线不卡| 国产一区欧美日韩| 久久久久久久久伊人| www.色精品| 尤物视频一区二区| 制服视频三区第一页精品| 亚洲女性喷水在线观看一区| 欧美日韩国产精品成人| 日本美女视频一区二区| eeuss影院一区二区三区| 国产精品久久久久久妇女6080 | 欧美日韩美少妇| jlzzjlzz亚洲女人18| 国产精品99久久久久久久女警| 日韩精品国产欧美| 亚洲国产精品天堂| 综合久久久久久久| 久久久久久久久久久电影| 亚洲福利视频一区| 午夜精品久久久久久| 日韩精品电影在线| 日韩精品一二区| 国内成人自拍视频| 成人美女视频在线看| 99久久精品免费看| 欧美日韩亚洲综合一区二区三区| 欧美日韩国产一区| 精品久久久久久久久久久院品网 | 国产精品传媒视频| 综合婷婷亚洲小说| 一区二区三区在线看| 亚洲天天做日日做天天谢日日欢| 一区二区三区四区在线免费观看| 一区二区欧美精品| 亚洲v精品v日韩v欧美v专区| 久久精品999| 国产麻豆精品一区二区| 99久久国产免费看| 制服丝袜中文字幕亚洲| 精品播放一区二区| 亚洲激情第一区| 国产一区二区伦理| 欧美在线观看一二区| 日韩久久精品一区| 国产清纯在线一区二区www| 亚洲图片激情小说| 欧美aaaaa成人免费观看视频| 蜜臀av一区二区在线观看| a美女胸又www黄视频久久| 欧美一级精品在线| 亚洲综合视频网| 国内精品国产成人| 3d动漫精品啪啪一区二区竹菊| 亚洲人123区| 粉嫩一区二区三区性色av| 欧美不卡123| 亚洲人xxxx| 成人a免费在线看| 国产午夜精品久久久久久免费视| 三级不卡在线观看| 欧美日韩国产精品成人| 国产精品丝袜一区| 国产麻豆成人传媒免费观看| 欧美日韩高清不卡| 亚洲国产日韩综合久久精品| 色婷婷国产精品| 亚洲免费在线播放| 国产成人精品免费视频网站| 精品理论电影在线| 国产一区二区0| 久久精品夜色噜噜亚洲a∨| 久久精品二区亚洲w码| 日韩欧美国产一区在线观看| 日韩av一区二区三区四区| 久久久综合激的五月天| 91美女片黄在线观看| 亚洲va韩国va欧美va| 国产亚洲综合性久久久影院| 91一区二区在线| 久久国产综合精品| 国产精品乱码一区二三区小蝌蚪| 欧美亚洲另类激情小说| 极品瑜伽女神91| 亚洲国产一区二区视频| 久久久精品免费免费| 91精品在线麻豆| 日本精品视频一区二区三区| 久久精品国产网站|