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

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

?? macroblock.c

?? AVS編解碼是學(xué)習(xí)AVS程序開發(fā)的入門資料,可以幫助初學(xué)者獲得很多的收獲.
?? C
?? 第 1 頁 / 共 5 頁
字號:
        mvPredType = MVPRED_L;
    }
  }
  
  #define MEDIAN(a,b,c)  (a + b + c - min(a, min(b, c)) - max(a, max(b, c)));

  for (hv=0; hv < 2; hv++)
  {
    mva[hv] = mv_a = block_available_left    ? tmp_mv[4+pic_block_x-1             ][pic_block_y][hv] : 0;
    mvb[hv] = mv_b = block_available_up      ? tmp_mv[4+pic_block_x               ][pic_block_y-1][hv] : 0;
    mv_d = block_available_upleft  ? tmp_mv[4+pic_block_x-1][pic_block_y-1][hv] : 0;
    mvc[hv] = mv_c = block_available_upright ? tmp_mv[4+pic_block_x+blockshape_x/8][pic_block_y-1][hv] : mv_d;
    //--- Yulj 2004.07.14
    // mv_a, mv_b... are not scaled.
    mva[hv] = scale_motion_vector(mva[hv], ref_frame, rFrameL, smbtypecurr, smbtypeL, pic_block_y-off_y, pic_block_y, ref, direct_mv);
    mvb[hv] = scale_motion_vector(mvb[hv], ref_frame, rFrameU, smbtypecurr, smbtypeU, pic_block_y-y_up, pic_block_y, ref, direct_mv);
    mv_d = scale_motion_vector(mv_d, ref_frame, rFrameUL, smbtypecurr, smbtypeUL, pic_block_y-y_upleft, pic_block_y, ref, direct_mv);
    mvc[hv] = block_available_upright ? scale_motion_vector(mvc[hv], ref_frame, rFrameUR, smbtypecurr, smbtypeUR, pic_block_y-y_upright, pic_block_y, ref, direct_mv): mv_d;
   
    
    switch (mvPredType)
    {
    case MVPRED_MEDIAN:

      if(hv == 1){
          //  jlzheng 7.2
          // !! for A 

          mva[2] = abs(mva[0] - mvb[0])	+ abs(mva[1] - mvb[1]);
          // !! for B

	  mvb[2] = abs(mvb[0] - mvc[0]) + abs(mvb[1] - mvc[1]);
          // !! for C

          mvc[2] = abs(mvc[0] - mva[0])	+ abs(mvc[1] - mva[1]);
          
          pred_vec = MEDIAN(mva[2],mvb[2],mvc[2]);
          
          if(pred_vec == mva[2]){
            *pmv_x = mvc[0];
            *pmv_y = mvc[1];
          }
          else if(pred_vec == mvb[2]){
            *pmv_x = mva[0];
            *pmv_y = mva[1];
          }
          else{
            *pmv_x = mvb[0];
            *pmv_y = mvb[1];
          }   //  END
          

      }
      break;
    case MVPRED_L:
      pred_vec = mv_a;
      break;
    case MVPRED_U:
      pred_vec = mv_b;
      break;
    case MVPRED_UR:
      pred_vec = mv_c;
      break;
    default:
      break;
    }
    
    
    if(mvPredType != MVPRED_MEDIAN){
      if (hv==0)
        *pmv_x = pred_vec;
      else
        *pmv_y = pred_vec;
    }
  }

#undef MEDIAN
}

/*
*************************************************************************
* Function:Checks the availability of neighboring macroblocks of
     the current macroblock for prediction and context determination;
     marks the unavailable MBs for intra prediction in the
     ipredmode-array by -1. Only neighboring MBs in the causal
     past of the current MB are checked.
* Input:
* Output:
* Return: 
* Attention:
*************************************************************************
*/

