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

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

?? image.c

?? h264標(biāo)準(zhǔn)的VC實現(xiàn)
?? C
?? 第 1 頁 / 共 5 頁
字號:
    stats->bit_ctr_emulationprevention += stats->em_prev_bits_frm;

  if (img->type != B_SLICE)
  {
    img->pstruct_next_P = img->fld_flag;
  }

  // Here, img->structure may be either FRAME or BOTTOM FIELD depending on whether AFF coding is used
  // The picture structure decision changes really only the fld_flag

  if (img->fld_flag)            // field mode (use field when fld_flag=1 only)
  {
    field_mode_buffer (bits_fld, dis_fld_y, dis_fld_u, dis_fld_v);
    writeout_picture (top_pic);
    writeout_picture (bottom_pic);
  }
  else                          //frame mode
  {
    frame_mode_buffer (bits_frm, dis_frm_y, dis_frm_u, dis_frm_v);
    writeout_picture (frame_pic);
  }

  if (frame_pic)
    free_slice_list(frame_pic);
  if (top_pic)
    free_slice_list(top_pic);
  if (bottom_pic)
    free_slice_list(bottom_pic);

  /*
  // Tian Dong (Sept 2002)
  // in frame mode, the newly reconstructed frame has been inserted to the mem buffer
  // and it is time to prepare the spare picture SEI payload.
  if (input->InterlaceCodingOption == FRAME_CODING
      && input->SparePictureOption && img->type != B_SLICE)
    CalculateSparePicture ();
*/

  //Rate control
  if(input->RCEnable)
  {
    bits = stats->bit_ctr-stats->bit_ctr_n;
    rc_update_pict_frame(bits);
  }

/*
    
  if (input->InterlaceCodingOption == FRAME_CODING)
  {
    if (input->rdopt == 2 && img->type != B_SLICE)
      UpdateDecoders ();      // simulate packet losses and move decoded image to reference buffers
    
    if (input->RestrictRef)
      UpdatePixelMap ();
  }
*/

  find_snr ();

  time (&ltime2);               // end time sec
#ifdef WIN32
  _ftime (&tstruct2);           // end time ms
#else
  ftime (&tstruct2);            // end time ms
#endif

  tmp_time = (ltime2 * 1000 + tstruct2.millitm) - (ltime1 * 1000 + tstruct1.millitm);
  tot_time = tot_time + tmp_time;

  if (input->PicInterlace == ADAPTIVE_CODING)
  {
    if (img->fld_flag)
    {
      // store bottom field
      store_picture_in_dpb(enc_bottom_picture);
      free_storable_picture(enc_frame_picture);
    }
    else
    {
      // replace top with frame
      replace_top_pic_with_frame(enc_frame_picture);
      free_storable_picture(enc_bottom_picture);
    }
  }
  else
  {
    if (img->fld_flag)
    {
      store_picture_in_dpb(enc_bottom_picture);
    }
    else
    {
      store_picture_in_dpb(enc_frame_picture);
    }
  }


#ifdef _LEAKYBUCKET_
  // Store bits used for this frame and increment counter of no. of coded frames
  Bit_Buffer[total_frame_buffer] = stats->bit_ctr - stats->bit_ctr_n;
  total_frame_buffer++;
