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

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

?? slice.c

?? 一個簡單的視頻會議VC++MFC工程文件
?? C
?? 第 1 頁 / 共 2 頁
字號:
        
        // go to the bottom MB in the MB pair
        img->field_mode = 0;  // MB coded as frame  //GB
        
        start_macroblock (CurrentMbAddr+1, FALSE);
        rdopt = &rddata_bot_frame_mb; // store data in top frame MB
        encode_one_macroblock ();     // code the MB as frame
        FrameRDCost += rdopt->min_rdcost;
        
        //***   Bottom MB coded as frame MB ***//
      }

      if ((input->MbInterlace == ADAPTIVE_CODING) || (input->MbInterlace == FIELD_CODING))
      {
        //Rate control
        img->bot_MB = 0; 
        
        // start coding the MB pair as a field MB pair
        img->field_mode = 1;  // MB coded as frame
        img->top_field = 1;   // Set top field to 1
        img->buf_cycle <<= 1;
        input->num_reference_frames <<= 1;
        img->num_ref_idx_l0_active <<= 1;
        img->num_ref_idx_l0_active += 1;
        start_macroblock (CurrentMbAddr, TRUE);
        

        rdopt = &rddata_top_field_mb; // store data in top frame MB 
//        TopFieldIsSkipped = 0;        // set the top field MB skipped flag to 0
        encode_one_macroblock ();     // code the MB as frame
        FieldRDCost = rdopt->min_rdcost;
        //***   Top MB coded as field MB ***//
        //Rate control
        img->bot_MB = 1;//for Rate control

        img->top_field = 0;   // Set top field to 0
        start_macroblock (CurrentMbAddr+1, TRUE);
        rdopt = &rddata_bot_field_mb; // store data in top frame MB 
        encode_one_macroblock ();     // code the MB as frame
        FieldRDCost += rdopt->min_rdcost;
        //***   Bottom MB coded as field MB ***//
      }

      //Rate control
      img->write_macroblock_frame = 0;  //Rate control

      
      // decide between frame/field MB pair
      if ((input->MbInterlace == ADAPTIVE_CODING) && (FrameRDCost < FieldRDCost))
      {
        img->field_mode = 0;
        img->buf_cycle >>= 1;
        input->num_reference_frames >>= 1;
        MBPairIsField = 0;
        img->num_ref_idx_l0_active -= 1;
        img->num_ref_idx_l0_active >>= 1;
        
        //Rate control
        img->write_macroblock_frame = 1;  //for Rate control
      }
      else
      {
        img->field_mode = 1;
        MBPairIsField = 1;
      }
      
      //Rate control
      img->write_macroblock = 1;//Rate control 
      
      if (MBPairIsField)
        img->top_field = 1;
      else
        img->top_field = 0;
      
      //Rate control
      img->bot_MB = 0;// for Rate control

      // go back to the Top MB in the MB pair
      start_macroblock (CurrentMbAddr, img->field_mode);
      
      rdopt =  img->field_mode ? &rddata_top_field_mb : &rddata_top_frame_mb;
      copy_rdopt_data (0);  // copy the MB data for Top MB from the temp buffers
      write_one_macroblock (1);     // write the Top MB data to the bitstream
      NumberOfCodedMBs++;   // only here we are sure that the coded MB is actually included in the slice
      terminate_macroblock (&end_of_slice, &recode_macroblock);     // done coding the Top MB 
      proceed2nextMacroblock (CurrentMbAddr);        // Go to next macroblock
      
      //Rate control
      img->bot_MB = 1;//for Rate control
      // go to the Bottom MB in the MB pair
      img->top_field = 0;
      start_macroblock (CurrentMbAddr+1, img->field_mode);

      rdopt = img->field_mode ? &rddata_bot_field_mb : &rddata_bot_frame_mb;
      copy_rdopt_data (1);  // copy the MB data for Bottom MB from the temp buffers
      
      write_one_macroblock (0);     // write the Bottom MB data to the bitstream
      NumberOfCodedMBs++;   // only here we are sure that the coded MB is actually included in the slice
      terminate_macroblock (&end_of_slice, &recode_macroblock);     // done coding the Top MB 
      proceed2nextMacroblock (CurrentMbAddr);        // Go to next macroblock
      
      if (MBPairIsField)    // if MB Pair was coded as field the buffer size variables back to frame mode
      {
        img->buf_cycle >>= 1;
        input->num_reference_frames >>= 1;
        img->num_ref_idx_l0_active -= 1;
        img->num_ref_idx_l0_active >>= 1;
      }
      img->field_mode = img->top_field = 0; // reset to frame mode
      
      
      // go to next MB pair, not next MB
      CurrentMbAddr = FmoGetNextMBNr (CurrentMbAddr);
      CurrentMbAddr = FmoGetNextMBNr (CurrentMbAddr);
      
      if (CurrentMbAddr == FmoGetLastCodedMBOfSliceGroup (FmoMB2SliceGroup (CurrentMbAddr)))
        end_of_slice = TRUE;        // just in case it does n't get set in terminate_macroblock  
    }
  }  
