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

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

?? sei.c

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

/*!
 ************************************************************************
 *  \file
 *     sei.c
 *  \brief
 *     implementation of SEI related functions
 *  \author(s)
 *      - Dong Tian                             <tian@cs.tut.fi>
 *
 ************************************************************************
 */

#include <stdlib.h>
#include <assert.h>
#include <memory.h>
#include "global.h"
#include "memalloc.h"
#include "rtp.h"
#include "mbuffer.h"
#include "sei.h"
#include "vlc.h"

Boolean seiHasTemporal_reference=FALSE;
Boolean seiHasClock_timestamp=FALSE;
Boolean seiHasPanscan_rect=FALSE;
Boolean seiHasBuffering_period=FALSE;
Boolean seiHasHrd_picture=FALSE;
Boolean seiHasFiller_payload=FALSE;
Boolean seiHasUser_data_registered_itu_t_t35=FALSE;
Boolean seiHasUser_data_unregistered=FALSE;
Boolean seiHasRandom_access_point=FALSE;
Boolean seiHasRef_pic_buffer_management_repetition=FALSE;
Boolean seiHasSpare_picture=FALSE;

Boolean seiHasSceneInformation=FALSE; // JVT-D099

Boolean seiHasSubseq_information=FALSE;
Boolean seiHasSubseq_layer_characteristics=FALSE;
Boolean seiHasSubseq_characteristics=FALSE;

/*
 ************************************************************************
 *  \basic functions on supplemental enhancement information
 *  \brief
 *     The implementations are based on FCD
 ************************************************************************
 */

//! sei_message[0]: this struct is to store the sei message packetized independently 
//! sei_message[1]: this struct is to store the sei message packetized together with slice data
sei_struct sei_message[2];

void InitSEIMessages()
{
  int i;
  for (i=0; i<2; i++)
  {
    sei_message[i].data = malloc(MAXRTPPAYLOADLEN);
    assert( sei_message[i].data != NULL );
    sei_message[i].subPacketType = SEI_PACKET_TYPE;
    clear_sei_message(i);
  }

  // init sei messages
  seiSparePicturePayload.data = NULL;
  InitSparePicture();
  InitSubseqChar();
  if (input->NumFramesInELSubSeq != 0)
    InitSubseqLayerInfo();
  InitSceneInformation(); // JVT-D099
  // init panscanrect sei message
  InitPanScanRectInfo();
  // init user_data_unregistered
  InitUser_data_unregistered();
  // init user_data_unregistered
  InitUser_data_registered_itu_t_t35();
  // init user_RandomAccess
  InitRandomAccess();
}

void CloseSEIMessages()
{
  int i;
  
  if (input->NumFramesInELSubSeq != 0)
    CloseSubseqLayerInfo();

  CloseSubseqChar();
  CloseSparePicture();
  CloseSceneInformation(); // JVT-D099
  //Shankar Regunathan Oct 2002
  ClosePanScanRectInfo();
  CloseUser_data_unregistered();
  CloseUser_data_registered_itu_t_t35();
  CloseRandomAccess();

  for (i=0; i<MAX_LAYER_NUMBER; i++)
  {
    if ( sei_message[i].data ) free( sei_message[i].data );
    sei_message[i].data = NULL;
  }
}

Boolean HaveAggregationSEI()
{
  if (sei_message[AGGREGATION_SEI].available && img->type != B_SLICE) 
    return TRUE;
  if (seiHasSubseqInfo)
    return TRUE;
  if (seiHasSubseqLayerInfo && img->number == 0)
    return TRUE;
  if (seiHasSubseqChar)
    return TRUE;
  if (seiHasSceneInformation) // JVT-D099
    return TRUE;
  if (seiHasPanScanRectInfo) // Shankar Regunathan Oct 2002
    return TRUE;
  if (seiHasUser_data_unregistered_info)
    return TRUE;
  if (seiHasUser_data_registered_itu_t_t35_info)
    return TRUE;
  if (seiHasRandomAccess_info)
    return TRUE;
  return FALSE;
//  return input->SparePictureOption && ( seiHasSpare_picture || seiHasSubseq_information || 
//    seiHasSubseq_layer_characteristics || seiHasSubseq_characteristics );
}