#endif

  // POC200301: Verify that POC coding type 2 is not used if more than one consecutive 
  // non-reference frame is requested or if decoding order is different from output order
  if (img->pic_order_cnt_type == 2)
  {
    if (!img->nal_reference_idc) consecutive_non_reference_pictures++;
    else consecutive_non_reference_pictures = 0;

    if (frame_no < prev_frame_no || consecutive_non_reference_pictures>1)
      error("POC type 2 cannot be applied for the coding pattern where the encoding /decoding order of pictures are different from the output order.\n", -1);
    prev_frame_no = frame_no;
  }

  if (stats->bit_ctr_parametersets_n!=0)
    ReportNALNonVLCBits(tmp_time, me_time);

  if (IMG_NUMBER == 0)
    ReportFirstframe(tmp_time,me_time);
    //ReportFirstframe(tmp_time);
  else
  {
    //Rate control
    if(input->RCEnable)
    {
      if((!input->PicInterlace)&&(!input->MbInterlace))
        bits=stats->bit_ctr-stats->bit_ctr_n;
      else
      {
        bits = stats->bit_ctr -Pprev_bits; // used for rate control update */
        Pprev_bits = stats->bit_ctr;
      }
    }

    switch (img->type)
    {
    case I_SLICE:
      stats->bit_ctr_P += stats->bit_ctr - stats->bit_ctr_n;
	  ReportIntra(tmp_time,me_time);
      //ReportIntra(tmp_time);
      break;
    case SP_SLICE:
      stats->bit_ctr_P += stats->bit_ctr - stats->bit_ctr_n;
      ReportSP(tmp_time,me_time);
      //ReportSP(tmp_time);
      break;
    case B_SLICE:
      stats->bit_ctr_B += stats->bit_ctr - stats->bit_ctr_n;
      if (img->nal_reference_idc>0)
        ReportBS(tmp_time,me_time);
        //ReportBS(tmp_time);
      else
        ReportB(tmp_time,me_time);
        //ReportB(tmp_time);

      break;
    default:      // P
      stats->bit_ctr_P += stats->bit_ctr - stats->bit_ctr_n;
      ReportP(tmp_time,me_time);
      //ReportP(tmp_time);
    }
  }
  stats->bit_ctr_n = stats->bit_ctr;

  //Rate control
  if(input->RCEnable) 
  {
    rc_update_pict(bits);
      /*update the parameters of quadratic R-D model*/
    if((img->type==P_SLICE)&&(active_sps->frame_mbs_only_flag))
      updateRCModel();
    else if((img->type==P_SLICE)&&(!active_sps->frame_mbs_only_flag)\
      &&(img->IFLAG==0))
      updateRCModel();
  }

  stats->bit_ctr_parametersets_n=0;

  FreeSourceframe (srcframe);

  if (IMG_NUMBER == 0)
    return 0;
  else
    return 1;
}


/*!
 ************************************************************************
 * \brief
 *    This function write out a picture
 * \return
 *    0 if OK,                                                         \n
 *    1 in case of error
 *
 ************************************************************************
 */
static int writeout_picture(Picture *pic)
{
  Bitstream *currStream;
  int partition, slice;
  Slice *currSlice;

  img->currentPicture=pic;

  for (slice=0; slice<pic->no_slices; slice++)
  {
    currSlice = pic->slices[slice];
    for (partition=0; partition<currSlice->max_part_nr; partition++)
    {
      currStream = (currSlice->partArr[partition]).bitstream;
      assert (currStream->bits_to_go == 8);    //! should always be the case, the 
                                               //! byte alignment is done in terminate_slice
      writeUnit (currSlice->partArr[partition].bitstream,partition);

    }           // partition loop
  }           // slice loop
  return 0;   
}


/*!
 ************************************************************************
 * \brief
 *    Encodes a frame picture
 ************************************************************************
 */
void frame_picture (Picture *frame)
{

  img->structure = FRAME;
  img->PicSizeInMbs = img->FrameSizeInMbs;

  enc_frame_picture  = alloc_storable_picture (img->structure, img->width, img->height, img->width_cr, img->height_cr);
  img->ThisPOC=enc_frame_picture->poc=img->framepoc;
  enc_frame_picture->top_poc    = img->toppoc;
  enc_frame_picture->bottom_poc = img->bottompoc;

  enc_frame_picture->frame_poc = img->framepoc;

  enc_frame_picture->pic_num = img->frame_num;
  enc_frame_picture->frame_num = img->frame_num;
  enc_frame_picture->coded_frame = 1;

  enc_frame_picture->MbaffFrameFlag = img->MbaffFrameFlag = (input->MbInterlace != FRAME_CODING);

  enc_picture=enc_frame_picture;

  stats->em_prev_bits_frm = 0;
  stats->em_prev_bits = &stats->em_prev_bits_frm;

  if (img->MbaffFrameFlag)
  {
    CopyTopFieldToOldImgOrgVariables (srcframe);
    CopyBottomFieldToOldImgOrgVariables (srcframe);
  }

  img->fld_flag = 0;
  code_a_picture(frame);

  frame->bits_per_picture = 8 * ((((img->currentSlice)->partArr[0]).bitstream)->byte_pos);
  
  if (img->structure==FRAME)
  {
    find_distortion (snr, img);      
    frame->distortion_y = snr->snr_y;
    frame->distortion_u = snr->snr_u;
    frame->distortion_v = snr->snr_v;
  }
}