/*
  // Tian Dong: June 7, 2002 JVT-B042
  // Restore the short_used
  if (input->NumFramesInELSubSeq)
    {
      fb->short_used = short_used;
      img->nb_references = img_ref;
    }
*/
  terminate_slice ();
  return NumberOfCodedMBs;
}



/*!
 ************************************************************************
 * \brief
 *    Initializes the parameters for a new slice and
 *     allocates the memory for the coded slice in the Picture structure
 *  \par Side effects:
 *      Adds slice/partition header symbols to the symbol buffer
 *      increments Picture->no_slices, allocates memory for the
 *      slice, sets img->currSlice
 ************************************************************************
 */
static void init_slice (int start_mb_addr)
{
  int i;
  Picture *currPic = img->currentPicture;
  Slice *curr_slice;
  DataPartition *dataPart;
  Bitstream *currStream;

  img->current_mb_nr = start_mb_addr;

  // Allocate new Slice in the current Picture, and set img->currentSlice
  assert (currPic != NULL);
  currPic->no_slices++;
  if (currPic->no_slices >= MAXSLICEPERPICTURE)
    error ("Too many slices per picture, increase MAXLSICESPERPICTURE in global.h.", -1);
  currPic->slices[currPic->no_slices-1] = malloc_slice();
  curr_slice = currPic->slices[currPic->no_slices-1];
  img->currentSlice = curr_slice;

  curr_slice->picture_id = img->tr % 256;
  curr_slice->qp = img->qp;
  curr_slice->start_mb_nr = start_mb_addr;
  curr_slice->slice_too_big = dummy_slice_too_big;

  for (i = 0; i < curr_slice->max_part_nr; i++)
  {
    dataPart = &(curr_slice->partArr[i]);
    if (input->symbol_mode == UVLC)
      dataPart->writeSyntaxElement = writeSyntaxElement_UVLC;
    else
      dataPart->writeSyntaxElement = writeSyntaxElement_CABAC;
    
    currStream = dataPart->bitstream;
    currStream->bits_to_go = 8;
    currStream->byte_pos = 0;
    currStream->byte_buf = 0;
  }
}


/*!
 ************************************************************************
 * \brief
 *    Allocates a slice structure along with its dependentdata structures
 * \return
 *    Pointer to a Slice
 ************************************************************************
 */