/*!
 ************************************************************************
 *  \brief
 *     write one sei payload to the sei message
 *  \param id
 *    0, if this is the normal packet \n
 *    1, if this is a aggregation packet
 *  \param payload
 *    a pointer that point to the sei payload. Note that the bitstream
 *    should have be byte aligned already. 
 *  \param payload_size
 *    the size of the sei payload
 *  \param payload_type
 *    the type of the sei payload
 *  \par Output
 *    the content of the sei message (sei_message[id]) is updated.
 ************************************************************************
 */
void write_sei_message(int id, byte* payload, int payload_size, int payload_type)
{
  int offset, type, size;
  assert(payload_type > SEI_ZERO && payload_type < SEI_MAX_ELEMENTS);

  type = payload_type;
  size = payload_size;
  offset = sei_message[id].payloadSize;

  while ( type > 255 )
  {
    sei_message[id].data[offset++] = 0xFF;
    type = type - 255;
  }
  sei_message[id].data[offset++] = type;

  while ( size > 255 )
  {
    sei_message[id].data[offset++] = 0xFF;
    size = size - 255;
  }
  sei_message[id].data[offset++] = size;

  memcpy(sei_message[id].data + offset, payload, payload_size);
  offset += payload_size;

  sei_message[id].payloadSize = offset;
}

/*!
 ************************************************************************
 *  \brief
 *     write rbsp_trailing_bits to the sei message
 *  \param id
 *    0, if this is the normal packet \n
 *    1, if this is a aggregation packet
 *  \par Output
 *    the content of the sei message is updated and ready for packetisation
 ************************************************************************
 */
void finalize_sei_message(int id)
{
  int offset = sei_message[id].payloadSize;

  sei_message[id].data[offset] = 0x80;
  sei_message[id].payloadSize++;

  sei_message[id].available = TRUE;
}

/*!
 ************************************************************************
 *  \brief
 *     empty the sei message buffer
 *  \param id
 *    0, if this is the normal packet \n
 *    1, if this is a aggregation packet
 *  \par Output
 *    the content of the sei message is cleared and ready for storing new 
 *      messages
 ************************************************************************
 */
void clear_sei_message(int id)
{
  memset( sei_message[id].data, 0, MAXRTPPAYLOADLEN);
  sei_message[id].payloadSize       = 0;
  sei_message[id].available         = FALSE;
}

/*!
 ************************************************************************
 *  \brief
 *     copy the bits from one bitstream buffer to another one
 *  \param dest
 *    pointer to the dest bitstream buffer
 *  \param source
 *    pointer to the source bitstream buffer
 *  \par Output
 *    the content of the dest bitstream is changed.
 ************************************************************************
 */
void AppendTmpbits2Buf( Bitstream* dest, Bitstream* source )
{
  int i, j;
  unsigned char mask;
  int bits_in_last_byte;

  // copy the first bytes in source buffer
  for (i=0; i<source->byte_pos; i++)
  {
    mask = 0x80;
    for (j=0; j<8; j++)
    {
      dest->byte_buf <<= 1;
      if (source->streamBuffer[i] & mask)
        dest->byte_buf |= 1;
      dest->bits_to_go--;
      mask >>= 1;
      if (dest->bits_to_go==0)
      {
        dest->bits_to_go = 8;
        dest->streamBuffer[dest->byte_pos++]=dest->byte_buf;
        dest->byte_buf = 0;
      }
    }
  }
  // copy the last byte, there are still (8-source->bits_to_go) bits in the source buffer
  bits_in_last_byte = 8-source->bits_to_go;
  if ( bits_in_last_byte > 0 )
  {
    mask = 1 << (bits_in_last_byte-1);
    for (j=0; j<bits_in_last_byte; j++)
    {
      dest->byte_buf <<= 1;
      if (source->byte_buf & mask)
        dest->byte_buf |= 1;
      dest->bits_to_go--;
      mask >>= 1;
      if (dest->bits_to_go==0)
      {
        dest->bits_to_go = 8;
        dest->streamBuffer[dest->byte_pos++]=dest->byte_buf;
        dest->byte_buf = 0;
      }
    }
  }
}

