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

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

?? erc_do_p.c

?? 可以用H.264編碼解碼器源碼(c語言)
?? C
?? 第 1 頁 / 共 2 頁
字號:
              /* if Zero Motion Block, do the copying. This option is tried only once */
              if (isBlock(object_list, predMBNum, compPred, INTER_COPY)) 
              {
                
                if (fZeroMotionChecked) 
                {
                  continue;
                }
                else 
                {
                  fZeroMotionChecked = 1;

                  mvPred[0] = mvPred[1] = 0;
                  mvPred[2] = 0;
                  
                  buildPredRegionYUV(erc_img, mvPred, currRegion->xMin, currRegion->yMin, predMB);
                }
              }
              /* build motion using the neighbour's Motion Parameters */
              else if (isBlock(object_list,predMBNum,compPred,INTRA)) 
              {
                continue;
              }
              else 
              {
                mvptr = getParam(object_list, predMBNum, compPred, mv);
                
                mvPred[0] = mvptr[0];
                mvPred[1] = mvptr[1];
                mvPred[2] = mvptr[2];

                buildPredRegionYUV(erc_img, mvPred, currRegion->xMin, currRegion->yMin, predMB);
              }
              
              /* measure absolute boundary pixel difference */
              currDist = edgeDistortion(predBlocks, 
                MBNum2YBlock(currMBNum,comp,picSizeX),
                predMB, recfr->yptr, picSizeX, regionSize);
              
              /* if so far best -> store the pixels as the best concealment */
              if (currDist < minDist || !fInterNeighborExists) 
              {
                
                minDist = currDist;
                bestDir = i;
                
                for (k=0;k<3;k++) 
                  mvBest[k] = mvPred[k];
                
                currRegion->regionMode = 
                  (isBlock(object_list, predMBNum, compPred, INTER_COPY)) ? 
                  ((regionSize == 16) ? REGMODE_INTER_COPY : REGMODE_INTER_COPY_8x8) : 
                  ((regionSize == 16) ? REGMODE_INTER_PRED : REGMODE_INTER_PRED_8x8);
                
                copyPredMB(MBNum2YBlock(currMBNum,comp,picSizeX), predMB, recfr, 
                  picSizeX, regionSize);
              }
              
              fInterNeighborExists = 1;
            }
          }
        }
    }
    
    threshold--;
    
    } while ((threshold >= ERC_BLOCK_CONCEALED) && (fInterNeighborExists == 0));
    
    /* always try zero motion */
    if (!fZeroMotionChecked) 
    {
      mvPred[0] = mvPred[1] = 0;
      mvPred[2] = 0;

      buildPredRegionYUV(erc_img, mvPred, currRegion->xMin, currRegion->yMin, predMB);
      
      currDist = edgeDistortion(predBlocks, 
        MBNum2YBlock(currMBNum,comp,picSizeX),
        predMB, recfr->yptr, picSizeX, regionSize);
      
      if (currDist < minDist || !fInterNeighborExists) 
      {
        
        minDist = currDist;            
        for (k=0;k<3;k++) 
          mvBest[k] = mvPred[k];
        
        currRegion->regionMode = 
          ((regionSize == 16) ? REGMODE_INTER_COPY : REGMODE_INTER_COPY_8x8);
        
        copyPredMB(MBNum2YBlock(currMBNum,comp,picSizeX), predMB, recfr, 
          picSizeX, regionSize);
      }
    }
    
    for (i=0; i<3; i++)
      currRegion->mv[i] = mvBest[i];
    
    yCondition[MBNum2YBlock(currMBNum,comp,picSizeX)] = ERC_BLOCK_CONCEALED;
    comp = (comp+order+4)%4;
    compLeft--;
    
    } while (compLeft);
    
    return 0;
}

/*!
 ************************************************************************
 * \brief
 *      Builds the motion prediction pixels from the given location (in 1/4 pixel units) 
 *      of the reference frame. It not only copies the pixel values but builds the interpolation 
 *      when the pixel positions to be copied from is not full pixel (any 1/4 pixel position).
 *      It copies the resulting pixel vlaues into predMB.
 * \param img
 *      The pointer of img_par struture of current frame
 * \param mv
 *      The pointer of the predicted MV of the current (being concealed) MB
 * \param x
 *      The x-coordinate of the above-left corner pixel of the current MB
 * \param y
 *      The y-coordinate of the above-left corner pixel of the current MB
 * \param predMB
 *      memory area for storing temporary pixel values for a macroblock
 *      the Y,U,V planes are concatenated y = predMB, u = predMB+256, v = predMB+320
 ************************************************************************
 */