static Slice *malloc_slice()
{
  int i;
  DataPartition *dataPart;
  Slice *slice;
  const int buffer_size = (img->width * img->height * 4); // AH 190202: There can be data expansion with 
                                                          // low QP values. So, we make sure that buffer 
                                                          // does not everflow. 4 is probably safe multiplier.

  if ((slice = (Slice *) calloc(1, sizeof(Slice))) == NULL) no_mem_exit ("malloc_slice: slice structure");

  if (input->symbol_mode == CABAC)
    {
      // create all context models
      slice->mot_ctx = create_contexts_MotionInfo();
      slice->tex_ctx = create_contexts_TextureInfo();
    }

  slice->max_part_nr = input->partition_mode==0?1:3;

	//for IDR img there should be only one partition
	if(img->currentPicture->idr_flag)
		slice->max_part_nr = 1;
  
  assignSE2partition[0] = assignSE2partition_NoDP;
	//ZL 
	//for IDR img all the syntax element shoulde be mapped to one partition        
  if(!img->currentPicture->idr_flag&&input->partition_mode==1)
    assignSE2partition[1] =  assignSE2partition_DP;
	else
    assignSE2partition[1] =  assignSE2partition_NoDP;    		 



  slice->num_mb = 0;          // no coded MBs so far

  if ((slice->partArr = (DataPartition *) calloc(slice->max_part_nr, sizeof(DataPartition))) == NULL) no_mem_exit ("malloc_slice: partArr");
  for (i=0; i<slice->max_part_nr; i++) // loop over all data partitions
  {
    dataPart = &(slice->partArr[i]);
    if ((dataPart->bitstream = (Bitstream *) calloc(1, sizeof(Bitstream))) == NULL) no_mem_exit ("malloc_slice: Bitstream");
    if ((dataPart->bitstream->streamBuffer = (byte *) calloc(buffer_size, sizeof(byte))) == NULL) no_mem_exit ("malloc_slice: StreamBuffer");
    // Initialize storage of bitstream parameters
  }
  return slice;
}


/*!
 ************************************************************************
 * \brief
 *    Memory frees of all Slice structures and of its dependent
 *    data structures
 * \par Input:
 *    Image Parameters struct struct img_par *img
 ************************************************************************
 */
void free_slice_list(Picture *currPic)
{
  int i;

  for (i=0; i<currPic->no_slices; i++)
  {
    free_slice (currPic->slices[i]);
    currPic->slices[i]=NULL;
  }
}


/*!
 ************************************************************************
 * \brief
 *    Memory frees of the Slice structure and of its dependent
 *    data structures
 * \param slice:
 *    Slice to be freed
 ************************************************************************
 */
static void free_slice(Slice *slice)
{
  int i;
  DataPartition *dataPart;

  if (slice != NULL)
  {
    for (i=0; i<slice->max_part_nr; i++) // loop over all data partitions
    {
      dataPart = &(slice->partArr[i]);
      if (dataPart != NULL)
      {
        if (dataPart->bitstream->streamBuffer != NULL)
          free(dataPart->bitstream->streamBuffer);
        if (dataPart->bitstream != NULL)
          free(dataPart->bitstream);
      }
    }
    if (slice->partArr != NULL)
      free(slice->partArr);
    if (input->symbol_mode == CABAC)
    {
      delete_contexts_MotionInfo(slice->mot_ctx);
      delete_contexts_TextureInfo(slice->tex_ctx);
    }
    //free(img->currentSlice);
    free(slice);
  }
}


/*!
 ************************************************************************
 * \brief
 *    This function set the value of a bit in a bitstream to 1
 ************************************************************************
 */
void modify_redundant_pic_cnt(unsigned char *buffer)
{
  unsigned char tmp = 1 << (rpc_bits_to_go-1);
  buffer[rpc_bytes_to_go] |= tmp;
}

