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

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

?? image.c

?? 一個簡單的視頻會議VC++MFC工程文件
?? C
?? 第 1 頁 / 共 5 頁
字號:
          img->qp+= (1 + img->rd_pass);
        
        if (img->type == P_SLICE && input->GenerateMultiplePPS && (intras * 100 )/img->FrameSizeInMbs >=80)
        {
          img->type=I_SLICE;
          active_pps = &PicParSet[0];
        }

        img->write_macroblock = 0;
        
        frame_picture (frame_pic3,2);

        if (img->rd_pass==0)
          img->rd_pass=2*picture_coding_decision(frame_pic, frame_pic3, rd_qp);
        else
          img->rd_pass+=picture_coding_decision(frame_pic2, frame_pic3, rd_qp);

        //update_rd_picture_contexts (img->rd_pass); 
        if (img->rd_pass==0)
        {
          enc_picture=enc_frame_picture;
          if (input->GenerateMultiplePPS)
            active_pps = &PicParSet[0];
          else        
            img->qp=rd_qp;
        }
        else if (img->rd_pass==1)
        {
          enc_picture=enc_frame_picture2;
          if (input->GenerateMultiplePPS)
            active_pps = &PicParSet[1];
          else        
            img->qp=rd_qp-1;
        }       
      }
    }         
    
    // For field coding, turn MB level field/frame coding flag off
    if (input->MbInterlace)
      mb_adaptive = 0;
    
    if (input->PicInterlace == ADAPTIVE_CODING)
    {
      //Rate control
      img->FieldControl=1;
      img->write_macroblock = 0;
      img->bot_MB = 0;

      img->field_picture = 1;  // we encode fields
      field_picture (top_pic, bottom_pic);
      
      //! Note: the distortion for a field coded picture is stored in the top field
      //! the distortion values in the bottom field are dummies
      dis_fld = top_pic->distortion_y + top_pic->distortion_u + top_pic->distortion_v;
      dis_frm = frame_pic->distortion_y + frame_pic->distortion_u + frame_pic->distortion_v;
      
      img->fld_flag = picture_structure_decision (frame_pic, top_pic, bottom_pic);
      update_field_frame_contexts (img->fld_flag);

      //Rate control
      if(img->fld_flag==0)
        img->FieldFrame=1;
      /*the current choice is field coding*/
      else
        img->FieldFrame=0;
    }
    else
   
      img->fld_flag = 0;
  }

  if (img->fld_flag)
    stats->bit_ctr_emulationprevention += stats->em_prev_bits_fld;
  else
    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);
    
    if (input->RDPictureDecision && img->rd_pass == 2)
      writeout_picture (frame_pic3);
    else if (input->RDPictureDecision && img->rd_pass == 1)
      writeout_picture (frame_pic2);
    else
      writeout_picture (frame_pic);
  }

  if (frame_pic3)
    free_slice_list(frame_pic3);  
  if (frame_pic2)
    free_slice_list(frame_pic2);  
  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 == 3 && 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
    {
      if (img->rd_pass==2)
        store_picture_in_dpb(enc_frame_picture3);
      else if (img->rd_pass==1)
        store_picture_in_dpb(enc_frame_picture2);
      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);
      break;
    case SP_SLICE:
      stats->bit_ctr_P += stats->bit_ctr - stats->bit_ctr_n;
      ReportSP(tmp_time,me_time);
      break;
    case B_SLICE:
      stats->bit_ctr_B += stats->bit_ctr - stats->bit_ctr_n;
      if (img->nal_reference_idc>0)
        ReportRB(tmp_time,me_time);
      else
        ReportB(tmp_time,me_time);

      break;
    default:      // P
      stats->bit_ctr_P += stats->bit_ctr - stats->bit_ctr_n;
      ReportP(tmp_time,me_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;

  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;   
}


