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

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

?? erc_api.c

?? jm_frext22.ZIP的壓縮文件,主要用于嵌入式系統圖象的編解碼的開發.
?? 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 
      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一区二区三区免费野_久草精品视频
一区二区欧美国产| 91精品婷婷国产综合久久竹菊| 日本亚洲三级在线| 亚洲国产精品欧美一二99| 亚洲天堂2014| 依依成人综合视频| 亚洲一二三四久久| 日本不卡视频在线| 精品一区二区三区av| 国产一区二区在线观看视频| 国产69精品久久久久777| 国产高清在线观看免费不卡| a美女胸又www黄视频久久| 91免费观看在线| 欧美精品tushy高清| 欧美日韩精品福利| 精品国产凹凸成av人导航| 久久久精品日韩欧美| 国产精品第四页| 午夜久久福利影院| 国产中文字幕一区| 色综合久久88色综合天天6| 欧美三级中文字| 亚洲精品在线观看网站| 中文字幕一区av| 爽好久久久欧美精品| 国内外成人在线| 色哟哟一区二区| 欧美白人最猛性xxxxx69交| 国产精品乱人伦| 日本不卡视频一二三区| 99精品久久免费看蜜臀剧情介绍| 91电影在线观看| 久久影院视频免费| 亚洲国产精品一区二区www在线| 精品一区二区三区免费毛片爱| 99精品欧美一区| 亚洲精品在线免费播放| 亚洲一区二区三区国产| 国产凹凸在线观看一区二区| 欧美午夜理伦三级在线观看| 国产色产综合色产在线视频| 午夜精品一区二区三区免费视频 | 欧美图片一区二区三区| 久久九九影视网| 亚洲午夜久久久久久久久电影院| 免费亚洲电影在线| 在线观看区一区二| 国产精品另类一区| 国产一区二区三区av电影| 欧美日韩国产小视频在线观看| 久久久久久久久久电影| 丝袜亚洲精品中文字幕一区| 91在线国产福利| 久久精品一区二区三区不卡| 奇米综合一区二区三区精品视频| 99re热这里只有精品视频| 国产色爱av资源综合区| 久久超碰97中文字幕| 欧美午夜精品久久久久久孕妇| 国产欧美一区二区在线| 国内精品视频666| 日韩精品一区二区三区视频在线观看| 亚洲美女视频在线| 91蝌蚪porny| 玉米视频成人免费看| 色综合中文综合网| 色综合一个色综合亚洲| 国产精品无遮挡| 福利一区二区在线| 国产精品全国免费观看高清| 粉嫩av一区二区三区| 国产精品久久久久影院色老大| 国产盗摄女厕一区二区三区| 久久久美女毛片| 国产伦精品一区二区三区视频青涩 | 3d成人动漫网站| 精品一区二区三区的国产在线播放| 欧美三日本三级三级在线播放| 亚洲精品大片www| 在线视频欧美区| 偷窥少妇高潮呻吟av久久免费| 在线观看日韩电影| 日韩精品一级二级| 日韩欧美中文字幕公布| 国产一区久久久| 国产精品欧美一区喷水| 色综合视频一区二区三区高清| 亚洲综合视频网| 欧美一卡二卡三卡| 国产精品一区一区三区| 日韩伦理电影网| 欧美日韩一区二区在线观看| 久久精品99久久久| 欧美国产一区视频在线观看| 色综合久久久久综合体桃花网| 亚洲成人免费视| 久久只精品国产| 91一区二区三区在线播放| 亚洲成a人v欧美综合天堂| 日韩欧美国产三级电影视频| 国产成人精品www牛牛影视| 综合激情成人伊人| 91精品国产福利| 不卡av在线免费观看| 日韩专区中文字幕一区二区| 久久久久国产精品麻豆| 色综合色狠狠综合色| 久久国内精品自在自线400部| 国产无遮挡一区二区三区毛片日本| 日本乱码高清不卡字幕| 精品午夜一区二区三区在线观看 | 亚洲高清视频中文字幕| 精品日韩成人av| 在线亚洲+欧美+日本专区| 九一九一国产精品| 亚洲欧洲精品成人久久奇米网| 91在线视频官网| 日韩黄色免费网站| 亚洲日本电影在线| 精品成人私密视频| 欧美理论电影在线| 91在线观看高清| 国产精品一卡二卡在线观看| 亚洲一二三四区不卡| 国产精品短视频| 久久综合久久鬼色| 日韩无一区二区| 欧美性淫爽ww久久久久无| 不卡一卡二卡三乱码免费网站| 美女视频免费一区| 午夜久久久久久久久| 樱花草国产18久久久久| 国产精品久久久久久久久免费樱桃| 日韩一区二区三区电影在线观看 | 国产精品美女一区二区| 日韩欧美成人一区| 91精品国产色综合久久ai换脸| 99国产精品久久久久久久久久久| 久久99精品久久久久久国产越南| 亚洲国产日日夜夜| 一区二区三区在线不卡| 亚洲免费看黄网站| 亚洲人被黑人高潮完整版| 国产亚洲一区二区三区四区| 日韩三区在线观看| 91精品在线观看入口| 欧美一区二区福利在线| 91.麻豆视频| 91精品国产乱码久久蜜臀| 91精品国产综合久久婷婷香蕉| 欧亚一区二区三区| 欧美日韩在线三区| 欧美高清你懂得| 欧美一区二区三区在线电影| 日韩午夜av电影| 久久综合色综合88| 欧美国产一区在线| 中文字幕在线不卡一区| 最新日韩av在线| 亚洲一区自拍偷拍| 奇米777欧美一区二区| 九九国产精品视频| 国产精品羞羞答答xxdd| eeuss国产一区二区三区| 91蝌蚪国产九色| 欧美日韩国产精选| 欧美变态tickling挠脚心| 中文字幕不卡三区| 夜夜精品视频一区二区| 日韩在线播放一区二区| 久久97超碰色| 99久久精品情趣| 欧美日韩国产不卡| 欧美精品一区二区在线观看| 中文字幕不卡在线播放| 午夜精品久久一牛影视| 极品销魂美女一区二区三区| 成人免费视频caoporn| 欧美私人免费视频| 2023国产精华国产精品| 国产精品电影一区二区| 日韩精品电影在线| www.日本不卡| 日韩亚洲欧美在线| 亚洲欧美日韩中文播放| 男女性色大片免费观看一区二区| 国产高清在线精品| 91精品综合久久久久久| 中文字幕不卡的av| 蜜臀久久99精品久久久画质超高清| 国产一区二区伦理片| 欧美日韩一区在线观看| 国产欧美日韩在线| 婷婷丁香久久五月婷婷| av网站免费线看精品| 日韩女优毛片在线| 性久久久久久久久| 成人高清免费观看| 久久亚洲精品小早川怜子|