void set_ref_pic_num()
{
  int i,j;
  
  //! need to add field ref_pic_num that handles field pair.

  for (i=0;i<listXsize[LIST_0];i++)
  {
    enc_picture->ref_pic_num        [LIST_0][i]=listX[LIST_0][i]->poc * 2 + ((listX[LIST_0][i]->structure==BOTTOM_FIELD)?1:0) ; 
    enc_picture->frm_ref_pic_num    [LIST_0][i]=listX[LIST_0][i]->frame_poc * 2; 
    enc_picture->top_ref_pic_num    [LIST_0][i]=listX[LIST_0][i]->top_poc * 2; 
    enc_picture->bottom_ref_pic_num [LIST_0][i]=listX[LIST_0][i]->bottom_poc * 2 + 1; 
  }

  for (i=0;i<listXsize[LIST_1];i++)
  {
    enc_picture->ref_pic_num        [LIST_1][i]=listX[LIST_1][i]->poc  *2 + ((listX[LIST_1][i]->structure==BOTTOM_FIELD)?1:0);
    enc_picture->frm_ref_pic_num    [LIST_1][i]=listX[LIST_1][i]->frame_poc * 2; 
    enc_picture->top_ref_pic_num    [LIST_1][i]=listX[LIST_1][i]->top_poc * 2; 
    enc_picture->bottom_ref_pic_num [LIST_1][i]=listX[LIST_1][i]->bottom_poc * 2 + 1; 
  }

  if (img->structure==FRAME)
    for (j=2;j<6;j++)
      for (i=0;i<listXsize[j];i++)
      {    
        enc_picture->ref_pic_num[j][i] = listX[j][i]->poc * 2 + ((listX[j][i]->structure==BOTTOM_FIELD)?1:0);
        enc_picture->frm_ref_pic_num[j][i] = listX[j][i]->frame_poc * 2 ;
        enc_picture->top_ref_pic_num[j][i] = listX[j][i]->top_poc * 2 ;
        enc_picture->bottom_ref_pic_num[j][i] = listX[j][i]->bottom_poc * 2 + 1;
      }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区在线视频| 91香蕉国产在线观看软件| 成人h动漫精品一区二| av在线播放不卡| 在线播放欧美女士性生活| 久久午夜色播影院免费高清| 亚洲免费av高清| 免费成人深夜小野草| 丁香亚洲综合激情啪啪综合| 欧美日韩一区视频| 久久久亚洲综合| 亚洲精品乱码久久久久久久久| 日韩综合小视频| 不卡电影一区二区三区| 欧美一区二区三区四区五区| 国产精品久久久久一区| 奇米777欧美一区二区| 成人天堂资源www在线| 欧美二区在线观看| 中文字幕一区二区三区精华液| 性做久久久久久久久| 国产成人av电影在线| 欧美日本在线播放| 最新成人av在线| 精品一区二区在线播放| 91久久精品日日躁夜夜躁欧美| 欧美精品一区二区三区在线播放| 亚洲午夜免费福利视频| 粉嫩在线一区二区三区视频| 日韩亚洲欧美一区| 亚洲一区自拍偷拍| 99久久久无码国产精品| 欧美不卡123| 婷婷久久综合九色国产成人| 91美女福利视频| 国产午夜三级一区二区三| 日韩在线卡一卡二| 在线免费观看不卡av| 欧美激情一区二区在线| 极品美女销魂一区二区三区免费| 91在线观看高清| 国产欧美日韩卡一| 狠狠色狠狠色合久久伊人| 欧美精品18+| 亚洲国产裸拍裸体视频在线观看乱了| 北条麻妃一区二区三区| 国产日产亚洲精品系列| 国内精品不卡在线| 日韩精品中文字幕在线一区| 天天色图综合网| 在线免费不卡视频| 有坂深雪av一区二区精品| 高清国产午夜精品久久久久久| 亚洲精品一区二区三区精华液| 日韩影院免费视频| 717成人午夜免费福利电影| 亚洲一区精品在线| 色哟哟日韩精品| 亚洲美女视频在线观看| 91免费视频网| 日韩理论电影院| 99精品欧美一区| 国产精品国产馆在线真实露脸| 成人性生交大片免费| 国产午夜精品理论片a级大结局| 韩国av一区二区三区| 精品久久久久香蕉网| 久久99久久99| 久久精品人人做| 国产成人在线看| 中文在线一区二区| 99精品视频在线播放观看| 亚洲欧美自拍偷拍| 91啦中文在线观看| 亚洲精品日韩一| 91福利区一区二区三区| 亚洲香肠在线观看| 欧美精品一二三区| 免费成人小视频| 久久久久久久久久看片| 国产suv一区二区三区88区| 欧美国产日韩一二三区| 94色蜜桃网一区二区三区| 亚洲一区国产视频| 日韩一区二区三区在线视频| 国产一区二区在线观看免费 | 亚洲小说欧美激情另类| 欧美日韩在线播放| 久久精品久久精品| 国产日韩欧美电影| 91丨porny丨在线| 一区二区三区日本| 欧美一区二区精品在线| 国产河南妇女毛片精品久久久| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | eeuss影院一区二区三区| 亚洲欧美日韩在线不卡| 欧美精品第1页| 国产九九视频一区二区三区| 中文字幕亚洲一区二区av在线| 欧美中文字幕一二三区视频| 日本欧美一区二区三区| 国产人久久人人人人爽| 日本韩国精品在线| 蜜桃av噜噜一区| 国产精品欧美久久久久一区二区| 91国偷自产一区二区开放时间| 免费成人在线视频观看| 国产精品婷婷午夜在线观看| 欧美日韩免费电影| 国产乱一区二区| 一区二区三区免费观看| 日韩精品中文字幕在线不卡尤物 | 最新热久久免费视频| 欧美日韩午夜精品| 国产精品一区在线观看你懂的| 亚洲免费观看在线观看| 欧美电影免费观看高清完整版在| 成人午夜电影久久影院| 日日欢夜夜爽一区| 国产欧美精品一区二区色综合朱莉 | 日韩精品一区二区三区视频播放| 成人av先锋影音| 三级成人在线视频| 中文字幕日韩精品一区| 日韩欧美中文一区二区| 99久久精品久久久久久清纯| 蜜臀av一区二区三区| 亚洲精品水蜜桃| 2欧美一区二区三区在线观看视频| 99re这里只有精品视频首页| 精品在线视频一区| 亚洲综合区在线| 国产亚洲美州欧州综合国| 欧美日韩国产高清一区二区三区| 成人免费毛片a| 蜜臀久久99精品久久久画质超高清| 亚洲青青青在线视频| 国产亚洲一区字幕| 91精品国产欧美一区二区18| 91黄视频在线观看| 成人黄色免费短视频| 久久精品国产亚洲a| 亚洲三级免费观看| 中文字幕不卡三区| 日韩精品资源二区在线| 欧美日韩国产系列| 色综合久久综合| 成人综合婷婷国产精品久久| 蜜臀a∨国产成人精品| 亚洲福利一二三区| 亚洲狠狠丁香婷婷综合久久久| 国产精品美日韩| 26uuu国产在线精品一区二区| 欧美精品第1页| 精品1区2区3区| 在线欧美小视频| 色婷婷激情久久| 99久久久久久| fc2成人免费人成在线观看播放 | 国产精品久久99| 久久精品视频网| 精品国产精品一区二区夜夜嗨| 777久久久精品| 欧美日韩在线观看一区二区| 日本道色综合久久| 一本久道中文字幕精品亚洲嫩 | 一区二区成人在线| 亚洲欧美日韩国产综合在线| 国产精品妹子av| 国产精品免费视频观看| 日本一区二区在线不卡| 337p粉嫩大胆噜噜噜噜噜91av| 欧美一级黄色片| 91精品欧美综合在线观看最新| 欧美日韩亚洲综合| 欧美精品九九99久久| 欧美精品久久久久久久久老牛影院 | 日本一区二区不卡视频| 国产亚洲美州欧州综合国| 国产日韩欧美精品一区| 国产日韩v精品一区二区| 欧美国产视频在线| 中文字幕人成不卡一区| 亚洲人妖av一区二区| 亚洲人一二三区| 亚洲永久免费视频| 午夜一区二区三区视频| 日韩电影在线观看网站| 日韩中文字幕区一区有砖一区| 秋霞电影网一区二区| 日产精品久久久久久久性色| 免费高清不卡av| 国产麻豆欧美日韩一区| 成人久久久精品乱码一区二区三区| 成人av免费在线播放| 一本色道久久综合狠狠躁的推荐| 欧美亚洲国产bt| 91精选在线观看| 精品福利一区二区三区|