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

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

?? erc_api.c

?? 一個簡單的視頻會議VC++MFC工程文件
?? C
字號:

/*!
 *************************************************************************************
 * \file erc_api.c
 *
 * \brief
 *    External (still inside video decoder) interface for error concealment module
 *
 *  \author
 *     - Ari Hourunranta                <ari.hourunranta@nokia.com>
 *     - Viktor Varsa                     <viktor.varsa@nokia.com>
 *     - Ye-Kui Wang                   <wyk@ieee.org>
 *
 *************************************************************************************
 */


#include <stdlib.h>

#include "global.h"
#include "memalloc.h"
#include "erc_api.h"

objectBuffer_t *erc_object_list = NULL;
ercVariables_t *erc_errorVar = NULL;
frame erc_recfr;
int erc_mvperMB;

/*!
 ************************************************************************
 * \brief
 *    Initinize the error concealment module
 ************************************************************************
 */
void ercInit(int pic_sizex, int pic_sizey, int flag)
{
  ercClose(erc_errorVar);
  erc_object_list = (objectBuffer_t *) calloc((pic_sizex * pic_sizey) >> 6, sizeof(objectBuffer_t));
  if (erc_object_list == NULL) no_mem_exit("ercInit: erc_object_list");
  
  /* the error concelament instance is allocated */
  erc_errorVar = ercOpen();
  
  /* set error concealment ON */
  ercSetErrorConcealment(erc_errorVar, flag);
}

/*!
 ************************************************************************
 * \brief
 *      Allocates data structures used in error concealment.
 *\return
 *      The allocated ercVariables_t is returned.
 ************************************************************************
 */
ercVariables_t *ercOpen( void )
{
  ercVariables_t *errorVar = NULL;
  
  errorVar = (ercVariables_t *)malloc( sizeof(ercVariables_t));
  if ( errorVar == NULL ) no_mem_exit("ercOpen: errorVar");

  errorVar->nOfMBs = 0;
  errorVar->segments = NULL;
  errorVar->currSegment = 0;
  errorVar->yCondition = NULL;
  errorVar->uCondition = NULL;
  errorVar->vCondition = NULL;
  errorVar->prevFrameYCondition = NULL;
  
  errorVar->concealment = 1;
  
  return errorVar;
}

/*!
 ************************************************************************
 * \brief
 *      Resets the variables used in error detection. 
 *      Should be called always when starting to decode a new frame.
 * \param errorVar
 *      Variables for error concealment
 * \param nOfMBs
 *      Number of macroblocks in a frame
 * \param numOfSegments
 *    Estimated number of segments (memory reserved)
 * \param picSizeX
 *      Width of the frame in pixels.
 ************************************************************************
 */
