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

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

?? predict.c

?? MPEG2解編碼程序源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* predict.c, motion compensated prediction                                 */

/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */

/*
 * Disclaimer of Warranty
 *
 * These software programs are available to the user without any license fee or
 * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
 * any and all warranties, whether express, implied, or statuary, including any
 * implied warranties or merchantability or of fitness for a particular
 * purpose.  In no event shall the copyright-holder 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 MPEG Software Simulation Group does not represent or warrant that the
 * programs furnished hereunder are free of infringement of any third-party
 * patents.
 *
 * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
 * are subject to royalty fees to patent holders.  Many of these patents are
 * general enough such that they are unavoidable regardless of implementation
 * design.
 *
 */

#include <stdio.h>
#include "config.h"
#include "global.h"

/* private prototypes */
static void predict_mb _ANSI_ARGS_((
  unsigned char *oldref[], unsigned char *newref[], unsigned char *cur[],
  int lx, int bx, int by, int pict_type, int pict_struct, int mb_type,
  int motion_type, int secondfield,
  int PMV[2][2][2], int mv_field_sel[2][2], int dmvector[2]));

static void pred _ANSI_ARGS_((unsigned char *src[], int sfield,
  unsigned char *dst[], int dfield,
  int lx, int w, int h, int x, int y, int dx, int dy, int addflag));

static void pred_comp _ANSI_ARGS_((unsigned char *src, unsigned char *dst,
  int lx, int w, int h, int x, int y, int dx, int dy, int addflag));

static void calc_DMV _ANSI_ARGS_((int DMV[][2], int *dmvector, int mvx,
  int mvy));

static void clearblock _ANSI_ARGS_((unsigned char *cur[], int i0, int j0));


/* form prediction for a complete picture (frontend for predict_mb)
 *
 * reff: reference frame for forward prediction
 * refb: reference frame for backward prediction
 * cur:  destination (current) frame
 * secondfield: predict second field of a frame
 * mbi:  macroblock info
 *
 * Notes:
 * - cf. predict_mb
 */

void predict(reff,refb,cur,secondfield,mbi)
unsigned char *reff[],*refb[],*cur[3];
int secondfield;
struct mbinfo *mbi;
{
  int i, j, k;

  k = 0;

  /* loop through all macroblocks of the picture */
  for (j=0; j<height2; j+=16)
    for (i=0; i<width; i+=16)
    {
      predict_mb(reff,refb,cur,width,i,j,pict_type,pict_struct,
                 mbi[k].mb_type,mbi[k].motion_type,secondfield,
                 mbi[k].MV,mbi[k].mv_field_sel,mbi[k].dmvector);

      k++;
    }
}

/* form prediction for one macroblock
 *
 * oldref: reference frame for forward prediction
 * newref: reference frame for backward prediction
 * cur:    destination (current) frame
 * lx:     frame width (identical to global var `width')
 * bx,by:  picture (field or frame) coordinates of macroblock to be predicted
 * pict_type: I, P or B
 * pict_struct: FRAME_PICTURE, TOP_FIELD, BOTTOM_FIELD
 * mb_type:     MB_FORWARD, MB_BACKWARD, MB_INTRA
 * motion_type: MC_FRAME, MC_FIELD, MC_16X8, MC_DMV
 * secondfield: predict second field of a frame
 * PMV[2][2][2]: motion vectors (in half pel picture coordinates)
 * mv_field_sel[2][2]: motion vertical field selects (for field predictions)
 * dmvector: differential motion vectors (for dual prime)
 *
 * Notes:
 * - when predicting a P type picture which is the second field of
 *   a frame, the same parity reference field is in oldref, while the
 *   opposite parity reference field is assumed to be in newref!
 * - intra macroblocks are modelled to have a constant prediction of 128
 *   for all pels; this results in a DC DCT coefficient symmetric to 0
 * - vectors for field prediction in frame pictures are in half pel frame
 *   coordinates (vertical component is twice the field value and always
 *   even)
 *
 * already covers dual prime (not yet used)
 */

static void predict_mb(oldref,newref,cur,lx,bx,by,pict_type,pict_struct,
  mb_type,motion_type,secondfield,PMV,mv_field_sel,dmvector)