static void buildPredRegionYUV(struct img_par *img, int32 *mv, int x, int y, byte *predMB)
{
  int tmp_block[BLOCK_SIZE][BLOCK_SIZE];
  int i=0,j=0,ii=0,jj=0,i1=0,j1=0,j4=0,i4=0;
  int jf=0;
  int uv;
  int vec1_x=0,vec1_y=0;
  int ioff,joff;
  byte *pMB = predMB;

  int ii0,jj0,ii1,jj1,if1,jf1,if0,jf0;
  int mv_mul,f1,f2,f3,f4;

  int ref_frame = mv[2];

  /* Update coordinates of the current concealed macroblock */
  img->mb_x = x/MB_BLOCK_SIZE;
  img->mb_y = y/MB_BLOCK_SIZE;
  img->block_y = img->mb_y * BLOCK_SIZE;
  img->pix_c_y = img->mb_y * MB_BLOCK_SIZE/2;
  img->block_x = img->mb_x * BLOCK_SIZE;
  img->pix_c_x = img->mb_x * MB_BLOCK_SIZE/2;

  mv_mul=4;
  f1=8;
  f2=7;

  f3=f1*f1;
  f4=f3/2;

  // luma *******************************************************

  for(j=0;j<MB_BLOCK_SIZE/BLOCK_SIZE;j++)
  {
    joff=j*4;
    j4=img->block_y+j;
    for(i=0;i<MB_BLOCK_SIZE/BLOCK_SIZE;i++)
    {
      ioff=i*4;
      i4=img->block_x+i;

      vec1_x = i4*4*mv_mul + mv[0];
      vec1_y = j4*4*mv_mul + mv[1];

      get_block(ref_frame, listX[0], vec1_x,vec1_y,img,tmp_block);

      for(ii=0;ii<BLOCK_SIZE;ii++)
        for(jj=0;jj<MB_BLOCK_SIZE/BLOCK_SIZE;jj++)
          img->mpr[ii+ioff][jj+joff]=tmp_block[ii][jj];
    }
  }

  for (i = 0; i < 16; i++)
  {
    for (j = 0; j < 16; j++)
    {
      pMB[i*16+j] = img->mpr[j][i];
    }
  }
  pMB += 256;

  // chroma *******************************************************
  for(uv=0;uv<2;uv++)
  {
    for (j=4;j<6;j++)
    {
      joff=(j-4)*4;
      j4=img->pix_c_y+joff;
      for(i=0;i<2;i++)
      {
        ioff=i*4;
        i4=img->pix_c_x+ioff;
        for(jj=0;jj<4;jj++)
        {
          jf=(j4+jj)/2;
          for(ii=0;ii<4;ii++)
          {
            if1=(i4+ii)/2;
            i1=(img->pix_c_x+ii+ioff)*f1+mv[0];
            j1=(img->pix_c_y+jj+joff)*f1+mv[1];


            ii0=max (0, min (i1/f1, img->width_cr-1));
            jj0=max (0, min (j1/f1, img->height_cr-1));
            ii1=max (0, min ((i1+f2)/f1, img->width_cr-1));
            jj1=max (0, min ((j1+f2)/f1, img->height_cr-1));

            if1=(i1 & f2);
            jf1=(j1 & f2);
            if0=f1-if1;
            jf0=f1-jf1;
            img->mpr[ii+ioff][jj+joff]=(if0*jf0*listX[0][ref_frame]->imgUV[uv][jj0][ii0]+
              if1*jf0*listX[0][ref_frame]->imgUV[uv][jj0][ii1]+
              if0*jf1*listX[0][ref_frame]->imgUV[uv][jj1][ii0]+
              if1*jf1*listX[0][ref_frame]->imgUV[uv][jj1][ii1]+f4)/f3;

          }
        }
      }
    }

    for (i = 0; i < 8; i++)
    {
      for (j = 0; j < 8; j++)
      {
        pMB[i*8+j] = img->mpr[j][i];
      }
    }
    pMB += 64;

  }
}
/*!
 ************************************************************************
 * \brief
 *      Copies pixel values between a YUV frame and the temporary pixel value storage place. This is
 *      used to save some pixel values temporarily before overwriting it, or to copy back to a given 
 *      location in a frame the saved pixel values.
 * \param currYBlockNum   
 *      index of the block (8x8) in the Y plane
 * \param predMB          
 *      memory area where the temporary pixel values are stored
 *      the Y,U,V planes are concatenated y = predMB, u = predMB+256, v = predMB+320
 * \param recfr           
 *      pointer to a YUV frame
 * \param picSizeX        
 *      picture width in pixels
 * \param regionSize      
 *      can be 16 or 8 to tell the dimension of the region to copy
 ************************************************************************
 */