/*
 **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 *  \functions on spare pictures
 *  \brief
 *     implementation of Spare Pictures related functions based on 
 *      JVT-D100
 *  \author
 *      Dong Tian                 <tian@cs.tut.fi>
 **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 */

// global variables for spare pictures

// Tian Dong (Sept 2002)
// In current implementation, Sept 2002, the spare picture info is 
// paketized together with the immediately following frame. Thus we 
// define one set of global variables to save the info.
Boolean seiHasSparePicture = FALSE;
spare_picture_struct seiSparePicturePayload;

/*!
 ************************************************************************
 *  \brief
 *      Init the global variables for spare picture information
 ************************************************************************
 */
void InitSparePicture()
{
  if ( seiSparePicturePayload.data != NULL ) CloseSparePicture();

  seiSparePicturePayload.data = malloc( sizeof(Bitstream) );
  assert( seiSparePicturePayload.data != NULL );
  seiSparePicturePayload.data->streamBuffer = malloc(MAXRTPPAYLOADLEN);
  assert( seiSparePicturePayload.data->streamBuffer != NULL );
  memset( seiSparePicturePayload.data->streamBuffer, 0, MAXRTPPAYLOADLEN);
  seiSparePicturePayload.num_spare_pics = 0;
  seiSparePicturePayload.target_frame_num = 0;

  seiSparePicturePayload.data->bits_to_go  = 8;
  seiSparePicturePayload.data->byte_pos    = 0;
  seiSparePicturePayload.data->byte_buf    = 0;
}

/*!
 ************************************************************************
 *  \brief
 *      Close the global variables for spare picture information
 ************************************************************************
 */
void CloseSparePicture()
{
  if (seiSparePicturePayload.data->streamBuffer) 
    free(seiSparePicturePayload.data->streamBuffer);
  seiSparePicturePayload.data->streamBuffer = NULL;
  if (seiSparePicturePayload.data) 
    free(seiSparePicturePayload.data);
  seiSparePicturePayload.data = NULL;
  seiSparePicturePayload.num_spare_pics = 0;
  seiSparePicturePayload.target_frame_num = 0;
}

/*!
 ************************************************************************
 *  \brief
 *     Calculate the spare picture info, save the result in map_sp
 *      then compose the spare picture information.
 *  \par Output
 *      the spare picture payload is available in *seiSparePicturePayload*
 *      the syntax elements in the loop (see FCD), excluding the two elements
 *      at the beginning.
 ************************************************************************
 */