void CheckAvailabilityOfNeighbors(struct img_par *img)
{
  int i,j;
  const int mb_width = img->width/MB_BLOCK_SIZE;
  const int mb_nr = img->current_mb_nr;
  Macroblock *currMB = &mb_data[mb_nr];
  int check_value;
  
  // mark all neighbors as unavailable
  for (i=0; i<3; i++)
    for (j=0; j<3; j++)
      mb_data[mb_nr].mb_available[i][j]=NULL;

  mb_data[mb_nr].mb_available[1][1]=currMB; // current MB
    
  // Check MB to the left
  if(img->pix_x >= MB_BLOCK_SIZE)
  {
    int remove_prediction = currMB->slice_nr != mb_data[mb_nr-1].slice_nr;
    // upper blocks
    if (remove_prediction)
    {
      img->ipredmode[img->block_x][img->block_y+1] = -1;
      img->ipredmode[img->block_x][img->block_y+2] = -1;
    }
    if (!remove_prediction)
    {
      currMB->mb_available[1][0]=&(mb_data[mb_nr-1]);
    }
  }
  
  // Check MB above
  check_value =  (img->pix_y >= MB_BLOCK_SIZE);
  if(check_value) 
  {
    int remove_prediction = currMB->slice_nr != mb_data[mb_nr-mb_width].slice_nr;
    // upper blocks
    if (remove_prediction)
    {
      img->ipredmode[img->block_x+1][img->block_y] = -1;
      img->ipredmode[img->block_x+2][img->block_y] = -1;
    }
    
    if (!remove_prediction)
    {
      currMB->mb_available[0][1]=&(mb_data[mb_nr-mb_width]);
    }
  }
  
  // Check MB left above
  if(img->pix_y >= MB_BLOCK_SIZE && img->pix_x >= MB_BLOCK_SIZE)
  {
    int remove_prediction = currMB->slice_nr != mb_data[mb_nr-mb_width-1].slice_nr;
    
    if (remove_prediction)
    {
      img->ipredmode[img->block_x][img->block_y] = -1;
    }
    if (!remove_prediction)
    {
      currMB->mb_available[0][0]=&(mb_data[mb_nr-mb_width-1]);
    }
  }
  
  // Check MB right above
  if(img->pix_y >= MB_BLOCK_SIZE && img->pix_x < (img->width-MB_BLOCK_SIZE ))
  {
    if(currMB->slice_nr == mb_data[mb_nr-mb_width+1].slice_nr)
      currMB->mb_available[0][2]=&(mb_data[mb_nr-mb_width+1]);
  }

}

void set_MB_parameters (struct img_par *img,struct inp_par *inp, int mb)
{
  const int number_mb_per_row = img->width / MB_BLOCK_SIZE ;
  const int mb_nr = img->current_mb_nr;
  Macroblock *currMB = &mb_data[mb_nr];

  img->mb_x = mb % number_mb_per_row;
  img->mb_y = mb / number_mb_per_row;

  // Define vertical positions
  img->block8_y= img->mb_y * BLOCK_SIZE/2;
  img->block_y = img->mb_y * BLOCK_SIZE/2;      // vertical luma block position
  img->pix_y   = img->mb_y * MB_BLOCK_SIZE;   // vertical luma macroblock position
  img->pix_c_y = img->mb_y * MB_BLOCK_SIZE/2; // vertical chroma macroblock position

  // Define horizontal positions
  img->block8_x= img->mb_x * BLOCK_SIZE/2;
  img->block_x = img->mb_x * BLOCK_SIZE/2;        // luma block
  img->pix_x   = img->mb_x * MB_BLOCK_SIZE;     // luma pixel
  img->pix_c_x   = img->mb_x * MB_BLOCK_SIZE/2; // chroma pixel

}

/*
*************************************************************************
* Function:initializes the current macroblock
* Input:
* Output:
* Return: 
* Attention:
*************************************************************************
*/