void copy_params()
{
  enc_picture->frame_mbs_only_flag = active_sps->frame_mbs_only_flag;
  enc_picture->frame_cropping_flag = active_sps->frame_cropping_flag;
  enc_picture->chroma_format_idc   = active_sps->chroma_format_idc;

  if (active_sps->frame_cropping_flag)
  {
    enc_picture->frame_cropping_rect_left_offset=active_sps->frame_cropping_rect_left_offset; 
    enc_picture->frame_cropping_rect_right_offset=active_sps->frame_cropping_rect_right_offset; 
    enc_picture->frame_cropping_rect_top_offset=active_sps->frame_cropping_rect_top_offset; 
    enc_picture->frame_cropping_rect_bottom_offset=active_sps->frame_cropping_rect_bottom_offset; 
  }
  else
  {
    enc_picture->frame_cropping_rect_left_offset=0; 
    enc_picture->frame_cropping_rect_right_offset=0; 
    enc_picture->frame_cropping_rect_top_offset=0; 
    enc_picture->frame_cropping_rect_bottom_offset=0; 
  }
}

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

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

  if (rd_pass == 2)
  {
    enc_frame_picture3  = alloc_storable_picture (img->structure, img->width, img->height, img->width_cr, img->height_cr);
    img->ThisPOC=enc_frame_picture3->poc=img->framepoc;
    enc_frame_picture3->top_poc    = img->toppoc;
    enc_frame_picture3->bottom_poc = img->bottompoc;
    
    enc_frame_picture3->frame_poc = img->framepoc;
    
    enc_frame_picture3->pic_num = img->frame_num;
    enc_frame_picture3->frame_num = img->frame_num;
    enc_frame_picture3->coded_frame = 1;
    
    enc_frame_picture3->MbaffFrameFlag = img->MbaffFrameFlag = (input->MbInterlace != FRAME_CODING);
    
    enc_picture=enc_frame_picture3;
    copy_params();
  }
  else if (rd_pass == 1)
  {
    enc_frame_picture2  = alloc_storable_picture (img->structure, img->width, img->height, img->width_cr, img->height_cr);
    img->ThisPOC=enc_frame_picture2->poc=img->framepoc;
    enc_frame_picture2->top_poc    = img->toppoc;
    enc_frame_picture2->bottom_poc = img->bottompoc;
    
    enc_frame_picture2->frame_poc = img->framepoc;
    
    enc_frame_picture2->pic_num = img->frame_num;
    enc_frame_picture2->frame_num = img->frame_num;
    enc_frame_picture2->coded_frame = 1;
    
    enc_frame_picture2->MbaffFrameFlag = img->MbaffFrameFlag = (input->MbInterlace != FRAME_CODING);
    
    enc_picture=enc_frame_picture2;
    copy_params();
  }
  else
  {
    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;
    copy_params();
  }


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

  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
 ************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