static void copyPredMB (int currYBlockNum, byte *predMB, frame *recfr, 
                        int32 picSizeX, int32 regionSize) 
{
  
  int j, k, xmin, ymin, xmax, ymax;
  int32 locationTmp, locationPred;
  
  xmin = (xPosYBlock(currYBlockNum,picSizeX)<<3);
  ymin = (yPosYBlock(currYBlockNum,picSizeX)<<3);
  xmax = xmin + regionSize -1;
  ymax = ymin + regionSize -1;
  
  for (j = ymin; j <= ymax; j++) 
  {
    for (k = xmin; k <= xmax; k++)
    {
      locationPred = j * picSizeX + k;
      locationTmp = (j-ymin) * 16 + (k-xmin);
      dec_picture->imgY[j][k] = predMB[locationTmp];
    }
  }
  
  for (j = (ymin>>1); j <= (ymax>>1); j++) 
  {
    for (k = (xmin>>1); k <= (xmax>>1); k++)
    {
      locationPred = j * picSizeX / 2 + k;
      locationTmp = (j-(ymin>>1)) * 8 + (k-(xmin>>1)) + 256;
      dec_picture->imgUV[0][j][k] = predMB[locationTmp];
      
      locationTmp += 64;
      
      dec_picture->imgUV[1][j][k] = predMB[locationTmp];
    }
  }
}

/*!
 ************************************************************************
 * \brief
 *      Calculates a weighted pixel difference between edge Y pixels of the macroblock stored in predMB
 *      and the pixels in the given Y plane of a frame (recY) that would become neighbor pixels if 
 *      predMB was placed at currYBlockNum block position into the frame. This "edge distortion" value
 *      is used to determine how well the given macroblock in predMB would fit into the frame when
 *      considering spatial smoothness. If there are correctly received neighbor blocks (status stored 
 *      in predBlocks) only they are used in calculating the edge distorion; otherwise also the already
 *      concealed neighbor blocks can also be used.
 * \return 
 *      The calculated weighted pixel difference at the edges of the MB.
 * \param predBlocks      
 *      status array of the neighboring blocks (if they are OK, concealed or lost)
 * \param currYBlockNum   
 *      index of the block (8x8) in the Y plane
 * \param predMB          
 *      memory area where the temporary pixel values are stored
 *      the Y,U,V planes are concatenated y = predMB, u = predMB+256, v = predMB+320
 * \param recY            
 *      pointer to a Y plane of a YUV frame
 * \param picSizeX        
 *      picture width in pixels
 * \param regionSize      
 *      can be 16 or 8 to tell the dimension of the region to copy
 ************************************************************************
 */