void ercReset( ercVariables_t *errorVar, int nOfMBs, int numOfSegments, int32 picSizeX )
{
  int *tmp = NULL;
  int i = 0, j = 0;
  
  if ( errorVar && errorVar->concealment ) 
  {
    /* If frame size has been changed */
    if ( nOfMBs != errorVar->nOfMBs && errorVar->yCondition != NULL ) 
    {
      free( errorVar->yCondition );
      errorVar->yCondition = NULL;
      free( errorVar->prevFrameYCondition );
      errorVar->prevFrameYCondition = NULL;
      free( errorVar->uCondition );
      errorVar->uCondition = NULL;
      free( errorVar->vCondition );
      errorVar->vCondition = NULL;
      free( errorVar->segments );
      errorVar->segments = NULL;
    }
    
    /* If the structures are uninitialized (first frame, or frame size is chaned) */
    if ( errorVar->yCondition == NULL ) 
    {
      errorVar->segments = (ercSegment_t *)malloc( numOfSegments*sizeof(ercSegment_t) );
      if ( errorVar->segments == NULL ) no_mem_exit("ercReset: errorVar->segments");
      memset( errorVar->segments, 0, numOfSegments*sizeof(ercSegment_t));
      errorVar->nOfSegments = numOfSegments;
      
      errorVar->yCondition = (int *)malloc( 4*nOfMBs*sizeof(int) );
      if ( errorVar->yCondition == NULL ) no_mem_exit("ercReset: errorVar->yCondition");
      errorVar->prevFrameYCondition = (int *)malloc( 4*nOfMBs*sizeof(int) );
      if ( errorVar->prevFrameYCondition == NULL ) no_mem_exit("ercReset: errorVar->prevFrameYCondition");
      errorVar->uCondition = (int *)malloc( nOfMBs*sizeof(int) );
      if ( errorVar->uCondition == NULL ) no_mem_exit("ercReset: errorVar->uCondition");
      errorVar->vCondition = (int *)malloc( nOfMBs*sizeof(int) );
      if ( errorVar->vCondition == NULL ) no_mem_exit("ercReset: errorVar->vCondition");
      errorVar->nOfMBs = nOfMBs;
    }
    else 
    {
      /* Store the yCondition struct of the previous frame */
      tmp = errorVar->prevFrameYCondition;
      errorVar->prevFrameYCondition = errorVar->yCondition;
      errorVar->yCondition = tmp;
    }
    
    /* Reset tables and parameters */
    memset( errorVar->yCondition, 0, 4*nOfMBs*sizeof(*errorVar->yCondition));
    memset( errorVar->uCondition, 0,   nOfMBs*sizeof(*errorVar->uCondition));
    memset( errorVar->vCondition, 0,   nOfMBs*sizeof(*errorVar->vCondition));
    
    if (errorVar->nOfSegments != numOfSegments) 
    {
      free( errorVar->segments );
      errorVar->segments = NULL;
      errorVar->segments = (ercSegment_t *)malloc( numOfSegments*sizeof(ercSegment_t) );
      if ( errorVar->segments == NULL ) no_mem_exit("ercReset: errorVar->segments");
      errorVar->nOfSegments = numOfSegments;
    }
    
    memset( errorVar->segments, 0, errorVar->nOfSegments*sizeof(ercSegment_t));

    for ( i = 0; i < errorVar->nOfSegments; i++ ) 
    {
      // mark all the Blocks as empty 
      /* // this is a duplication of the memset above
      for ( j = 0; j < nOfMBs; j++ ) 
      {
        errorVar->yCondition[MBNum2YBlock (j, 0, picSizeX)] = ERC_BLOCK_EMPTY;
        errorVar->yCondition[MBNum2YBlock (j, 1, picSizeX)] = ERC_BLOCK_EMPTY;
        errorVar->yCondition[MBNum2YBlock (j, 2, picSizeX)] = ERC_BLOCK_EMPTY;
        errorVar->yCondition[MBNum2YBlock (j, 3, picSizeX)] = ERC_BLOCK_EMPTY;
        errorVar->uCondition[j] = ERC_BLOCK_EMPTY;
        errorVar->vCondition[j] = ERC_BLOCK_EMPTY;
      }
      */
      errorVar->segments[i].fCorrupted = 1; //! mark segments as corrupted
      errorVar->segments[i].startMBPos = 0;
      errorVar->segments[i].endMBPos = nOfMBs - 1;
    }
    
    errorVar->currSegment = 0;
    errorVar->nOfCorruptedSegments = 0;
  }
}

/*!
 ************************************************************************
 * \brief
 *      Resets the variables used in error detection. 
 *      Should be called always when starting to decode a new frame.
 * \param errorVar
 *      Variables for error concealment
 ************************************************************************
 */
void ercClose( ercVariables_t *errorVar )
{
  if ( errorVar != NULL ) 
  {
    if (errorVar->yCondition != NULL) 
    {
      free( errorVar->segments );
      free( errorVar->yCondition );
      free( errorVar->uCondition );
      free( errorVar->vCondition );
      free( errorVar->prevFrameYCondition );
    }
    free( errorVar );
    errorVar = NULL;
  }
  
  if (erc_object_list)
  {
    free(erc_object_list);
    erc_object_list=NULL;
  }
}

/*!
 ************************************************************************
 * \brief
 *      Sets error concealment ON/OFF. Can be invoked only between frames, not during a frame
 * \param errorVar
 *      Variables for error concealment
 * \param value
 *      New value
 ************************************************************************
 */
void ercSetErrorConcealment( ercVariables_t *errorVar, int value )
{
  if ( errorVar != NULL )
    errorVar->concealment = value;
}