/*!
 ************************************************************************
 * \brief
 *    Encodes a field picture, consisting of top and bottom field
 ************************************************************************
 */
void field_picture (Picture *top, Picture *bottom)
{
  //Rate control
  int old_pic_type;              // picture type of top field used for rate control    
  int TopFieldBits;
  
  //Rate control
  old_pic_type = img->type;

  stats->em_prev_bits_fld = 0;
  stats->em_prev_bits = &stats->em_prev_bits_fld;
  img->number *= 2;
  img->buf_cycle *= 2;
  img->height = input->img_height / 2; 
  img->height_cr = input->img_height_cr / 2;
  img->fld_flag = 1;
  img->PicSizeInMbs = img->FrameSizeInMbs/2;
  // Top field
  
//  img->bottom_field_flag = 0;
  enc_top_picture  = alloc_storable_picture (img->structure, img->width, img->height, img->width_cr, img->height_cr);
  enc_top_picture->poc=img->toppoc;
  enc_top_picture->frame_poc = img->toppoc;
  enc_top_picture->pic_num = img->frame_num;
  enc_top_picture->frame_num = img->frame_num;
  enc_top_picture->coded_frame = 0;
  enc_top_picture->MbaffFrameFlag = img->MbaffFrameFlag = FALSE;
  img->ThisPOC = img->toppoc;
  
  img->structure = TOP_FIELD;
  enc_picture = enc_top_picture;
  put_buffer_top ();
  init_field ();
  if (img->type == B_SLICE)       //all I- and P-frames
    nextP_tr_fld--;

  CopyTopFieldToOldImgOrgVariables (srcframe);

  img->fld_flag = 1;
//  img->bottom_field_flag = 0;
 
  //Rate control
  if(input->RCEnable)
  {
    img->BasicUnit=input->basicunit;

    if(input->PicInterlace==FIELD_CODING)
      rc_init_pict(0,1,1); 
    else
      rc_init_pict(0,1,0);

    img->qp  = updateQuantizationParameter(1); 
   }
  img->TopFieldFlag=1;

  code_a_picture(top_pic);
  enc_picture->structure = 1;
    
  store_picture_in_dpb(enc_top_picture);

  top->bits_per_picture = 8 * ((((img->currentSlice)->partArr[0]).bitstream)->byte_pos);

  //Rate control
  TopFieldBits=top->bits_per_picture;

  //  Bottom field
//  img->bottom_field_flag = 0;
  enc_bottom_picture  = alloc_storable_picture (img->structure, img->width, img->height, img->width_cr, img->height_cr);
  enc_bottom_picture->poc=img->bottompoc;
  enc_bottom_picture->frame_poc = img->bottompoc;
  enc_bottom_picture->pic_num = img->frame_num;
  enc_bottom_picture->frame_num = img->frame_num;
  enc_bottom_picture->coded_frame = 0;
  enc_bottom_picture->MbaffFrameFlag = img->MbaffFrameFlag = FALSE;
  img->ThisPOC = img->bottompoc;
  img->structure = BOTTOM_FIELD;
  enc_picture = enc_bottom_picture;
  put_buffer_bot ();
  img->number++;

  init_field ();

  if (img->type == B_SLICE)       //all I- and P-frames
    nextP_tr_fld++;             //check once coding B field

 if (img->type == I_SLICE && input->IntraBottom!=1)
    img->type = P_SLICE;

  CopyBottomFieldToOldImgOrgVariables (srcframe);
  img->fld_flag = 1;
//  img->bottom_field_flag = 1;

  //Rate control
  if(input->RCEnable)  setbitscount(TopFieldBits);
  if(input->RCEnable)
  {
    rc_init_pict(0,0,0); 
    img->qp  = updateQuantizationParameter(0); 
  }
  img->TopFieldFlag=0;

  enc_picture->structure = 2;
  code_a_picture(bottom_pic);

  bottom->bits_per_picture = 8 * ((((img->currentSlice)->partArr[0]).bitstream)->byte_pos);

  // the distortion for a field coded frame (consisting of top and bottom field)
  // lives in the top->distortion varaibles, thye bottom-> are dummies
  distortion_fld (&top->distortion_y, &top->distortion_u, &top->distortion_v);

}