void start_macroblock(struct img_par *img,struct inp_par *inp)
{
  int i,j,k,l;
  Macroblock *currMB;   // intialization code deleted, see below, StW
  
  assert (img->current_mb_nr >=0 && img->current_mb_nr < img->max_mb_nr);
  
  currMB = &mb_data[img->current_mb_nr];//GB
  
  /* Update coordinates of the current macroblock */
  img->mb_x = (img->current_mb_nr)%(img->width/MB_BLOCK_SIZE);
  img->mb_y = (img->current_mb_nr)/(img->width/MB_BLOCK_SIZE);
  
  /* Define vertical positions */
  img->block_y = img->mb_y * BLOCK_SIZE/2;      /* luma block position */
  img->block8_y = img->mb_y * BLOCK_SIZE/2;   
  img->pix_y   = img->mb_y * MB_BLOCK_SIZE;   /* luma macroblock position */
  img->pix_c_y = img->mb_y * MB_BLOCK_SIZE/2; /* chroma macroblock position */
  
  /* Define horizontal positions */
  img->block_x = img->mb_x * BLOCK_SIZE/2;      /* luma block position */
  img->block8_x = img->mb_x * BLOCK_SIZE/2;  
  img->pix_x   = img->mb_x * MB_BLOCK_SIZE;   /* luma pixel position */
  img->pix_c_x = img->mb_x * MB_BLOCK_SIZE/2; /* chroma pixel position */
  
  // If MB is next to a slice boundary, mark neighboring blocks unavailable for prediction
  CheckAvailabilityOfNeighbors(img);      // support only slice mode 0 in MBINTLC1 at this time
  
  // Reset syntax element entries in MB struct
  currMB->qp          = img->qp ;
  currMB->mb_type     = 0;
  currMB->delta_quant = 0;
  currMB->cbp         = 0;
  currMB->cbp_blk     = 0;
  currMB->c_ipred_mode= DC_PRED_8; //GB
  
  for (l=0; l < 2; l++)
    for (j=0; j < BLOCK_MULTIPLE; j++)
      for (i=0; i < BLOCK_MULTIPLE; i++)
        for (k=0; k < 2; k++)
          currMB->mvd[l][j][i][k] = 0;
        
  currMB->cbp_bits   = 0;
        
  // initialize img->m7 for ABT//Lou
  for (j=0; j<MB_BLOCK_SIZE; j++)
    for (i=0; i<MB_BLOCK_SIZE; i++)
      img->m7[i][j] = 0;
       
  for (j=0; j<BLOCK_SIZE; j++)
    for (i=0; i<BLOCK_SIZE; i++)
    {
      img->m8[0][i][j] = 0;
      img->m8[1][i][j] = 0;
    }
  
	 currMB->lf_disable = loop_filter_disable;

	 img->weighting_prediction=0;   //cjw 20051230 default value Weighting Predicition is 0
}

/*
*************************************************************************
* Function:Interpret the mb mode for P-Frames
* Input:
* Output:
* Return: 
* Attention:
*************************************************************************
*/

void interpret_mb_mode_P(struct img_par *img)
{
  int i;
  const int ICBPTAB[6] = {0,16,32,15,31,47};
  Macroblock *currMB = &mb_data[img->current_mb_nr];//GB current_mb_nr];
  int         mbmode = currMB->mb_type;

  if(mbmode <4)
  {
    currMB->mb_type = mbmode;
    for (i=0;i<4;i++)
    {
      currMB->b8mode[i]   = mbmode;
      currMB->b8pdir[i]   = 0;
    }
  }
  else if(MODE_IS_P8x8)
  {
    currMB->mb_type = P8x8;
  }
  else if(/* MODE_IS_I4x4 qhg */mbmode>=5)//modefy by xfwang 2004.7.29
  {
	  currMB->cbp=NCBP[currMB->mb_type-5][0]; // qhg  //modefy by xfwang 2004.7.29
    currMB->mb_type = I4MB;
    for (i=0;i<4;i++)
    {
      currMB->b8mode[i] = IBLOCK;
      currMB->b8pdir[i] = -1;
    }
  }
  else
  {
    currMB->mb_type = I16MB;
    for (i=0;i<4;i++) {currMB->b8mode[i]=0; currMB->b8pdir[i]=-1; }
    currMB->cbp= ICBPTAB[(I16OFFSET)>>2];
  }
}

/*
*************************************************************************
* Function:Interpret the mb mode for I-Frames
* Input:
* Output:
* Return: 
* Attention:
*************************************************************************
*/

void interpret_mb_mode_I(struct img_par *img)
{
  int i;
  const int ICBPTAB[6] = {0,16,32,15,31,47};
  Macroblock *currMB   = &mb_data[img->current_mb_nr];
  int         num      =4;

  currMB->mb_type = I4MB;

  for (i=0;i<4;i++)
  {
    currMB->b8mode[i]=IBLOCK; 
    currMB->b8pdir[i]=-1; 
  }

  for (i=num;i<4;i++) 
  {
    currMB->b8mode[i]=currMB->mb_type_2==P8x8? 4 : currMB->mb_type_2; currMB->b8pdir[i]=0; 
  }
}

/*
*************************************************************************
* Function:Interpret the mb mode for B-Frames
* Input:
* Output:
* Return: 
* Attention:
*************************************************************************
*/