/*!
 ************************************************************************
 * \brief
 *      Creates a new segment in the segment-list, and marks the start MB and bit position.
 *      If the end of the previous segment was not explicitly marked by "ercStopSegment",
 *      also marks the end of the previous segment.
 *      If needed, it reallocates the segment-list for a larger storage place.
 * \param currMBNum
 *      The MB number where the new slice/segment starts
 * \param segment
 *      Segment/Slice No. counted by the caller
 * \param bitPos
 *      Bitstream pointer: number of bits read from the buffer.
 * \param errorVar
 *      Variables for error detector
 ************************************************************************
 */
void ercStartSegment( int currMBNum, int segment, u_int32 bitPos, ercVariables_t *errorVar )
{
  if ( errorVar && errorVar->concealment ) 
  {
    errorVar->currSegmentCorrupted = 0;
        
    errorVar->segments[ segment ].fCorrupted = 0;
    errorVar->segments[ segment ].startMBPos = currMBNum;
    
  }   
}

/*!
 ************************************************************************
 * \brief
 *      Marks the end position of a segment.
 * \param currMBNum
 *      The last MB number of the previous segment
 * \param segment
 *      Segment/Slice No. counted by the caller
 *      If (segment<0) the internal segment counter is used.
 * \param bitPos
 *      Bitstream pointer: number of bits read from the buffer.
 * \param errorVar
 *      Variables for error detector
 ************************************************************************
 */
void ercStopSegment( int currMBNum, int segment, u_int32 bitPos, ercVariables_t *errorVar )
{
  if ( errorVar && errorVar->concealment ) 
  {
    errorVar->segments[ segment ].endMBPos = currMBNum; //! Changed TO 12.11.2001
    errorVar->currSegment++;
  }
}

/*!
 ************************************************************************
 * \brief
 *      Marks the current segment (the one which has the "currMBNum" MB in it)
 *      as lost: all the blocks of the MBs in the segment as corrupted.
 * \param picSizeX
 *      Width of the frame in pixels.
 * \param errorVar
 *      Variables for error detector
 ************************************************************************
 */
void ercMarkCurrSegmentLost(int32 picSizeX, ercVariables_t *errorVar )
{
  int j = 0;
  int current_segment;
  
  current_segment = errorVar->currSegment-1;
  if ( errorVar && errorVar->concealment ) 
  {
    if (errorVar->currSegmentCorrupted == 0) 
    {
      errorVar->nOfCorruptedSegments++;
      errorVar->currSegmentCorrupted = 1;
    }
     
    for ( j = errorVar->segments[current_segment].startMBPos; j <= errorVar->segments[current_segment].endMBPos; j++ ) 
    {
      errorVar->yCondition[MBNum2YBlock (j, 0, picSizeX)] = ERC_BLOCK_CORRUPTED;
      errorVar->yCondition[MBNum2YBlock (j, 1, picSizeX)] = ERC_BLOCK_CORRUPTED;
      errorVar->yCondition[MBNum2YBlock (j, 2, picSizeX)] = ERC_BLOCK_CORRUPTED;
      errorVar->yCondition[MBNum2YBlock (j, 3, picSizeX)] = ERC_BLOCK_CORRUPTED;
      errorVar->uCondition[j] = ERC_BLOCK_CORRUPTED;
      errorVar->vCondition[j] = ERC_BLOCK_CORRUPTED;
    }
    errorVar->segments[current_segment].fCorrupted = 1;
  }
}

/*!
 ************************************************************************
 * \brief
 *      Marks the current segment (the one which has the "currMBNum" MB in it)
 *      as OK: all the blocks of the MBs in the segment as OK.
 * \param picSizeX
 *      Width of the frame in pixels.
 * \param errorVar
 *      Variables for error detector
 ************************************************************************
 */
void ercMarkCurrSegmentOK(int32 picSizeX, ercVariables_t *errorVar )
{
  int j = 0;
  int current_segment;
  
  current_segment = errorVar->currSegment-1;
  if ( errorVar && errorVar->concealment ) 
  {
    // mark all the Blocks belonging to the segment as OK */
    for ( j = errorVar->segments[current_segment].startMBPos; j <= errorVar->segments[current_segment].endMBPos; j++ ) 
    {
      errorVar->yCondition[MBNum2YBlock (j, 0, picSizeX)] = ERC_BLOCK_OK;
      errorVar->yCondition[MBNum2YBlock (j, 1, picSizeX)] = ERC_BLOCK_OK;
      errorVar->yCondition[MBNum2YBlock (j, 2, picSizeX)] = ERC_BLOCK_OK;
      errorVar->yCondition[MBNum2YBlock (j, 3, picSizeX)] = ERC_BLOCK_OK;
      errorVar->uCondition[j] = ERC_BLOCK_OK;
      errorVar->vCondition[j] = ERC_BLOCK_OK;
    }
    errorVar->segments[current_segment].fCorrupted = 0;
  }
}

