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

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

?? b_frame.c

?? TML的參考源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
***********************************************************************
* COPYRIGHT AND WARRANTY INFORMATION
*
* Copyright 2001, International Telecommunications Union, Geneva
*
* DISCLAIMER OF WARRANTY
*
* These software programs are available to the user without any
* license fee or royalty on an "as is" basis. The ITU disclaims
* any and all warranties, whether express, implied, or
* statutory, including any implied warranties of merchantability
* or of fitness for a particular purpose.  In no event shall the
* contributor or the ITU be liable for any incidental, punitive, or
* consequential damages of any kind whatsoever arising from the
* use of these programs.
*
* This disclaimer of warranty extends to the user of these programs
* and user's customers, employees, agents, transferees, successors,
* and assigns.
*
* The ITU does not represent or warrant that the programs furnished
* hereunder are free of infringement of any third-party patents.
* Commercial implementations of ITU-T Recommendations, including
* shareware, may be subject to royalty fees to patent holders.
* Information regarding the ITU-T patent policy is available from
* the ITU Web site at http://www.itu.int.
*
* THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE ITU-T PATENT POLICY.
************************************************************************
*/

/*!
 *************************************************************************************
 * \file b_frame.c
 *
 * \brief
 *    B picture decoding
 *
 * \author
 *    Main contributors (see contributors.h for copyright, address and affiliation details)
 *    - Byeong-Moon Jeon                <jeonbm@lge.com>
 *    - Yoon-Seong Soh                  <yunsung@lge.com>
 *    - Thomas Wedi                     <wedi@tnt.uni-hannover.de>
 *************************************************************************************
 */

#include <stdlib.h>
#include <math.h>
#include <string.h>

#include "global.h"
#include "mbuffer.h"
#include "b_frame.h"
#include "elements.h"

#define POS 0

/*!
 ************************************************************************
 * \brief
 *    Write previous decoded P frame to output file
 ************************************************************************
 */
void write_prev_Pframe(struct img_par *img, FILE *p_out)
{
  int i,j;

  for(i=0;i<img->height;i++)
    for(j=0;j<img->width;j++)
      fputc(imgY_prev[i][j],p_out);

  for(i=0;i<img->height_cr;i++)
    for(j=0;j<img->width_cr;j++)
      fputc(imgUV_prev[0][i][j],p_out);

  for(i=0;i<img->height_cr;i++)
    for(j=0;j<img->width_cr;j++)
      fputc(imgUV_prev[1][i][j],p_out);
}



/*!
 ************************************************************************
 * \brief
 *    Copy decoded P frame to temporary image array
 ************************************************************************
 */
void copy_Pframe(struct img_par *img, int postfilter)
{
  int i,j;

  /*
   * the mmin, mmax macros are taken out, because it makes no sense due to limited range of data type
   */

  if(postfilter)
  {
    for(i=0;i<img->height;i++)
      for(j=0;j<img->width;j++)
      {
        imgY_prev[i][j] = imgY_pf[i][j];
      }
    for(i=0;i<img->height_cr;i++)
      for(j=0;j<img->width_cr;j++)
      {
        imgUV_prev[0][i][j] = imgUV_pf[0][i][j];
      }
    for(i=0;i<img->height_cr;i++)
      for(j=0;j<img->width_cr;j++)
      {
        imgUV_prev[1][i][j] = imgUV_pf[1][i][j];
      }
  }
  else
  {
    for(i=0;i<img->height;i++)
      for(j=0;j<img->width;j++)
      {
        imgY_prev[i][j] = imgY[i][j];
      }
    for(i=0;i<img->height_cr;i++)
      for(j=0;j<img->width_cr;j++)
      {
        imgUV_prev[0][i][j] = imgUV[0][i][j];
      }
    for(i=0;i<img->height_cr;i++)
      for(j=0;j<img->width_cr;j++)
      {
        imgUV_prev[1][i][j] = imgUV[1][i][j];
      }
  }
}