void interpret_mb_mode_B(struct img_par *img)
{
  static const int offset2pdir16x16[12]   = {0, 0, 1, 2, 0,0,0,0,0,0,0,0};
  static const int offset2pdir16x8[22][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{1,1},{0,0},{0,1},{0,0},{1,0},
  {0,0},{0,2},{0,0},{1,2},{0,0},{2,0},{0,0},{2,1},{0,0},{2,2},{0,0}};
  static const int offset2pdir8x16[22][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{1,1},{0,0},{0,1},{0,0},
  {1,0},{0,0},{0,2},{0,0},{1,2},{0,0},{2,0},{0,0},{2,1},{0,0},{2,2}};
  
  const int ICBPTAB[6] = {0,16,32,15,31,47};
  Macroblock *currMB = &mb_data[img->current_mb_nr];//GB current_mb_nr];
  
  int i, mbmode;
  int mbtype  = currMB->mb_type;
  int *b8mode = currMB->b8mode;
  int *b8pdir = currMB->b8pdir;
  
  //--- set mbtype, b8type, and b8pdir ---
	if (mbtype==0)       // direct
	{
		mbmode=0;       for(i=0;i<4;i++) {b8mode[i]=0;          b8pdir[i]=2; }
	}
	else if (/*mbtype==23 qhg */ mbtype>=23) // intra4x4
	{
		currMB->cbp=NCBP[mbtype-23][0]; // qhg
		mbmode=I4MB;    for(i=0;i<4;i++) {b8mode[i]=IBLOCK;     b8pdir[i]=-1; }
	}
	else if (mbtype==22) // 8x8(+split)
	{
		mbmode=P8x8;       // b8mode and pdir is transmitted in additional codewords
	}
	else if (mbtype<4)   // 16x16
	{
		mbmode=1;      
		for(i=0;i<4;i++) {b8mode[i]=1;          b8pdir[i]=offset2pdir16x16[mbtype]; }
	}
	else if (mbtype%2==0) // 16x8
	{
	        mbmode=2;       
		for(i=0;i<4;i++) {b8mode[i]=2;          b8pdir[i]=offset2pdir16x8 [mbtype][i/2]; }
	}
	else
	{
		mbmode=3;       
	 	for(i=0;i<4;i++) {b8mode[i]=3;          b8pdir[i]=offset2pdir8x16 [mbtype][i%2]; }
	}
		
	
	currMB->mb_type = mbmode;
}

/*
*************************************************************************
* Function:init macroblock I and P frames
* Input:
* Output:
* Return: 
* Attention:
*************************************************************************
*/