void CalculateSparePicture()
{
  /*
  int i, j, tmp, i0, j0, m;
  byte **map_sp;
  int delta_spare_frame_num;
  Bitstream *tmpBitstream;

  int num_of_mb=(img->height/16) * (img->width/16);
  int threshold1 = 16*16*input->SPDetectionThreshold;
  int threshold2 = num_of_mb * input->SPPercentageThreshold / 100;
  int ref_area_indicator;
  int CandidateSpareFrameNum, SpareFrameNum;
  int possible_spare_pic_num;

  // define it for debug purpose
  #define WRITE_MAP_IMAGE

#ifdef WRITE_MAP_IMAGE
  byte **y;
  int k;
  FILE* fp;
  static int first = 1;
  char map_file_name[255]="map.yuv";
#endif

  // basic check
  if (fb->picbuf_short[0]->used==0 || fb->picbuf_short[1]->used==0)
  { 
#ifdef WRITE_MAP_IMAGE
    fp = fopen( map_file_name, "wb" );
    assert( fp != NULL );
    // write the map image
    for (i=0; i < img->height; i++)
      for (j=0; j < img->width; j++)
        fputc(0, 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);
    fclose( fp );
#endif
    seiHasSparePicture = FALSE;
    return;
  }
  seiHasSparePicture = TRUE;

  // set the global bitstream memory. 
  InitSparePicture();
  seiSparePicturePayload.target_frame_num = img->number % MAX_FN;
  // init the local bitstream memory.
  tmpBitstream = malloc(sizeof(Bitstream));
  assert( tmpBitstream != NULL );
  tmpBitstream->streamBuffer = malloc(MAXRTPPAYLOADLEN);
  assert( tmpBitstream->streamBuffer != NULL );
  memset( tmpBitstream->streamBuffer, 0, MAXRTPPAYLOADLEN);

#ifdef WRITE_MAP_IMAGE
  if ( first )
  {
    fp = fopen( map_file_name, "wb" );
    first = 0;
  }
  else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
风间由美一区二区三区在线观看| 日本成人在线一区| 亚洲第一主播视频| 日本成人在线看| 不卡的av电影在线观看| 91蜜桃视频在线| 欧美高清精品3d| ...av二区三区久久精品| 亚洲一区二区三区四区五区中文| 午夜不卡av在线| www..com久久爱| 日韩视频免费观看高清完整版 | 91精品啪在线观看国产60岁| 欧美一级久久久| 亚洲一区欧美一区| 成人av在线播放网址| 欧美成人一区二区三区| 亚洲一区二区综合| 91蝌蚪porny九色| 久久久精品综合| 日本午夜精品一区二区三区电影| 成人看片黄a免费看在线| 欧美一级在线视频| 日韩电影在线观看一区| 久久亚洲综合色| 狠狠狠色丁香婷婷综合激情| 69堂成人精品免费视频| 日韩精品成人一区二区在线| 欧美日韩免费在线视频| 亚洲女人的天堂| 欧美视频在线观看一区二区| 国产精品天美传媒沈樵| 成人一区二区三区中文字幕| 精品捆绑美女sm三区| 另类的小说在线视频另类成人小视频在线 | 亚洲精品网站在线观看| 欧美综合在线视频| 亚洲成人www| 日韩精品中文字幕一区二区三区 | 欧美亚洲综合另类| 奇米色一区二区三区四区| 日韩视频在线你懂得| 国产成人精品亚洲日本在线桃色 | 色噜噜狠狠一区二区三区果冻| 亚洲精品国产一区二区三区四区在线 | 91麻豆精品视频| 日韩av电影免费观看高清完整版| 日韩一区二区电影网| 国产成人在线视频网站| 亚洲免费观看高清完整版在线 | 亚洲妇女屁股眼交7| 精品日韩欧美在线| 色妞www精品视频| 久久精品国产成人一区二区三区| 国产精品家庭影院| 欧美一级日韩免费不卡| 成人av在线网站| 另类人妖一区二区av| 亚洲一二三专区| 欧美国产欧美亚州国产日韩mv天天看完整| 91色视频在线| 国产一区二区三区在线观看免费视频 | 成人午夜在线播放| 日本伊人色综合网| 亚洲精品中文字幕乱码三区 | 国产一区二区中文字幕| 日韩精品免费视频人成| 亚瑟在线精品视频| 亚洲精品一卡二卡| 亚洲免费伊人电影| 亚洲另类在线制服丝袜| 亚洲欧美另类久久久精品2019| 精品国产露脸精彩对白 | 狠狠狠色丁香婷婷综合激情| 日韩精品1区2区3区| 五月激情六月综合| 水蜜桃久久夜色精品一区的特点| 亚洲精品成人天堂一二三| 国产精品国产三级国产aⅴ无密码| 久久日韩粉嫩一区二区三区| 久久国产视频网| 精品国精品国产| 欧美日韩另类一区| 色久综合一二码| 欧美伊人精品成人久久综合97| 91亚洲精品一区二区乱码| 91在线你懂得| 在线观看欧美日本| 欧美一区二区三区在线| 日韩免费性生活视频播放| 日韩精品中文字幕在线一区| 久久这里只有精品视频网| 国产精品美女一区二区三区| 国产精品成人一区二区三区夜夜夜| 国产精品久久久久影院老司| 国产精品久久久久久妇女6080| 亚洲精品写真福利| 青青国产91久久久久久| 国产一区二区三区美女| 波波电影院一区二区三区| 欧美日韩国产在线播放网站| 精品久久人人做人人爰| 亚洲精品亚洲人成人网在线播放| 天使萌一区二区三区免费观看| 国产麻豆精品theporn| aaa亚洲精品一二三区| 日韩欧美在线影院| 一区二区成人在线视频| 国产一区二区不卡在线| 欧美精品自拍偷拍| 国产精品久久午夜夜伦鲁鲁| 久久精品免费看| 欧美妇女性影城| 一区二区三区国产精品| 972aa.com艺术欧美| 精品国产伦一区二区三区观看体验| 亚洲欧美色图小说| 丁香天五香天堂综合| 欧美v亚洲v综合ⅴ国产v| 亚洲午夜激情网站| 欧美日韩在线播放三区| 中文字幕在线观看不卡视频| 成人少妇影院yyyy| 中文字幕av不卡| 成人精品免费看| 久久久久国产精品麻豆ai换脸| 卡一卡二国产精品| 日韩欧美自拍偷拍| 国产高清不卡一区二区| 久久久久久一级片| 高清视频一区二区| 自拍偷拍亚洲激情| 欧美三级日韩三级| 蜜臀久久99精品久久久画质超高清| 欧美日韩亚洲综合一区 | 色诱视频网站一区| 一个色在线综合| 欧美高清视频一二三区| 国产精品一区2区| 国产精品国产三级国产普通话99 | 91色视频在线| 麻豆精品新av中文字幕| 日本一区二区视频在线| 色香蕉成人二区免费| 秋霞午夜鲁丝一区二区老狼| 国产无人区一区二区三区| 成人av网站在线观看| 亚洲电影在线播放| 亚洲精品一线二线三线无人区| 97精品国产97久久久久久久久久久久| 亚洲综合一二区| 国产欧美日韩久久| 欧美丰满美乳xxx高潮www| 成人av网站免费| 国产主播一区二区| 日韩电影免费一区| 亚洲女厕所小便bbb| 久久精品一区二区| 欧美电影一区二区| 色菇凉天天综合网| eeuss鲁一区二区三区| 极品少妇一区二区| 日本欧美一区二区三区| 亚洲自拍偷拍麻豆| 综合亚洲深深色噜噜狠狠网站| 精品av久久707| 日韩免费成人网| 日韩欧美第一区| 日韩欧美123| 久久亚区不卡日本| 久久精品亚洲乱码伦伦中文| 日韩午夜电影av| 欧美一区二区在线观看| 欧美一区二区播放| 91精品国产91热久久久做人人| 欧美日韩国产成人在线91 | 亚洲一区电影777| 五月综合激情日本mⅴ| 日本色综合中文字幕| 久久精品国产亚洲高清剧情介绍| 亚洲va韩国va欧美va精品| 欧美日韩免费一区二区三区视频| 国产成人自拍高清视频在线免费播放| 国产乱子轮精品视频| 99久久精品一区二区| 欧美区在线观看| 久久一区二区视频| 亚洲三级在线免费观看| 视频一区二区三区中文字幕| 国产在线精品视频| 欧美影片第一页| 国产亚洲欧美日韩在线一区| 亚洲国产精品麻豆| 粉嫩一区二区三区性色av| 欧美另类变人与禽xxxxx| 久久久青草青青国产亚洲免观| 亚洲另类在线视频| 成人国产一区二区三区精品| 日韩精品一区在线| 亚洲一区二三区|