unsigned char *oldref[],*newref[],*cur[];
int lx;
int bx,by;
int pict_type;
int pict_struct;
int mb_type;
int motion_type;
int secondfield;
int PMV[2][2][2], mv_field_sel[2][2], dmvector[2];
{
  int addflag, currentfield;
  unsigned char **predframe;
  int DMV[2][2];

  if (mb_type&MB_INTRA)
  {
    clearblock(cur,bx,by);
    return;
  }

  addflag = 0; /* first prediction is stored, second is added and averaged */

  if ((mb_type & MB_FORWARD) || (pict_type==P_TYPE))
  {
    /* forward prediction, including zero MV in P pictures */

    if (pict_struct==FRAME_PICTURE)
    {
      /* frame picture */

      if ((motion_type==MC_FRAME) || !(mb_type & MB_FORWARD))
      {
        /* frame-based prediction in frame picture */
        pred(oldref,0,cur,0,
          lx,16,16,bx,by,PMV[0][0][0],PMV[0][0][1],0);
      }
      else if (motion_type==MC_FIELD)
      {
        /* field-based prediction in frame picture
         *
         * note scaling of the vertical coordinates (by, PMV[][0][1])
         * from frame to field!
         */

        /* top field prediction */
        pred(oldref,mv_field_sel[0][0],cur,0,
          lx<<1,16,8,bx,by>>1,PMV[0][0][0],PMV[0][0][1]>>1,0);

        /* bottom field prediction */
        pred(oldref,mv_field_sel[1][0],cur,1,
          lx<<1,16,8,bx,by>>1,PMV[1][0][0],PMV[1][0][1]>>1,0);
      }
      else if (motion_type==MC_DMV)
      {
        /* dual prime prediction */

        /* calculate derived motion vectors */
        calc_DMV(DMV,dmvector,PMV[0][0][0],PMV[0][0][1]>>1);

        /* predict top field from top field */
        pred(oldref,0,cur,0,
          lx<<1,16,8,bx,by>>1,PMV[0][0][0],PMV[0][0][1]>>1,0);

        /* predict bottom field from bottom field */
        pred(oldref,1,cur,1,
          lx<<1,16,8,bx,by>>1,PMV[0][0][0],PMV[0][0][1]>>1,0);

        /* predict and add to top field from bottom field */
        pred(oldref,1,cur,0,
          lx<<1,16,8,bx,by>>1,DMV[0][0],DMV[0][1],1);

        /* predict and add to bottom field from top field */
        pred(oldref,0,cur,1,
          lx<<1,16,8,bx,by>>1,DMV[1][0],DMV[1][1],1);
      }
      else
      {
        /* invalid motion_type in frame picture */
        if (!quiet)
          fprintf(stderr,"invalid motion_type\n");
      }
    }
    else /* TOP_FIELD or BOTTOM_FIELD */
    {
      /* field picture */

      currentfield = (pict_struct==BOTTOM_FIELD);

      /* determine which frame to use for prediction */
      if ((pict_type==P_TYPE) && secondfield
          && (currentfield!=mv_field_sel[0][0]))
        predframe = newref; /* same frame */
      else
        predframe = oldref; /* previous frame */

      if ((motion_type==MC_FIELD) || !(mb_type & MB_FORWARD))
      {
        /* field-based prediction in field picture */
        pred(predframe,mv_field_sel[0][0],cur,currentfield,
          lx<<1,16,16,bx,by,PMV[0][0][0],PMV[0][0][1],0);
      }
      else if (motion_type==MC_16X8)
      {
        /* 16 x 8 motion compensation in field picture */

        /* upper half */
        pred(predframe,mv_field_sel[0][0],cur,currentfield,
          lx<<1,16,8,bx,by,PMV[0][0][0],PMV[0][0][1],0);

        /* determine which frame to use for lower half prediction */
        if ((pict_type==P_TYPE) && secondfield
            && (currentfield!=mv_field_sel[1][0]))
          predframe = newref; /* same frame */
        else
          predframe = oldref; /* previous frame */

        /* lower half */
        pred(predframe,mv_field_sel[1][0],cur,currentfield,
          lx<<1,16,8,bx,by+8,PMV[1][0][0],PMV[1][0][1],0);
      }
      else if (motion_type==MC_DMV)
      {
        /* dual prime prediction */

        /* determine which frame to use for prediction */
        if (secondfield)
          predframe = newref; /* same frame */
        else
          predframe = oldref; /* previous frame */

        /* calculate derived motion vectors */
        calc_DMV(DMV,dmvector,PMV[0][0][0],PMV[0][0][1]);

        /* predict from field of same parity */
        pred(oldref,currentfield,cur,currentfield,
          lx<<1,16,16,bx,by,PMV[0][0][0],PMV[0][0][1],0);

        /* predict from field of opposite parity */
        pred(predframe,!currentfield,cur,currentfield,
          lx<<1,16,16,bx,by,DMV[0][0],DMV[0][1],1);
      }
      else
      {
        /* invalid motion_type in field picture */
        if (!quiet)
          fprintf(stderr,"invalid motion_type\n");
      }
    }
    addflag = 1; /* next prediction (if any) will be averaged with this one */
  }

  if (mb_type & MB_BACKWARD)
  {
    /* backward prediction */

    if (pict_struct==FRAME_PICTURE)
    {
      /* frame picture */

      if (motion_type==MC_FRAME)
      {
        /* frame-based prediction in frame picture */
        pred(newref,0,cur,0,
          lx,16,16,bx,by,PMV[0][1][0],PMV[0][1][1],addflag);
      }
      else
      {
        /* field-based prediction in frame picture
         *
         * note scaling of the vertical coordinates (by, PMV[][1][1])
         * from frame to field!
         */

        /* top field prediction */
        pred(newref,mv_field_sel[0][1],cur,0,
          lx<<1,16,8,bx,by>>1,PMV[0][1][0],PMV[0][1][1]>>1,addflag);

        /* bottom field prediction */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
宅男在线国产精品| 久久久国产精品不卡| 国产精品69毛片高清亚洲| 一区二区三区四区五区视频在线观看| 国产日产精品一区| 国产精品美日韩| 国产三区在线成人av| 欧美三级视频在线播放| 99国产麻豆精品| 粉嫩av一区二区三区粉嫩| 成人在线一区二区三区| 成人动漫精品一区二区| 亚洲国产综合视频在线观看| 亚洲精品日产精品乱码不卡| 一区二区三区日韩欧美| 亚洲成人午夜电影| 首页国产欧美日韩丝袜| 亚洲精品欧美在线| 男女视频一区二区| 国产成人午夜99999| 精品一区二区三区视频在线观看| 免费日韩伦理电影| 久久精品国产**网站演员| 精品无人码麻豆乱码1区2区| 天天综合网天天综合色| 亚洲自拍偷拍欧美| 男女男精品视频| 美女精品一区二区| 东方aⅴ免费观看久久av| heyzo一本久久综合| 欧美亚洲一区二区三区四区| 91麻豆精品91久久久久同性| 久久综合色8888| 亚洲色图在线播放| 性感美女极品91精品| 国产丶欧美丶日本不卡视频| 欧日韩精品视频| 久久精品一区二区三区不卡牛牛| 亚洲欧美电影院| 国内成人免费视频| 在线成人免费观看| 欧美激情一区三区| 亚洲bt欧美bt精品| 国产精品1024| 欧美理论电影在线| 亚洲欧洲精品天堂一级| 视频一区欧美精品| 成人精品鲁一区一区二区| 欧美老年两性高潮| 亚洲乱码国产乱码精品精小说| 蜜桃av噜噜一区二区三区小说| 99九九99九九九视频精品| 精品欧美久久久| 亚洲午夜一区二区三区| 三级精品在线观看| 国产91清纯白嫩初高中在线观看| 欧美日韩国产在线观看| 自拍偷拍亚洲欧美日韩| 久久精品国产一区二区三| 色网综合在线观看| 国产精品午夜在线| 亚洲www啪成人一区二区麻豆| 成人免费视频一区二区| 欧美一二三区在线观看| 首页综合国产亚洲丝袜| 欧洲日韩一区二区三区| 国产精品久久久久9999吃药| 国产91丝袜在线播放| 精品av久久707| 亚洲欧洲精品成人久久奇米网| 国产在线播放一区三区四| 欧美一二三四区在线| 日韩福利视频网| 欧美一区二区三区免费观看视频| 亚洲综合色噜噜狠狠| 91免费小视频| 伊人色综合久久天天人手人婷| 成人免费精品视频| 国产精品美女久久久久久| 国产精品亚洲人在线观看| 日韩精品中午字幕| 日韩高清欧美激情| 在线欧美小视频| 午夜在线电影亚洲一区| 91麻豆免费视频| 亚洲卡通欧美制服中文| 色噜噜狠狠成人中文综合| 亚洲欧洲精品成人久久奇米网| 99综合电影在线视频| 亚洲日本丝袜连裤袜办公室| 91国产丝袜在线播放| 亚洲一区二区三区视频在线播放| 欧洲一区二区三区免费视频| 亚洲精品国产高清久久伦理二区| 色av成人天堂桃色av| 中文乱码免费一区二区| 在线一区二区三区四区五区| 午夜av电影一区| 精品国产91乱码一区二区三区 | 欧美日韩一区三区| 亚洲成a人片在线不卡一二三区| 欧美亚洲另类激情小说| 欧美aaaaa成人免费观看视频| 欧美日韩一卡二卡| 婷婷久久综合九色综合伊人色| 欧美成人一级视频| 成人午夜激情在线| 午夜影院久久久| 久久精品亚洲一区二区三区浴池| av电影在线观看一区| 午夜精品久久久久影视| 日韩一区二区三| 国产精品一区二区在线看| 国产精品美女久久福利网站| 欧美久久久久中文字幕| 美国三级日本三级久久99| 日韩理论片中文av| 欧美妇女性影城| 99re热这里只有精品视频| 视频在线观看一区| 国产精品免费视频观看| 欧美在线观看一区| 国产精品久久久久久久久久免费看| 欧美三级三级三级| 国产精品亚洲专一区二区三区 | 欧美一区二区黄| 99久精品国产| 国产呦精品一区二区三区网站| 亚洲黄色免费电影| 国产色婷婷亚洲99精品小说| 欧美日韩国产首页| 国产精品911| 免费成人在线观看| 亚洲欧美色图小说| 国产欧美一区二区精品忘忧草 | 国产高清不卡二三区| 亚洲国产美女搞黄色| 日韩一区在线播放| 国产偷国产偷亚洲高清人白洁| 欧美日韩国产美| 色综合天天综合狠狠| 激情av综合网| 蜜桃传媒麻豆第一区在线观看| 国产精品久久久久四虎| 久久尤物电影视频在线观看| 7777精品伊人久久久大香线蕉的| 91免费视频网| 99re亚洲国产精品| 91在线视频观看| 成人免费看视频| 不卡在线视频中文字幕| 久久黄色级2电影| 欧美精品99久久久**| 日韩一区二区在线观看视频| 91丨porny丨首页| 成人性生交大片免费看在线播放 | 精品美女一区二区三区| 欧美日本免费一区二区三区| 99精品久久只有精品| 99re热视频这里只精品| www.欧美色图| 99re免费视频精品全部| www.欧美日韩| 日本高清不卡在线观看| 91免费看片在线观看| 不卡av在线免费观看| 色婷婷国产精品| 欧美久久久影院| 日韩精品中文字幕在线不卡尤物| 日韩欧美在线观看一区二区三区| 日韩免费视频一区| 久久久综合九色合综国产精品| 国产日韩在线不卡| 亚洲欧美在线aaa| 亚洲自拍偷拍av| 激情小说欧美图片| 午夜一区二区三区视频| 亚洲18女电影在线观看| 日韩av电影免费观看高清完整版| 免费高清在线一区| 国产毛片精品视频| 91麻豆国产香蕉久久精品| 欧美性猛交一区二区三区精品| 欧美福利一区二区| 久久色.com| 亚洲欧美另类久久久精品2019| 中文字幕五月欧美| 亚洲综合区在线| 麻豆成人综合网| 成人午夜激情视频| 欧美日韩国产首页在线观看| 久久久综合视频| 一区二区三区蜜桃| 极品少妇一区二区三区精品视频| 成人一区二区三区中文字幕| 欧美日本一道本| 国产精品传媒入口麻豆| 亚洲成人在线免费| 波多野结衣在线aⅴ中文字幕不卡| 欧美三级一区二区|