void init_macroblock(struct img_par *img)
{
  int i,j;
  Macroblock *currMB = &mb_data[img->current_mb_nr];//GB current_mb_nr];
	
  img->mv[img->block_x+4][img->block_y][2]=img->number;
	
  for (i=0;i<2;i++)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲chinese男男1069| 亚洲大尺度视频在线观看| 日本道在线观看一区二区| 日本不卡1234视频| 亚洲激情在线激情| 久久综合久久综合久久综合| 欧美亚洲综合久久| 99麻豆久久久国产精品免费| 另类小说欧美激情| 午夜视频在线观看一区二区三区| 国产精品丝袜一区| 欧美tk丨vk视频| 在线播放欧美女士性生活| av亚洲精华国产精华| 国产一区二区不卡| 另类综合日韩欧美亚洲| 午夜电影一区二区| 亚洲制服丝袜一区| 亚洲图片另类小说| 一色桃子久久精品亚洲| 久久免费国产精品| 精品欧美一区二区在线观看| 欧美精品日韩一区| 在线观看欧美精品| 色综合中文字幕| 97se亚洲国产综合自在线观| 丰满亚洲少妇av| 国产在线乱码一区二区三区| 裸体歌舞表演一区二区| 毛片av一区二区三区| 天堂va蜜桃一区二区三区| 一区二区成人在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 国产欧美日韩视频一区二区| 久久久久青草大香线综合精品| 欧美mv日韩mv国产网站app| 日韩精品一区国产麻豆| 精品久久国产老人久久综合| 日韩一区二区三区免费看| 日韩一级片网址| 日韩欧美一级精品久久| 日韩一区二区三区视频在线| 日韩欧美一卡二卡| 久久综合成人精品亚洲另类欧美| 久久色在线观看| 欧美国产一区视频在线观看| 国产精品乱码人人做人人爱 | 国产在线精品免费av| 久久国产精品第一页| 久久激情五月激情| 国产福利精品导航| www.成人在线| 色婷婷久久综合| 欧美日韩国产一级片| 日韩亚洲欧美成人一区| 久久看人人爽人人| 亚洲欧美在线aaa| 同产精品九九九| 麻豆精品一区二区综合av| 国产乱码精品1区2区3区| 成人中文字幕在线| 91国偷自产一区二区开放时间| 精品1区2区3区| 337p粉嫩大胆色噜噜噜噜亚洲| 久久精品无码一区二区三区| 亚洲女同一区二区| 日本在线观看不卡视频| 国产精品 日产精品 欧美精品| 91丝袜呻吟高潮美腿白嫩在线观看| 91国模大尺度私拍在线视频| 日韩一区二区三区电影 | 国产精品麻豆视频| 亚洲超丰满肉感bbw| 激情小说欧美图片| 色偷偷久久一区二区三区| 91精品在线麻豆| 欧美国产一区二区在线观看| 亚洲v中文字幕| 国产精品 日产精品 欧美精品| 一本到一区二区三区| 精品久久久久久久人人人人传媒| 国产精品女主播在线观看| 亚洲电影欧美电影有声小说| 国产原创一区二区| 色老综合老女人久久久| 欧美成人aa大片| 亚洲综合在线免费观看| 久久精品99国产国产精| 91国产免费观看| 国产丝袜在线精品| 日韩av在线播放中文字幕| 成人av网站大全| 日韩视频在线永久播放| 亚洲精品福利视频网站| 国产做a爰片久久毛片| 91久久香蕉国产日韩欧美9色| 精品国产一区二区在线观看| 亚洲自拍偷拍综合| 丁香一区二区三区| 精品美女在线播放| 香蕉成人伊视频在线观看| 成人激情免费视频| 日韩免费一区二区| 亚洲综合成人网| 99精品一区二区| 欧美韩国一区二区| 国产在线播放一区二区三区| 91精品综合久久久久久| 一区二区三区在线视频播放| 国产电影一区在线| 精品99999| 免费一级欧美片在线观看| 在线视频综合导航| 亚洲欧洲日产国码二区| 国产福利电影一区二区三区| 日韩欧美二区三区| 日韩国产欧美三级| 欧美精选午夜久久久乱码6080| 亚洲免费观看高清完整版在线观看 | 欧美日韩精品系列| 亚洲最新在线观看| 一本大道久久a久久综合婷婷| 国产欧美日韩久久| 国产激情一区二区三区| ww亚洲ww在线观看国产| 久久激情五月婷婷| 日韩精品一区二| 韩国v欧美v亚洲v日本v| 精品国产一区久久| 国产一区二区中文字幕| 久久久久高清精品| 国产精品一区二区三区网站| 欧美精品一区二区久久久| 麻豆91在线看| 久久综合久久鬼色中文字| 国产美女一区二区三区| 久久久久久久久久久久久女国产乱 | 欧美性大战久久久| 亚洲动漫第一页| 欧美日韩中文精品| 午夜国产精品影院在线观看| 91麻豆精品国产91久久久更新时间| 亚洲妇熟xx妇色黄| 91麻豆精品国产综合久久久久久 | 婷婷激情综合网| 91精品国产综合久久久蜜臀粉嫩 | 成人在线一区二区三区| 国产精品乱码一区二三区小蝌蚪| 波波电影院一区二区三区| 中文字幕欧美一| 欧美色视频在线观看| 日av在线不卡| 久久久亚洲高清| av网站一区二区三区| 伊人性伊人情综合网| 欧美午夜片在线看| 久久99在线观看| 久久精品视频免费观看| av日韩在线网站| 午夜精品123| 欧美精品一区二区三| 99在线精品视频| 五月天婷婷综合| 久久精品一二三| 欧美在线免费播放| 久久不见久久见免费视频1| 国产日产欧美一区| 色婷婷精品大视频在线蜜桃视频 | 日韩精品久久久久久| 精品国一区二区三区| 北条麻妃国产九九精品视频| 亚洲一区在线观看视频| 日韩欧美在线123| 91免费观看视频在线| 奇米888四色在线精品| 国产精品视频看| 欧美精品在线视频| 国产成人午夜精品影院观看视频 | 欧美日韩精品一区二区三区蜜桃 | 日本一区二区三区高清不卡| 欧洲国内综合视频| 韩国精品主播一区二区在线观看| 亚洲视频综合在线| 精品国产91乱码一区二区三区| av中文字幕亚洲| 日韩av电影免费观看高清完整版| 国产区在线观看成人精品 | 国产福利一区二区三区视频| 亚洲一区二区三区三| 国产日韩高清在线| 在线不卡a资源高清| 91一区二区三区在线播放| 久久成人麻豆午夜电影| 亚洲黄色片在线观看| 久久综合九色综合欧美98| 欧美日韩www| 91香蕉视频污| 国产麻豆视频一区二区| 视频一区二区三区入口| 中文字幕在线一区免费|