/*!
 ************************************************************************
 * \brief
 *    init macroblock B frames
 ************************************************************************
 */
void init_macroblock_Bframe(struct img_par *img)
{
  int i,j;
  int fw_predframe_no=0;
    Macroblock *currMB = &img->mb_data[img->current_mb_nr];

    currMB->ref_frame = 0;
    currMB->predframe_no = 0;


  // reset vectors and pred. modes
  for (i=0;i<BLOCK_SIZE;i++)
  {
    for(j=0;j<BLOCK_SIZE;j++)
    {
      img->fw_mv[img->block_x+i+4][img->block_y+j][0]=img->fw_mv[img->block_x+i+4][img->block_y+j][1]=0;
      img->bw_mv[img->block_x+i+4][img->block_y+j][0]=img->bw_mv[img->block_x+i+4][img->block_y+j][1]=0;
      img->dfMV[img->block_x+i+4][img->block_y+j][0]=img->dfMV[img->block_x+i+4][img->block_y+j][1]=0;
      img->dbMV[img->block_x+i+4][img->block_y+j][0]=img->dbMV[img->block_x+i+4][img->block_y+j][1]=0;
      img->ipredmode[img->block_x+i+1][img->block_y+j+1] = 0;
    }
  }

  // Set the reference frame information for motion vector prediction
  if (img->imod==INTRA_MB_OLD || img->imod==INTRA_MB_NEW)
  {
    for (j = 0;j < BLOCK_SIZE;j++)
    {
      for (i = 0;i < BLOCK_SIZE;i++)
      {
        img->fw_refFrArr[img->block_y+j][img->block_x+i] =
        img->bw_refFrArr[img->block_y+j][img->block_x+i] = -1;
      }
    }
  }
  else if(img->imod == B_Forward)
  {
    for (j = 0;j < BLOCK_SIZE;j++)
    {
      for (i = 0;i < BLOCK_SIZE;i++)
      {
        img->fw_refFrArr[img->block_y+j][img->block_x+i] = fw_predframe_no; // previous P
        img->bw_refFrArr[img->block_y+j][img->block_x+i] = -1;
      }
    }
  }
  else if(img->imod == B_Backward)
  {
    for (j = 0;j < BLOCK_SIZE;j++)
    {
      for (i = 0;i < BLOCK_SIZE;i++)
      {
        img->fw_refFrArr[img->block_y+j][img->block_x+i] = -1;
        img->bw_refFrArr[img->block_y+j][img->block_x+i] = 0; // next P
      }
    }
  }
  else if(img->imod == B_Bidirect)
  {
    for (j = 0;j < BLOCK_SIZE;j++)
    {
      for (i = 0;i < BLOCK_SIZE;i++)
      {
        img->fw_refFrArr[img->block_y+j][img->block_x+i] = fw_predframe_no; // previous P
        img->bw_refFrArr[img->block_y+j][img->block_x+i] = 0; // next P
      }
    }
  }
  else if(img->imod == B_Direct)
  {
    for (j = 0;j < BLOCK_SIZE;j++)
    {
      for (i = 0;i < BLOCK_SIZE;i++)
      {
        img->fw_refFrArr[img->block_y+j][img->block_x+i] = -1; // previous P
        img->bw_refFrArr[img->block_y+j][img->block_x+i] = -1; // next P
      }
    }
  }
}

/*!
 ************************************************************************
 * \brief
 *    Get for a given MB of a B picture the reference frame
 *    parameter and the motion vectors from the NAL
 *
 ************************************************************************
 */