/*!
 ************************************************************************
 * \brief
 *      Marks the Blocks of the given component (YUV) of the current MB as concealed.
 * \param currMBNum
 *      Selects the segment where this MB number is in.
 * \param comp
 *      Component to mark (0:Y, 1:U, 2:V, <0:All)
 * \param picSizeX
 *      Width of the frame in pixels.
 * \param errorVar
 *      Variables for error detector
 ************************************************************************
 */
void ercMarkCurrMBConcealed( int currMBNum, int comp, int32 picSizeX, ercVariables_t *errorVar )
{
  int setAll = 0;
  
  if ( errorVar && errorVar->concealment ) 
  {
    if (comp < 0) 
    {
      setAll = 1;
      comp = 0;
    }
    
    switch (comp) 
    {
    case 0:
      errorVar->yCondition[MBNum2YBlock (currMBNum, 0, picSizeX)] = ERC_BLOCK_CONCEALED;
      errorVar->yCondition[MBNum2YBlock (currMBNum, 1, picSizeX)] = ERC_BLOCK_CONCEALED;
      errorVar->yCondition[MBNum2YBlock (currMBNum, 2, picSizeX)] = ERC_BLOCK_CONCEALED;
      errorVar->yCondition[MBNum2YBlock (currMBNum, 3, picSizeX)] = ERC_BLOCK_CONCEALED;
      if (!setAll)
        break;
    case 1:
      errorVar->uCondition[currMBNum] = ERC_BLOCK_CONCEALED;
      if (!setAll)
        break;
    case 2:
      errorVar->vCondition[currMBNum] = ERC_BLOCK_CONCEALED;
    }
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲电影在线| 92精品国产成人观看免费| 丁香婷婷深情五月亚洲| av电影在线观看一区| 欧美亚洲动漫精品| 日韩一区二区高清| 国产精品视频你懂的| 亚洲激情图片qvod| 捆绑变态av一区二区三区| 国产福利精品一区二区| 在线影视一区二区三区| 精品国内二区三区| 中文字幕亚洲成人| 热久久一区二区| 成人午夜私人影院| 欧美精品自拍偷拍动漫精品| 欧美精品一区二区精品网| 国产精品久久久久久久久搜平片| 亚洲国产日韩一级| 国产成a人亚洲| 欧美精品在线一区二区三区| 国产日韩欧美高清| 五月婷婷色综合| 国产99久久久精品| 欧美久久免费观看| 中文字幕日韩欧美一区二区三区| 奇米影视在线99精品| 91丨九色丨蝌蚪丨老版| 精品美女被调教视频大全网站| 亚洲人精品午夜| 久久er99精品| 欧美日韩一卡二卡三卡 | 五月激情综合网| 国产精品性做久久久久久| 日本电影欧美片| 国产性天天综合网| 免费成人美女在线观看| 欧美这里有精品| 国产精品免费av| 韩国三级在线一区| 欧美一区永久视频免费观看| 最新热久久免费视频| 国产一区在线视频| 91.成人天堂一区| 一区2区3区在线看| 成人精品视频.| 精品福利av导航| 青椒成人免费视频| 欧美剧情片在线观看| 亚洲精品免费在线播放| 欧美在线影院一区二区| 久久欧美中文字幕| 久久99精品久久久久久久久久久久 | 欧美午夜视频网站| 国产精品久久久久四虎| 国产成人一区二区精品非洲| 欧美疯狂做受xxxx富婆| 亚洲一区二区欧美| 色天天综合久久久久综合片| 国产精品蜜臀在线观看| 国产91在线看| 国产亚洲欧美日韩俺去了| 极品少妇xxxx偷拍精品少妇| 欧美一区二区三区四区久久 | 欧美日韩国产另类不卡| 亚洲精品日产精品乱码不卡| 成人黄色片在线观看| 国产欧美一区在线| 成人丝袜高跟foot| 日本一区二区三区视频视频| 国产一区二区三区黄视频| 欧美成人精品3d动漫h| 秋霞影院一区二区| 91精品国产乱码| 老司机精品视频线观看86 | 日韩国产在线一| 欧美日本精品一区二区三区| 亚洲aaa精品| 7777精品伊人久久久大香线蕉| 性做久久久久久免费观看| 欧美专区日韩专区| 午夜电影网一区| 日韩一区二区三区精品视频| 爽爽淫人综合网网站| 日韩一区二区中文字幕| 久久激情五月婷婷| 久久一日本道色综合| 福利一区二区在线| 中文字幕视频一区二区三区久| 91无套直看片红桃| 亚洲成av人片在www色猫咪| 欧美日韩精品电影| 人人狠狠综合久久亚洲| 精品处破学生在线二十三| 国产一区在线精品| 欧美国产日韩精品免费观看| 99re这里只有精品首页| 亚洲一卡二卡三卡四卡无卡久久| 欧美精品一二三| 久久99精品久久久| 国产精品私人自拍| 日本高清不卡在线观看| 天天操天天干天天综合网| 日韩欧美二区三区| 成人av网站在线| 一级日本不卡的影视| 日韩一区二区电影网| 国产精品一区不卡| 亚洲色图制服丝袜| 欧美色精品在线视频| 蜜臀av一区二区在线免费观看| 久久久影院官网| 99久久婷婷国产综合精品| 亚洲va天堂va国产va久| 久久综合成人精品亚洲另类欧美 | 日韩精品在线看片z| 欧美影院精品一区| 色综合久久久久| 色综合久久中文综合久久97| 色综合一个色综合| 99久久久国产精品| 一本一道久久a久久精品| 欧美一区二区三区在线看| 免费成人av在线播放| 日韩午夜激情视频| 成人久久视频在线观看| 欧美一区二区福利在线| 伊人色综合久久天天人手人婷| 捆绑变态av一区二区三区| 亚洲国产精品麻豆| 久久狠狠亚洲综合| 欧美三级在线播放| 亚洲1区2区3区4区| 欧美色视频一区| 亚洲麻豆国产自偷在线| 国产美女主播视频一区| 日本韩国视频一区二区| 91国产福利在线| 欧美精品自拍偷拍动漫精品| 欧美午夜精品久久久久久孕妇| 91看片淫黄大片一级在线观看| 2020国产精品| 亚洲尤物视频在线| 国产精品一区在线观看你懂的| 欧美日韩久久久久久| 欧美影院一区二区三区| 亚洲午夜久久久久久久久电影网| 国产风韵犹存在线视精品| 欧美一区二区啪啪| 亚洲成a人片综合在线| 欧美在线免费观看视频| 亚洲欧美日本在线| 欧美亚洲一区二区三区四区| 久久精品欧美一区二区三区不卡 | 一区二区三区免费网站| 国产精品综合网| 欧美久久久影院| 亚洲欧美另类综合偷拍| 国产91精品久久久久久久网曝门 | 亚洲午夜激情网页| 成人v精品蜜桃久久一区| 91精品国产麻豆| 亚洲一卡二卡三卡四卡| 99这里只有久久精品视频| 精品久久久久久久久久久久包黑料 | 成人黄色在线网站| 91精品在线观看入口| 亚洲国产乱码最新视频| 欧洲精品中文字幕| 国产精品国产三级国产aⅴ原创| 亚洲欧美国产三级| 黑人精品欧美一区二区蜜桃| 色哦色哦哦色天天综合| 欧美高清视频不卡网| 亚洲黄一区二区三区| 欧美伊人久久大香线蕉综合69| 亚洲国产成人av| 亚洲免费在线视频| 欧美国产精品中文字幕| 久久久亚洲精品一区二区三区| 精品国产一区二区亚洲人成毛片| 欧美日韩国产综合草草| 欧美日韩国产影片| 欧美高清性hdvideosex| 欧美情侣在线播放| 欧美一区二区三区视频免费 | 欧美电视剧在线观看完整版| 制服丝袜亚洲色图| 欧美精品在线观看播放| 欧美一三区三区四区免费在线看 | 人禽交欧美网站| 蜜桃一区二区三区在线观看| 日本在线不卡视频| 免费成人小视频| 韩国精品在线观看| 成人综合在线视频| 91亚洲永久精品| 欧美综合视频在线观看| 欧美人伦禁忌dvd放荡欲情| 777a∨成人精品桃花网|