首页国产欧美久久| 亚洲图片激情小说| 一本一道久久a久久精品 | 欧美日韩午夜影院| 蜜桃精品视频在线| 亚洲在线观看免费| 亚洲天堂久久久久久久| 久久久精品欧美丰满| 91精品国产综合久久久久久久久久 | 99久久99久久精品免费看蜜桃| 午夜激情久久久| 亚洲图片激情小说| 亚洲少妇屁股交4| 中文字幕永久在线不卡| 国产精品久久久久久久久久免费看| 精品少妇一区二区三区| 久久久综合激的五月天| 久久一二三国产| 久久久91精品国产一区二区精品| 久久综合久久鬼色| 26uuu国产日韩综合| 26uuu国产在线精品一区二区| 欧美成人a视频| 久久久久久黄色| 国产精品国产a| 亚洲在线成人精品| 另类小说视频一区二区| 国产精品一区二区久久不卡 | 一本到不卡精品视频在线观看| 成人动漫av在线| 在线看国产一区| 日韩视频免费直播| 久久久精品国产99久久精品芒果| 亚洲国产成人一区二区三区| 免费成人结看片| 国产在线播放一区三区四| 国产91丝袜在线观看| 91久久精品一区二区| 日韩女优av电影| 亚洲欧美一区二区久久| 男人的j进女人的j一区| 成人av电影在线网| 51精品国自产在线| 综合久久久久综合| 久久国产生活片100| 91免费版在线看| 日韩三级在线免费观看| 亚洲欧美激情视频在线观看一区二区三区 | 国产91精品一区二区麻豆亚洲| 欧美色视频在线| 亚洲欧洲成人自拍| 国产三级精品视频| 免费看欧美美女黄的网站| 一本色道久久综合亚洲aⅴ蜜桃| 精品国产乱码久久久久久闺蜜| 欧美aⅴ一区二区三区视频| 成人黄色在线看| 久久网站热最新地址| 蜜臀va亚洲va欧美va天堂| 色综合色狠狠天天综合色| 中文字幕av在线一区二区三区| 奇米在线7777在线精品| 欧美中文字幕不卡| 亚洲精品大片www| 95精品视频在线| 亚洲欧美日韩电影| 色婷婷综合久久久| 最新国产成人在线观看| 色成年激情久久综合| 国产精品美日韩| 91麻豆国产香蕉久久精品| ●精品国产综合乱码久久久久| 97久久精品人人做人人爽50路| 中文字幕在线观看不卡视频| av一二三不卡影片| 亚洲一区中文日韩| 欧美精品三级日韩久久| 免费成人小视频| 欧美国产乱子伦| 欧美色男人天堂| 午夜精品123| 国产亚洲制服色| 91视视频在线观看入口直接观看www| 国产精品第13页| 国产99一区视频免费| 国产精品久久久久久久久果冻传媒 | 国产日韩精品久久久| 欧洲av一区二区嗯嗯嗯啊| 欧美成va人片在线观看| 日本女人一区二区三区| 亚洲国产婷婷综合在线精品| 国产精品色在线| 97久久超碰精品国产| 视频精品一区二区| 中文字幕免费观看一区| 欧美色视频一区| 国产一区二区三区在线看麻豆| 久久久久久久久伊人| 一本大道久久a久久精二百| 奇米色一区二区| 亚洲成人资源在线| 国产精品美日韩| 国产精品嫩草久久久久| 国产精品网友自拍| 日韩视频免费观看高清完整版在线观看 | 97国产精品videossex| 亚洲国产精品欧美一二99| 久久理论电影网| 欧美国产精品专区| 中文字幕中文乱码欧美一区二区 | |精品福利一区二区三区| 久久久精品日韩欧美| 精品国产一区二区三区不卡| 欧美日韩精品一区二区三区四区| 成人av资源在线观看| 粉嫩嫩av羞羞动漫久久久| 国产盗摄精品一区二区三区在线| 日本不卡1234视频| 青青草成人在线观看| 蜜桃av一区二区三区| 蜜臀国产一区二区三区在线播放| 婷婷夜色潮精品综合在线| 午夜电影网一区| 精品在线视频一区| 岛国av在线一区| 99精品国产热久久91蜜凸| 91成人免费在线| 欧美日本一道本在线视频| 4438成人网| 久久九九久久九九| 中文字幕欧美一| 五月激情综合婷婷| 国产一区999| 色系网站成人免费| 欧美高清hd18日本| 亚洲国产成人午夜在线一区| 亚洲美女在线一区| 日本大胆欧美人术艺术动态| 国产91丝袜在线播放0| 91福利视频久久久久| 精品国产乱码久久久久久蜜臀| 欧美国产综合一区二区| 亚洲国产va精品久久久不卡综合| 蜜臂av日日欢夜夜爽一区| 波波电影院一区二区三区| 欧美一区二区精品在线| 亚洲欧洲性图库| 另类人妖一区二区av| 91蝌蚪国产九色| 亚洲国产精品精华液2区45| 石原莉奈在线亚洲二区| www.亚洲在线| 欧美变态口味重另类| 亚洲国产乱码最新视频| 成人免费精品视频| 久久理论电影网| 久久99精品国产麻豆婷婷| 精品视频在线免费看| 亚洲欧洲精品天堂一级| 国产在线精品视频| 精品三级在线看| 日本美女一区二区| 91精品国产综合久久精品| 亚洲午夜成aⅴ人片| 欧美亚洲一区三区| 亚洲黄色录像片| 欧美日韩精品一区视频| 午夜久久久久久| 欧美一级片在线看| 精品一区在线看| 久久噜噜亚洲综合| 成人黄色网址在线观看| 国产精品女主播在线观看| 成人国产免费视频| 亚洲欧美综合色| 欧洲生活片亚洲生活在线观看| 亚洲精品大片www| 日韩手机在线导航| 国产成人午夜精品5599| 国产精品美女视频| 久久激情综合网| 欧美午夜影院一区| 久久综合九色欧美综合狠狠| 大尺度一区二区| 久久99久国产精品黄毛片色诱| 亚洲色图一区二区| 精品国产乱码久久久久久久| 在线看一区二区| 国产**成人网毛片九色| 亚洲激情校园春色| 精品国产乱码久久久久久老虎| www.久久精品| 婷婷综合久久一区二区三区| 久久久亚洲午夜电影| 色国产精品一区在线观看| 国产美女在线精品| 日韩不卡一二三区| 自拍偷拍亚洲综合| 中文成人综合网| 精品女同一区二区|