void readMotionInfoFromNAL_Bframe(struct img_par *img,struct inp_par *inp)
{
  int i,j,ii,jj,ie,j4,i4,k,pred_vec=0;
  int vec;
  int ref_frame;
  int fw_predframe_no=0, bw_predframe_no;     // frame number which current MB is predicted from
  int fw_blocktype=0, bw_blocktype=0, blocktype=0;
  int l,m;

  // keep track of neighbouring macroblocks available for prediction
  int mb_nr = img->current_mb_nr;
  int mb_width = img->width/16;
  int mb_available_up = (img->mb_y == 0) ? 0 : (img->mb_data[mb_nr].slice_nr == img->mb_data[mb_nr-mb_width].slice_nr);
  int mb_available_left = (img->mb_x == 0) ? 0 : (img->mb_data[mb_nr].slice_nr == img->mb_data[mb_nr-1].slice_nr);
  int mb_available_upleft  = (img->mb_x == 0 || img->mb_y == 0) ? 0 : (img->mb_data[mb_nr].slice_nr == img->mb_data[mb_nr-mb_width-1].slice_nr);
  int mb_available_upright = (img->mb_x >= mb_width-1 || img->mb_y == 0) ? 0 : (img->mb_data[mb_nr].slice_nr == img->mb_data[mb_nr-mb_width+1].slice_nr);

  // keep track of neighbouring blocks available for motion vector prediction
  int block_available_up, block_available_left, block_available_upright, block_available_upleft;
  int mv_a, mv_b, mv_c, mv_d;
  int mvPredType, rFrameL, rFrameU, rFrameUR;

  SyntaxElement THEcurrSE;
  SyntaxElement *currSE = &THEcurrSE;

  Macroblock *currMB = &img->mb_data[img->current_mb_nr];
  Slice *currSlice = img->currentSlice;
  DataPartition *dp;
  int *partMap = assignSE2partition[currSlice->dp_mode];

  bw_predframe_no=0;


  // /////////////////////////////////////////////////////////////
  // find fw_predfame_no
  // /////////////////////////////////////////////////////////////
  if(img->imod==B_Forward || img->imod==B_Bidirect)
  {
    if(img->type==B_IMG_MULT)
    {

#if TRACE
      snprintf(currSE->tracestring, TRACESTRING_SIZE, "B_fw_Reference frame no  ");
#endif
      currSE->type = SE_REFFRAME;
      dp = &(currSlice->partArr[partMap[SE_BFRAME]]);

      if (inp->symbol_mode == UVLC)
        currSE->mapping = linfo;
      else
        currSE->reading = readRefFrameFromBuffer_CABAC;

      dp->readSyntaxElement(  currSE, img, inp, dp);
      fw_predframe_no = currSE->value1;


      if (fw_predframe_no > img->buf_cycle)
      {
        set_ec_flag(SE_REFFRAME);
        fw_predframe_no = 1;
      }

      ref_frame=fw_predframe_no;

 /*     if (ref_frame > img->number)
      {
        ref_frame = 0;
      }*/

      currMB->predframe_no = fw_predframe_no;
      currMB->ref_frame = img->ref_frame = ref_frame;

      // Update the reference frame information for motion vector prediction
      for (j = 0;j < BLOCK_SIZE;j++)
      {
        for (i = 0;i < BLOCK_SIZE;i++)
        {
          img->fw_refFrArr[img->block_y+j][img->block_x+i] = fw_predframe_no;
        }
      }
    } 
    else
      fw_predframe_no = currMB->predframe_no;
  }

  // /////////////////////////////////////////////////////////////
  // find blk_size
  // /////////////////////////////////////////////////////////////
  if(img->imod==B_Bidirect)
  {

#if TRACE
    snprintf(currSE->tracestring, TRACESTRING_SIZE, "B_bidiret_fw_blk");
#endif

    currSE->type = SE_BFRAME;

    dp = &(currSlice->partArr[partMap[SE_BFRAME]]);

    if (inp->symbol_mode == UVLC)
      currSE->mapping = linfo;
    else
      currSE->reading = readBiDirBlkSize2Buffer_CABAC;

    dp->readSyntaxElement(  currSE, img, inp, dp);

    fw_blocktype = currSE->value1+1;


#if TRACE
    snprintf(currSE->tracestring, TRACESTRING_SIZE, "B_bidiret_bw_blk");
#endif

    currSE->type = SE_BFRAME;

    dp = &(currSlice->partArr[partMap[SE_BFRAME]]);

    if (inp->symbol_mode == UVLC)
      currSE->mapping = linfo;
    else
      currSE->reading = readBiDirBlkSize2Buffer_CABAC;


    dp->readSyntaxElement(  currSE, img, inp, dp);

    bw_blocktype = currSE->value1+1;

  }

  // /////////////////////////////////////////////////////////////
  // find MVDFW
  // /////////////////////////////////////////////////////////////
  if(img->imod==B_Forward || img->imod==B_Bidirect)
  {
    // forward : note realtion between blocktype and img->mb_mode
    // bidirect : after reading fw_blk_size, fw_pmv is obtained
    if(img->mb_mode==1)
      blocktype=1;
    else if(img->mb_mode>3)
      blocktype=img->mb_mode/2;
    else if(img->mb_mode==3)
      blocktype=fw_blocktype;

    img->fw_blc_size_h = BLOCK_STEP[blocktype][0]*4;
    img->fw_blc_size_v = BLOCK_STEP[blocktype][1]*4;

    ie=4-BLOCK_STEP[blocktype][0];
    for(j=0;j<4;j=j+BLOCK_STEP[blocktype][1])   // Y position in 4-pel resolution

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲免费视频| 国产suv精品一区二区883| 91国偷自产一区二区使用方法| 欧美国产精品一区| 成人黄色小视频在线观看| 欧美激情一区三区| 色婷婷一区二区三区四区| 亚洲动漫第一页| 日韩女优毛片在线| 成人理论电影网| 一区2区3区在线看| 日韩欧美一区二区在线视频| 精品写真视频在线观看| 国产精品人成在线观看免费 | 久久夜色精品国产噜噜av| 激情综合网天天干| 国产精品免费aⅴ片在线观看| 91在线丨porny丨国产| 亚洲免费av高清| 日韩视频一区二区在线观看| 国产一二三精品| 一区在线观看视频| 91精品久久久久久蜜臀| 高清beeg欧美| 午夜精品久久久久影视| 久久先锋影音av鲁色资源| 成人av在线网站| 日韩黄色小视频| 国产精品久久久久国产精品日日| 色狠狠综合天天综合综合| 免费成人在线视频观看| 国产精品成人免费| 欧美一级爆毛片| 色天使久久综合网天天| 精品一区二区综合| 亚洲成年人影院| 国产精品网站导航| 欧美成人精品高清在线播放| eeuss鲁片一区二区三区在线看| 日韩在线a电影| 一区二区三区四区av| 久久综合中文字幕| 欧美日韩一区二区在线观看| 成人午夜在线播放| 久久国内精品视频| 2欧美一区二区三区在线观看视频| 在线视频观看一区| 成人精品国产一区二区4080 | 男人操女人的视频在线观看欧美 | 国产欧美日韩在线看| 欧美疯狂做受xxxx富婆| 成人av免费在线播放| 老司机午夜精品99久久| 日韩毛片高清在线播放| 精品sm在线观看| 日韩午夜激情av| 欧美视频你懂的| 日本精品一区二区三区高清| 91九色02白丝porn| 久久精品国产一区二区三| 在线观看亚洲精品| 国产成人一级电影| 欧美少妇xxx| 亚洲人成网站影音先锋播放| 日韩欧美一二三| 777午夜精品视频在线播放| 色噜噜狠狠成人中文综合| 成人一区二区三区在线观看| 久久97超碰国产精品超碰| 亚洲成年人影院| 亚洲午夜精品在线| 亚洲精品第1页| 国产馆精品极品| 日本韩国一区二区三区视频| 精品一区免费av| 免费观看一级特黄欧美大片| 亚洲一区中文在线| 亚洲国产日韩a在线播放| 亚洲日本在线天堂| 亚洲欧洲av在线| 国产精品进线69影院| 1区2区3区精品视频| 中文字幕一区二区三区在线观看| 久久久精品黄色| 国产午夜三级一区二区三| 国产精品女同互慰在线看| 中文乱码免费一区二区| 中文无字幕一区二区三区| 久久网站热最新地址| 国产偷v国产偷v亚洲高清 | 91精品国产色综合久久不卡蜜臀 | 欧美日韩美女一区二区| 欧美日韩一区二区在线观看视频| 欧美日韩一区久久| 日韩免费观看高清完整版| 精品国产一区二区国模嫣然| 国产视频一区二区三区在线观看| 国产网红主播福利一区二区| 国产精品久久久爽爽爽麻豆色哟哟| 中文字幕欧美一区| 亚洲高清视频的网址| 美女网站色91| 国产凹凸在线观看一区二区| 99免费精品视频| 69av一区二区三区| 国产日韩欧美电影| 亚洲精品va在线观看| 日韩不卡一区二区三区| 国产精品99久久久久久有的能看| 99精品视频中文字幕| 欧美精品v国产精品v日韩精品| 日韩欧美在线123| 国产精品国产自产拍高清av王其| 亚洲小说春色综合另类电影| 免费成人美女在线观看| 成人激情综合网站| 欧美日韩不卡一区| 中文字幕久久午夜不卡| 亚洲一区免费在线观看| 精品一区二区三区久久久| 日本精品一级二级| 欧美mv和日韩mv国产网站| 亚洲精品一区二区三区香蕉 | 国产精品视频一二| 国产经典欧美精品| 国产精品久久久久久久久晋中 | 3d动漫精品啪啪1区2区免费| 欧美一区二区三区日韩| 国产欧美精品一区aⅴ影院 | 亚洲色图一区二区三区| 日韩精品电影一区亚洲| 国产白丝精品91爽爽久久| 欧美日韩日日骚| 日本一区二区免费在线观看视频| 亚洲综合免费观看高清完整版| 国产一本一道久久香蕉| 欧美日韩亚洲高清一区二区| 国产欧美日韩三级| 青青草国产精品亚洲专区无| 91在线观看一区二区| 欧美国产精品久久| 色婷婷av久久久久久久| 国产精品国产三级国产aⅴ入口| 国产精品影音先锋| 亚洲一区二区三区中文字幕| 国产欧美日韩麻豆91| 国产成人精品三级麻豆| 国产精品每日更新在线播放网址 | 亚洲va天堂va国产va久| 欧美日韩久久久久久| 一区二区三区免费| 极品少妇xxxx精品少妇| 国产精品综合在线视频| 欧美激情自拍偷拍| 日韩西西人体444www| 美女久久久精品| 国产精品毛片久久久久久 | 在线播放91灌醉迷j高跟美女| 免费观看久久久4p| 亚洲图片欧美一区| 亚洲视频免费看| 国产精品毛片大码女人| 精品国产电影一区二区| 欧美精品一二三四| 在线观看欧美日本| 成av人片一区二区| 国产成人在线视频网站| 国产剧情一区在线| 久久精品国产网站| 一区二区三区久久| 亚洲一区二区视频在线观看| 国产精品色在线| 久久久久久久久久久久久女国产乱 | 日韩黄色免费电影| 亚洲一区二区三区自拍| 中文字幕制服丝袜一区二区三区 | 久久69国产一区二区蜜臀| 亚洲人123区| 亚洲天堂免费看| 国产精品久久久久久久久搜平片 | 国产综合久久久久影院| 精品一区二区三区免费| 国产精品乡下勾搭老头1| 99麻豆久久久国产精品免费| 91福利资源站| 欧美日韩精品二区第二页| 6080午夜不卡| 国产精品色婷婷久久58| 一级精品视频在线观看宜春院| 8v天堂国产在线一区二区| 欧美va亚洲va| 国产精品人成在线观看免费| 亚洲国产人成综合网站| 久久99国产精品久久| 色av成人天堂桃色av| 26uuu亚洲综合色| 视频一区二区国产| 91天堂素人约啪| 日韩午夜三级在线| 一区二区三区不卡视频|