static int edgeDistortion (int predBlocks[], int currYBlockNum, byte *predMB, 
                           byte *recY, int32 picSizeX, int32 regionSize)
{
  int i, j, distortion, numOfPredBlocks, threshold = ERC_BLOCK_OK;
  byte *currBlock = NULL, *neighbor = NULL;
  int32 currBlockOffset = 0;
  
  currBlock = recY + (yPosYBlock(currYBlockNum,picSizeX)<<3)*picSizeX + (xPosYBlock(currYBlockNum,picSizeX)<<3);
  
  do 
  {
    
    distortion = 0; numOfPredBlocks = 0;
    
    /* loop the 4 neighbours */
    for (j = 4; j < 8; j++) 
    {
      /* if reliable, count boundary pixel difference */
      if (predBlocks[j] >= threshold) 
      {
        
        switch (j) 
        {
        case 4:
          neighbor = currBlock - picSizeX;
          for ( i = 0; i < regionSize; i++ ) 
          {
            distortion += mabs(predMB[i] - neighbor[i]);
          }
          break;          
        case 5:
          neighbor = currBlock - 1;
          for ( i = 0; i < regionSize; i++ ) 
          {
            distortion += mabs(predMB[i*16] - neighbor[i*picSizeX]);
          }
          break;                
        case 6:
          neighbor = currBlock + regionSize*picSizeX;
          currBlockOffset = (regionSize-1)*16;
          for ( i = 0; i < regionSize; i++ ) 
          {
            distortion += mabs(predMB[i+currBlockOffset] - neighbor[i]);
          }
          break;                
        case 7:
          neighbor = currBlock + regionSize;
          currBlockOffset = regionSize-1;
          for ( i = 0; i < regionSize; i++ ) 
          {
            distortion += mabs(predMB[i*16+currBlockOffset] - neighbor[i*picSizeX]);
          }
          break;
        }
        
        numOfPredBlocks++;
      }
    }
    
    threshold--;
    if (threshold < ERC_BLOCK_CONCEALED)
      break;
  } while (numOfPredBlocks == 0);
  
  if(numOfPredBlocks == 0)
    assert (numOfPredBlocks != 0);
  return (distortion/numOfPredBlocks);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产欧美三级| 青青草精品视频| av亚洲精华国产精华精| 国产精品天天看| 色哟哟在线观看一区二区三区| 亚洲精品一二三| 欧美精品久久一区| 精品伊人久久久久7777人| 久久精品视频在线看| 99久久er热在这里只有精品15| 亚洲精品欧美综合四区| 91精品午夜视频| 国产精品1区二区.| 亚洲色图欧美激情| 欧美一区二区视频免费观看| 国产精品一区二区久激情瑜伽 | 亚洲国产精品成人综合色在线婷婷| 国产a视频精品免费观看| 亚洲精品国产高清久久伦理二区| 欧美日韩国产一区| 国产成人在线网站| 亚洲成人免费电影| 国产日韩在线不卡| 91官网在线观看| 国产精一品亚洲二区在线视频| 成人免费一区二区三区视频 | 99精品黄色片免费大全| 午夜久久久影院| 2021久久国产精品不只是精品| 91国产免费看| 国产一区激情在线| 亚洲小说欧美激情另类| 久久综合狠狠综合久久综合88| 在线一区二区三区做爰视频网站| 老司机免费视频一区二区三区| 国产精品美女久久福利网站| 日韩欧美卡一卡二| 欧洲激情一区二区| 国产成人超碰人人澡人人澡| 亚洲www啪成人一区二区麻豆| 国产偷国产偷精品高清尤物| 欧美日韩电影一区| 成人国产电影网| 精品一区二区在线观看| 亚洲国产精品一区二区www在线| 久久久午夜电影| 在线综合视频播放| 色狠狠色噜噜噜综合网| 国产成人精品综合在线观看| 日日嗨av一区二区三区四区| 亚洲人快播电影网| 中文字幕乱码久久午夜不卡| 欧美大胆人体bbbb| 欧美疯狂性受xxxxx喷水图片| 99re热这里只有精品免费视频| 国产福利一区二区三区视频| 免费在线视频一区| 日韩激情中文字幕| 亚洲一区视频在线观看视频| 国产精品久久久久影院老司| 欧美激情综合五月色丁香小说| 精品88久久久久88久久久| 欧美日韩成人综合在线一区二区| 色综合久久中文综合久久97| 波多野结衣亚洲一区| 国产精品一区二区在线看| 美美哒免费高清在线观看视频一区二区 | 日韩国产精品91| 婷婷开心激情综合| 亚洲最新视频在线观看| 一区二区在线电影| 一区二区三区在线免费视频| 亚洲欧美激情在线| 亚洲黄色在线视频| 亚洲中国最大av网站| 亚洲观看高清完整版在线观看| 夜夜嗨av一区二区三区中文字幕 | 欧美精品一区男女天堂| 欧美精品一区二区三区蜜桃视频| 久久综合久色欧美综合狠狠| 精品粉嫩aⅴ一区二区三区四区| 精品噜噜噜噜久久久久久久久试看 | 国产女主播视频一区二区| 亚洲国产成人一区二区三区| 中文字幕av一区二区三区高| 国产精品国产三级国产aⅴ原创| √…a在线天堂一区| 亚洲美女电影在线| 亚洲五月六月丁香激情| 午夜精品123| 久久国产精品99久久人人澡| 国产精品影视天天线| 成人av在线播放网站| 欧美中文字幕一区二区三区亚洲| 欧美少妇性性性| 欧美一区二区三区啪啪| 久久久综合网站| 日韩一区中文字幕| 亚洲成av人片一区二区梦乃| 美女网站一区二区| 成人做爰69片免费看网站| 91色九色蝌蚪| 欧美一区二区免费视频| 久久久久88色偷偷免费| 一区二区三区不卡在线观看| 日本不卡免费在线视频| 国产成人99久久亚洲综合精品| 色综合久久久网| 欧美一区二区国产| 国产亚洲美州欧州综合国| 亚洲精品国产第一综合99久久| 日本一道高清亚洲日美韩| 成人一区在线看| 欧美日本一区二区在线观看| 欧美激情在线看| 婷婷综合五月天| 99精品视频在线观看| 日韩午夜激情av| 亚洲欧美日韩在线播放| 精品亚洲成a人在线观看| 91色乱码一区二区三区| 欧美精品一区二区三区蜜桃视频| 亚洲欧美日韩久久| 国产精品中文字幕一区二区三区| 91国产丝袜在线播放| 国产午夜精品福利| 青青草精品视频| 欧美性大战久久| 亚洲国产高清在线观看视频| 奇米四色…亚洲| 欧洲人成人精品| 亚洲欧洲精品一区二区精品久久久| 青青草原综合久久大伊人精品| 日本乱人伦一区| 日本一区二区成人在线| 国内精品国产成人国产三级粉色 | 91精品国产综合久久国产大片| 国产精品夫妻自拍| 激情欧美一区二区三区在线观看| 欧美日韩精品欧美日韩精品| 亚洲视频精选在线| 成人影视亚洲图片在线| 久久综合九色综合欧美就去吻| 婷婷中文字幕综合| 在线观看欧美精品| 亚洲精品欧美激情| 99精品久久只有精品| 国产精品网友自拍| 国产成a人亚洲精| 国产色综合一区| 国产一区二区三区在线观看免费视频 | 午夜视频久久久久久| 91成人免费网站| 亚洲人成网站影音先锋播放| 99久久久国产精品| 亚洲国产精品激情在线观看| 国产福利不卡视频| 久久久91精品国产一区二区三区| 久草热8精品视频在线观看| 欧美一区二区免费视频| 免费成人av资源网| 日韩欧美一级二级三级久久久| 日韩av电影免费观看高清完整版 | 国产v综合v亚洲欧| 国产日韩欧美电影| 国产激情视频一区二区三区欧美 | 日韩一级免费观看| 青草av.久久免费一区| 欧美一级精品在线| 久久精品999| 国产午夜精品久久久久久久 | 欧美mv和日韩mv国产网站| 久久国产精品第一页| 2023国产精华国产精品| 国产成人在线电影| 亚洲天堂网中文字| 日本精品免费观看高清观看| 亚洲第一福利视频在线| 欧美一区二区美女| 国产福利一区在线观看| 亚洲天堂av一区| 91福利在线免费观看| 天天爽夜夜爽夜夜爽精品视频| 欧美美女一区二区在线观看| 蜜桃久久久久久| 久久久美女毛片| 色婷婷狠狠综合| 日韩中文字幕91| 中文字幕精品一区| 在线观看一区二区精品视频| 婷婷激情综合网| 久久夜色精品国产欧美乱极品| 高清免费成人av| 亚洲成av人综合在线观看| 欧美mv和日韩mv的网站| 成人免费高清视频在线观看| 亚洲国产成人av网| 久久色中文字幕| 欧美午夜视频网站| 国产精品白丝jk白祙喷水网站|