/*!
 ************************************************************************
 * \brief
 *    Distortion Field
 ************************************************************************
 */
static void distortion_fld (float *dis_fld_y, float *dis_fld_u, float *dis_fld_v)
{

  img->number /= 2;
  img->buf_cycle /= 2;
  img->height = input->img_height;
  img->height_cr = input->img_height_cr;
  img->total_number_mb =
    (img->width * img->height) / (MB_BLOCK_SIZE * MB_BLOCK_SIZE);

  combine_field ();

  imgY_org = imgY_org_frm;
  imgUV_org = imgUV_org_frm;

  find_distortion (snr, img);   // find snr from original frame picture

  *dis_fld_y = snr->snr_y;
  *dis_fld_u = snr->snr_u;
  *dis_fld_v = snr->snr_v;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产综合色视频| 国产亚洲成年网址在线观看| 国产亚洲综合性久久久影院| 欧美精品精品一区| 美女免费视频一区二区| 精品国产一区二区三区忘忧草| 日精品一区二区| 精品国产1区2区3区| 久久综合色婷婷| 在线亚洲精品福利网址导航| 天天综合日日夜夜精品| 国产农村妇女毛片精品久久麻豆 | 国产成人精品影视| 亚洲精品视频免费观看| 欧美午夜免费电影| 久久电影网电视剧免费观看| 中文字幕欧美日本乱码一线二线 | 一区二区三区精品在线| 欧美xxxxx裸体时装秀| 99久久夜色精品国产网站| 一区二区三区成人| 亚洲国产一区二区a毛片| 亚洲国产精品国自产拍av| **性色生活片久久毛片| 日韩三级视频在线看| 色婷婷精品大在线视频| 九一九一国产精品| 视频在线观看91| 国产91精品精华液一区二区三区| 亚洲午夜免费视频| 国产一区啦啦啦在线观看| 婷婷激情综合网| 国内精品写真在线观看| 日本高清不卡aⅴ免费网站| 北岛玲一区二区三区四区| 国模少妇一区二区三区| 91视频免费播放| 丁香五精品蜜臀久久久久99网站 | 亚洲品质自拍视频| 欧美国产禁国产网站cc| 天天操天天综合网| 国产成人av电影在线| 欧美一区二区福利在线| 欧美日韩专区在线| 在线观看一区二区精品视频| 欧美高清视频不卡网| 国产精品嫩草影院com| 国产午夜精品福利| 日本中文字幕一区二区有限公司| 亚洲午夜影视影院在线观看| 国产精品影音先锋| 成人av中文字幕| av一区二区不卡| 精品成人一区二区| 图片区小说区国产精品视频| 91在线观看地址| 国产精品第13页| 樱花草国产18久久久久| 成人性生交大片免费看在线播放 | 国产精品一区二区三区网站| 91精品婷婷国产综合久久性色| 91亚洲资源网| 久久久www成人免费毛片麻豆| 国产精品丝袜一区| 国模大尺度一区二区三区| 欧美xxxxxxxxx| 激情深爱一区二区| 久久综合色播五月| 精品一区二区在线播放| 精品成人在线观看| 国产成人免费视频一区| 国产女同性恋一区二区| 国v精品久久久网| 中文字幕久久午夜不卡| 国产a久久麻豆| 国产精品久久看| 91蜜桃在线免费视频| 亚洲综合色在线| 精品亚洲国内自在自线福利| 日韩视频国产视频| 狠狠色丁香婷婷综合久久片| 久久久不卡影院| 成人免费va视频| 亚洲综合色自拍一区| 欧美伦理影视网| 精品一区二区日韩| 国产精品天干天干在观线| 99国产精品视频免费观看| 亚洲一卡二卡三卡四卡五卡| 欧美剧在线免费观看网站| 久久er精品视频| 中文字幕精品—区二区四季| 色诱亚洲精品久久久久久| 亚洲精品一区二区三区福利| 国产91在线观看丝袜| 亚洲青青青在线视频| 欧美日韩视频在线第一区 | 久久综合色婷婷| eeuss鲁片一区二区三区| 亚洲综合色自拍一区| 日韩欧美一级二级| 亚洲国产一区二区a毛片| 日韩一卡二卡三卡国产欧美| 国产宾馆实践打屁股91| 一区二区三区精品在线| 欧美精品一区二区蜜臀亚洲| 91麻豆视频网站| 精品少妇一区二区三区免费观看 | 国产在线观看一区二区| 成人欧美一区二区三区小说| 在线不卡免费av| 成人精品国产一区二区4080| 五月天一区二区| 欧美国产乱子伦| 91精品国产综合久久精品| 成人少妇影院yyyy| 亚洲国产人成综合网站| 久久亚区不卡日本| 欧美在线视频你懂得| 国产成人a级片| 人妖欧美一区二区| 欧美日韩视频第一区| 懂色av一区二区夜夜嗨| 日韩成人免费电影| 亚洲三级理论片| 成人精品免费看| 免费av网站大全久久| 一区二区三区精密机械公司| 国产亚洲午夜高清国产拍精品| 在线成人高清不卡| 色综合视频一区二区三区高清| 国产一区在线观看麻豆| 日韩**一区毛片| 日韩高清在线观看| 亚洲sss视频在线视频| 在线观看三级视频欧美| 成人动漫精品一区二区| 韩国一区二区视频| 麻豆精品视频在线| 日本不卡视频在线| 日韩国产一区二| 日韩福利电影在线| 日韩在线一区二区三区| 亚洲免费视频成人| 综合久久给合久久狠狠狠97色| 国产精品美女久久久久久久网站| 精品久久一二三区| 337p日本欧洲亚洲大胆色噜噜| 欧美一区二区三区四区久久| 91麻豆精品国产自产在线观看一区| 色婷婷综合在线| 在线亚洲+欧美+日本专区| 欧美一区二区三区播放老司机| 色偷偷久久人人79超碰人人澡| 色综合中文字幕| 午夜天堂影视香蕉久久| 亚洲午夜免费电影| 日韩av在线免费观看不卡| 亚洲主播在线播放| 天天做天天摸天天爽国产一区 | 亚洲自拍偷拍麻豆| 日韩毛片一二三区| 亚洲午夜一二三区视频| 日韩在线a电影| 狠狠狠色丁香婷婷综合久久五月| 国产综合一区二区| 99久久久久久| 日韩一区二区三区在线视频| 日韩片之四级片| 精品不卡在线视频| 国产午夜精品理论片a级大结局 | 国产亚洲欧美色| 国产精品理论片在线观看| 亚洲精品ww久久久久久p站| 婷婷开心激情综合| 国产精品一区二区三区四区| 色婷婷综合久久| 日韩三级在线观看| 最新日韩av在线| 热久久久久久久| 99国产精品99久久久久久| 欧美日本国产视频| 色综合夜色一区| 欧美狂野另类xxxxoooo| 欧美tk—视频vk| 久久亚洲精品小早川怜子| 欧美国产在线观看| 日韩精品免费专区| a级精品国产片在线观看| 欧美精品 国产精品| 国产精品日韩精品欧美在线| 欧美极品xxx| 美女国产一区二区三区| 色婷婷综合久久久久中文一区二区| 欧美一区二区三区免费在线看 | 久久国产精品99久久久久久老狼| 国产麻豆成人精品| 欧美日韩黄视频| 一区二区三区日韩欧美| 国产精品影视天天线|