亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲综合偷拍欧美一区色| 伊人色综合久久天天人手人婷| 一区二区三区色| 国产一区二区视频在线| 欧美日韩免费观看一区二区三区| 久久品道一品道久久精品| 亚洲国产视频一区| 97久久精品人人做人人爽| 久久久另类综合| 日韩成人精品在线| 欧美在线免费观看亚洲| 国产精品久久午夜| 国产在线不卡一区| 日韩欧美久久一区| 日韩精品一级二级| 欧美性videosxxxxx| 中文字幕一区二区三区乱码在线 | 色婷婷久久久综合中文字幕| 久久品道一品道久久精品| 欧美高清视频www夜色资源网| 国产精品久久影院| 国产精品18久久久久久久久久久久| 69久久99精品久久久久婷婷| 一区二区三区91| 色综合久久综合中文综合网| 国产精品久99| 99精品偷自拍| 国产精品传媒视频| 成人丝袜18视频在线观看| 亚洲精品一线二线三线无人区| 日本欧美在线观看| 91精品国产91久久久久久一区二区| 亚洲已满18点击进入久久| 日本韩国一区二区| 亚洲一区在线观看视频| 91黄色免费看| 亚洲国产日韩综合久久精品| 欧美在线观看一区| 一区二区成人在线视频| 一本色道亚洲精品aⅴ| 亚洲欧美色一区| 色综合视频在线观看| 亚洲精品国产一区二区精华液| 色综合久久综合网| 亚洲综合小说图片| 欧美日韩电影在线播放| 日韩高清不卡在线| 91麻豆精品国产91久久久| 日韩av中文字幕一区二区三区| 欧美疯狂性受xxxxx喷水图片| 午夜欧美2019年伦理| 91麻豆精品91久久久久久清纯| 水野朝阳av一区二区三区| 91精品国产全国免费观看| 麻豆精品一区二区综合av| 欧美va亚洲va在线观看蝴蝶网| 精品一区二区综合| 日本一区二区三区dvd视频在线| 丁香一区二区三区| 中文字幕一区二区三区视频| 91蜜桃免费观看视频| 亚洲一区二区三区在线| 91精品欧美一区二区三区综合在| 精品一区二区三区av| 欧美国产日产图区| 91麻豆免费看片| 一本一本久久a久久精品综合麻豆| 亚洲人妖av一区二区| 欧美在线999| 日本va欧美va精品发布| 亚洲精品一区二区三区四区高清 | 欧美综合一区二区| 免费在线观看精品| 国产欧美一区二区在线| 91麻豆国产精品久久| 午夜精品久久久久久久| 精品国产百合女同互慰| 成人性视频免费网站| 樱花影视一区二区| 91精品国产黑色紧身裤美女| 国产二区国产一区在线观看| 亚洲视频一区二区在线| 欧美日韩国产高清一区二区三区 | 久久久亚洲欧洲日产国码αv| 丁香天五香天堂综合| 亚洲女人的天堂| 欧美精品乱码久久久久久按摩| 激情综合亚洲精品| 亚洲人成在线播放网站岛国| 这里只有精品视频在线观看| 国产成人免费视频精品含羞草妖精| 日韩美女视频一区二区| 欧美一区2区视频在线观看| 国产精品99久久久久| 一区二区激情视频| 欧美精品一区男女天堂| 91麻豆高清视频| 韩日精品视频一区| 一区二区三区 在线观看视频| 日韩美一区二区三区| 91蜜桃婷婷狠狠久久综合9色| 美日韩一区二区| 中文字幕在线不卡视频| 欧美日韩高清一区二区不卡| 丁香婷婷综合网| 日本怡春院一区二区| 中文字幕va一区二区三区| 在线播放中文字幕一区| 成人黄色综合网站| 美女在线观看视频一区二区| 亚洲欧洲av一区二区三区久久| 青青草国产精品97视觉盛宴| 欧美韩日一区二区三区| 制服丝袜av成人在线看| 91尤物视频在线观看| 精品综合免费视频观看| 亚洲精品你懂的| 久久久不卡影院| 欧美另类videos死尸| 成人app网站| 美女一区二区视频| 亚洲精品菠萝久久久久久久| 久久久三级国产网站| 欧美狂野另类xxxxoooo| 91亚洲午夜精品久久久久久| 国产一区二区h| 日韩高清电影一区| 一区二区三区不卡视频| 亚洲国产精品高清| 日韩欧美久久久| 精品视频一区二区不卡| 成年人网站91| 国产一区二区免费看| 三级在线观看一区二区| 亚洲欧美日韩一区| 国产日韩精品一区二区三区在线| 在线播放日韩导航| 色狠狠桃花综合| 成人av网站在线观看免费| 久久成人免费网| 天堂在线一区二区| 亚洲天堂免费在线观看视频| 国产欧美综合色| 久久一夜天堂av一区二区三区| 51精品秘密在线观看| 在线一区二区观看| 国内精品在线播放| 亚洲男人都懂的| 亚洲欧洲av另类| 国产精品久久久一区麻豆最新章节| 日韩一级黄色大片| 777xxx欧美| 欧美精品成人一区二区三区四区| 久久无码av三级| 精品噜噜噜噜久久久久久久久试看| 欧美精品少妇一区二区三区| 在线观看欧美精品| 91丨九色丨黑人外教| av综合在线播放| 9色porny自拍视频一区二区| 国产激情一区二区三区桃花岛亚洲| 乱一区二区av| 日韩av不卡在线观看| 午夜精品视频一区| 午夜久久久久久久久| 亚洲午夜一区二区| 亚洲一区二区三区四区在线 | 国产传媒日韩欧美成人| 国产一区二区三区四| 国产精品一级片在线观看| 国产一区二区免费在线| 国产精品主播直播| 国产精品亚洲专一区二区三区| 国产一区二区精品在线观看| 国产高清不卡一区| 国产成人精品一区二区三区四区 | 国产91对白在线观看九色| 国产精品69毛片高清亚洲| 国产一区91精品张津瑜| 久久99国产精品尤物| 久久黄色级2电影| 韩国精品免费视频| 国产成人综合网| 成人一区二区三区在线观看| 成人免费观看视频| 91香蕉视频mp4| 欧洲生活片亚洲生活在线观看| 欧美三级韩国三级日本一级| 制服丝袜中文字幕一区| 日韩色视频在线观看| 精品国产乱码久久久久久蜜臀| 久久久蜜臀国产一区二区| 国产精品久久久久久亚洲伦 | 亚洲精品美腿丝袜| 亚洲国产毛片aaaaa无费看| 日本不卡视频一二三区| 精一区二区三区| 东方aⅴ免费观看久久av| 色婷婷久久久久swag精品| 欧美性受xxxx黑人xyx|