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

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

?? mot_est.cpp

?? Netmeeting是Windows系統自帶的網上聊天軟件
?? CPP
字號:
////////////////////////////////////////////////////////////////////////////
//
//
//    Project     : VideoNet version 1.1.
//    Description : Peer to Peer Video Conferencing over the LAN.
//	  Author      :	Nagareshwar Y Talekar ( nsry2002@yahoo.co.in)
//    Date        : 15-6-2004.
//
//    I have converted origional fast h.263 encoder library from C to C++ 
//	  so that it can be integrated into any windows application easily.
//	  I have removed some of unnecessary codes/files from the
//	  fast h263 library.Also moved definitions and declarations
//	  in their proper .h and .cpp files.
//
//    File description : 
//    Name    : mot_est.cpp
//
//
/////////////////////////////////////////////////////////////////////////////

/************************************************* * libr263: fast H.263 encoder library * * Copyright (C) 1996, Roalt Aalmoes, Twente University * SPA multimedia group * * Based on Telenor TMN 1.6 encoder (Copyright (C) 1995, Telenor R&D) * created by Karl Lillevold  * * Author encoder: Roalt Aalmoes, <aalmoes@huygens.nl> *  * Date: 31-07-96 **************************************************/
#include "stdafx.h"#include "Global.h"





/* Efficient macroblock comparison op. *//* The comparison is between a non-interpolated lowres block of pixel    and a interpolated hires block of pixel. This might be confusing:   Example: compare 3x3 block with 3x3 block, then the 1s of block 1 are   compared with the 2s of block 2.   Block 1:	Block 2:	   1.1.1.	222   ......	222   1.1.1.	222   ......   1.1.1.   You see, for block one (ii), you have 4 times more data!*///inline int SAD_HalfPixelMacroblock(unsigned int *ii,//			    unsigned int *curr,//			    int pixels_on_line, int Min_SAD)int SAD_HalfPixelMacroblock(unsigned int *ii,
			    unsigned int *curr,
			    int pixels_on_line, int Min_SAD)

{  int j = 16;  int sad = 0;  while(j--) {    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii- (*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-(*curr++));      ii += 2;    sad += abs(*ii-(*curr++));    ii += 2;    sad += abs(*ii-*curr);    if(sad > Min_SAD)      return INT_MAX;    ii += pixels_on_line*4 - 30;                                 /* Interpolated image, that means two times */				/* We also take only one of the two pixels */				/* This means another two times ... */    curr += pixels_on_line - 15;  } /* end while */  return sad;} /* This implementation contains two mayor algorithms: exhaustive and    logarithmic. The exhaustive algorithm was adapted to be applied on   half-pixel luminance, and the logarithmic algorithm was implemented   by Roalt Aalmoes and is functional equivalent to the one in berkeley's   MPEG encoder. */void FullMotionEstimation(unsigned int *curr, unsigned int *prev_ipol, 		     int seek_dist, MotionVector *current_MV, int x_curr, 		     int y_curr)				/*  x_curr and y_curr are whole-pixel				    values to indicate upperleft (0,0)				    pixel of this MB in whole frame curr */{  int Min_FRAME;  MotionVector MV_FRAME;  unsigned int *curr_image_MB;  int sxy,xblock,k,yblock,l;  int RightXBorder,LeftXBorder,RightYBorder,LeftYBorder;  int xmax,ymax,sad;  int CenterX, CenterY, origCenterX, origCenterY, newCenterX, newCenterY;  int StepSizeX, StepSizeY;  curr_image_MB = curr + Global::pels*y_curr + x_curr;  /* from now on, all pixel related operations are based on prev_ipol */  /* way: thus resolution is enhanced by 2 for halfpixel search */  CenterX = 2*x_curr;  CenterY = 2*y_curr;  xmax = 2*Global::pels;  ymax = 2*Global::lines;  sxy = mmin(31, seek_dist);    LeftXBorder = CenterX - sxy;  RightXBorder = CenterX + sxy;  LeftYBorder = CenterY - sxy;  RightYBorder = CenterY + sxy;  if (LeftXBorder<0) LeftXBorder = 0;  if (RightXBorder>xmax-32) RightXBorder = xmax-32;   /* Comparison is still on 16x16 blocks */  if (LeftYBorder<0) LeftYBorder = 0;		        /* but this is interleaved by 1 pixel! */  if (RightYBorder>ymax-32) RightYBorder = ymax-32;   /* e.g. comp. pixno.1 3 5 7 or 2 4 6 8 */  /*but never 1 2 3 4 as this is halfres.*/  Min_FRAME = INT_MAX;  MV_FRAME.x = 0;  MV_FRAME.y = 0;  MV_FRAME.x_half = 0;  MV_FRAME.y_half = 0;     if(Global::search_p_frames == CPARAM_EXHAUSTIVE) {    /* This is the spriral search variant of exhaustive seach */    /* First determine zero MV value SAD */    xblock = CenterX; yblock = CenterY;    sad = SAD_HalfPixelMacroblock(prev_ipol + xblock + yblock*Global::pels*2,				  curr_image_MB,				  Global::pels, Min_FRAME) - PREF_NULL_VEC;     /* I assume sad < INT_MAX  */    Min_FRAME = sad;        /* Then do the surrounding MV SADs */    for (l = 1; l <= sxy; l++) {      /* For every loop from inside to outside do */      xblock = CenterX - l;      yblock = CenterY - l;      for (k = 0; k < 8*l; k++) {	if (xblock>=LeftXBorder && xblock<=RightXBorder 	    && yblock>=LeftYBorder && yblock<=RightYBorder) {	  /* 16x16 integer pel MV */	  sad = SAD_HalfPixelMacroblock(prev_ipol + xblock + yblock*Global::pels*2,					curr_image_MB,					Global::pels, Min_FRAME); 	  if (sad < Min_FRAME) {	    MV_FRAME.x = xblock - CenterX;	    MV_FRAME.y = yblock - CenterY;	    Min_FRAME = sad;	  }	}	if      (k<2*l) xblock++;	else if (k<4*l) yblock++;	else if (k<6*l) xblock--;	else            yblock--;      }          } /* end for */  } else { /* Global::search_p_frames == DEF_LOGARITHMIC_SEARCH */        /* origCenter* is necessary because Center* changes */    origCenterX = CenterX; origCenterY = CenterY;    StepSizeX = ((2*sxy + 1) + 1)/3; /* round(Size of Xinterval / 3), 					this is maximum size of between two					probes */     StepSizeY = ((2*sxy + 1) + 1)/3; /* round(Size of Yinterval / 3) */    sad = SAD_HalfPixelMacroblock(prev_ipol + CenterX + CenterY*Global::pels*2,				  curr_image_MB,Global::pels, 				  Min_FRAME) - PREF_NULL_VEC;     /* I assume sad < INT_MAX  */    Min_FRAME = sad;     while (StepSizeX >= 1 || StepSizeY >= 1) {      newCenterX = CenterX;      newCenterY = CenterY;      /* Do this loop three times */      for(xblock = CenterX - StepSizeX; xblock <= CenterX + StepSizeX &&	    (StepSizeX != 0); xblock += StepSizeX) {	if(xblock < LeftXBorder || xblock > RightXBorder)	  continue;	/* Do this loop three times */	for(yblock = CenterY - StepSizeY; yblock <= CenterY + StepSizeY &&	      (StepSizeY != 0); yblock+= StepSizeY) {	  if(yblock < LeftYBorder || yblock > RightYBorder)	    continue;	  /* In fact, the middlest comparison is only required 	     the first time, as the last time it is calculated 	     on the previous while-loop, remember:	     NewCenterZ = zblock */	  sad = SAD_HalfPixelMacroblock(prev_ipol + xblock + yblock*Global::pels*2,					curr_image_MB,Global::pels, Min_FRAME); 	  if (sad < Min_FRAME) {	    MV_FRAME.x = xblock - origCenterX;	    MV_FRAME.y = yblock - origCenterY;	    Min_FRAME = sad;	    newCenterX = xblock; newCenterY = yblock;	  }	}	/* end for yblock */      } /* end for xblock */      if(newCenterX < CenterX) {	RightXBorder = LeftXBorder + StepSizeX - 1;      } else if(newCenterX == CenterX) {	LeftXBorder = LeftXBorder + StepSizeX;        RightXBorder = RightXBorder - StepSizeX;      } else {	LeftXBorder = RightXBorder - StepSizeX + 1;      }      if(newCenterY < CenterY) {	RightYBorder = LeftYBorder + StepSizeY - 1;      } else if(newCenterY == CenterY) {	LeftYBorder = LeftYBorder + StepSizeY;	RightYBorder = RightYBorder - StepSizeY;      } else {	LeftYBorder = RightYBorder - StepSizeY + 1;      }      CenterX = newCenterX;      CenterY = newCenterY;      /* Stepsizes are 0 when RightZBorder == LeftZBorder */      StepSizeX = ((RightXBorder - LeftXBorder + 1) + 1)/3;       /* round(Size of Xinterval / 3), this is maximum size of between two	 probes */       StepSizeY = ((RightYBorder - LeftYBorder + 1) + 1)/3;       /* round(Size of Yinterval / 3) */          } /* End while stepsize */  } /* end logarithmic search algorithm */    current_MV->x = MV_FRAME.x / 2;  current_MV->x_half = MV_FRAME.x % 2; /*This might not work for neg. values!*/  current_MV->y = MV_FRAME.y / 2;  current_MV->y_half = MV_FRAME.y % 2; /* This might not work! */  current_MV->min_error = Min_FRAME;  return;}int SAD_HalfPixelMacroblock2(unsigned int *ii,			    unsigned int *curr,			    int pixels_on_line, int Min_SAD){  int j = 16;  int sad = 0;  while(j--) {    sad += abs(*ii-(*curr));    sad += abs(*(ii + 2)-(*(curr+1)));    sad += abs(*(ii + 4)-(*(curr+2)));    sad += abs(*(ii + 6)-(*(curr+3)));    sad += abs(*(ii + 8)-(*(curr+4)));    sad += abs(*(ii + 10)-(*(curr+5)));    sad += abs(*(ii + 12)-(*(curr+6)));    sad += abs(*(ii + 14)-(*(curr+7)));    sad += abs(*(ii + 16)-(*(curr+8)));    sad += abs(*(ii + 18)-(*(curr+9)));    sad += abs(*(ii + 20)-(*(curr+10)));    sad += abs(*(ii + 22)-(*(curr+11)));    sad += abs(*(ii + 24)-(*(curr+12)));    sad += abs(*(ii + 26)-(*(curr+13)));    sad += abs(*(ii + 28)-(*(curr+14)));    sad += abs(*(ii + 30)-(*(curr+15)));    if(sad > Min_SAD)      return INT_MAX;    ii += pixels_on_line*2*2;                                 /* Interpolated image, that means two times */				/* We also take only one of the two pixels */				/* This means another two times ... */    curr += pixels_on_line;  } /* end while */  return sad;} unsigned int *LoadArea(unsigned int *im, int x, int y, 			int x_size, int y_size, int lx){  unsigned int *res = (unsigned int *)malloc(sizeof(int)*x_size*y_size);  unsigned int *in;  unsigned int *out;  int i = x_size;  int j = y_size;  in = im + (y*lx) + x;  out = res;  while (j--) {    while (i--)      *out++ = *in++;    i = x_size;    in += lx - x_size;  };  return res;}void FindMB(int x, int y, unsigned int *image, unsigned int MB[16][16]){  int n;  unsigned int *MB_ptr = &MB[0][0];  unsigned int *image_ptr;  MB_ptr = &MB[0][0];  image_ptr = image + x + y*Global::pels;#ifdef LONGISDOUBLEINT  for(n = 0; n < 16; n++) {    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;    * (unsigned long *) MB_ptr = * (unsigned long *) image_ptr;     MB_ptr += 2; image_ptr += 2;        image_ptr += Global::pels - 16;  }#else  for (n = 0; n < 16; n++) {    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    *(unsigned int *) MB_ptr++ = *(unsigned int *) image_ptr++;    image_ptr += Global::pels - 16;  }#endif}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国模大尺度视频| 亚洲国产精品激情在线观看 | 久久久国际精品| 国产一区二区免费在线| 国产色91在线| 91在线码无精品| 亚洲一二三级电影| 欧美一卡2卡三卡4卡5免费| 老司机免费视频一区二区 | 久久这里只有精品首页| 国产精品18久久久久久久久久久久| 国产亚洲自拍一区| 国产iv一区二区三区| 怡红院av一区二区三区| 欧美夫妻性生活| 国产麻豆精品95视频| 亚洲欧美激情视频在线观看一区二区三区 | 国产91精品一区二区麻豆网站| 中文字幕电影一区| 在线观看日韩电影| 精品一区二区三区欧美| 欧美国产精品v| 欧美亚洲日本国产| 国产自产视频一区二区三区| 国产精品电影院| 欧美日本在线播放| 高清不卡一二三区| 亚洲一区二区欧美| 国产亚洲午夜高清国产拍精品| 99久久精品一区| 天天综合天天综合色| 亚洲国产成人午夜在线一区| 欧美日韩精品一区二区三区蜜桃| 国产一区二区三区在线观看免费 | 国产日韩影视精品| 欧美日韩日日夜夜| 成人a区在线观看| 久久精品国产亚洲aⅴ | 亚洲国产wwwccc36天堂| 精品少妇一区二区三区在线播放| 91视频xxxx| 国产最新精品免费| 午夜久久福利影院| 国产精品久久久久久亚洲伦| 日韩女优av电影在线观看| 91丨九色丨黑人外教| 黄色成人免费在线| 亚洲第一成年网| 自拍偷自拍亚洲精品播放| 精品精品国产高清a毛片牛牛| 在线观看区一区二| 国产aⅴ综合色| 乱中年女人伦av一区二区| 亚洲第一精品在线| 亚洲男人的天堂一区二区| 久久精品一区二区| 欧美一级爆毛片| 欧美影视一区在线| 一本高清dvd不卡在线观看| 国产成人综合自拍| 国产自产v一区二区三区c| 蜜臀av一级做a爰片久久| 亚洲.国产.中文慕字在线| 亚洲精品国产一区二区三区四区在线 | 欧美性色欧美a在线播放| av亚洲产国偷v产偷v自拍| 国产乱人伦偷精品视频不卡 | 亚洲成人免费观看| 亚洲欧美国产高清| 国产精品久久一卡二卡| 国产精品欧美综合在线| 欧美国产日韩亚洲一区| 国产亚洲欧美色| 国产亚洲女人久久久久毛片| 久久久久久久网| 久久精品夜色噜噜亚洲aⅴ| www激情久久| 日本一区二区视频在线观看| 国产女人18水真多18精品一级做 | 国产精品美女久久久久高潮| 国产精品色呦呦| 国产清纯美女被跳蛋高潮一区二区久久w| 精品免费日韩av| 精品福利二区三区| 国产日韩精品一区二区浪潮av| 久久亚洲一区二区三区四区| 久久精品视频在线免费观看| 中文在线免费一区三区高中清不卡| 国产欧美综合色| 亚洲欧美一区二区不卡| 一卡二卡欧美日韩| 亚洲大片一区二区三区| 日韩国产在线观看一区| 麻豆久久一区二区| 国产乱妇无码大片在线观看| caoporm超碰国产精品| 91福利视频久久久久| 欧美日韩久久不卡| 久久综合色一综合色88| 国产精品色呦呦| 亚洲午夜成aⅴ人片| 日韩黄色小视频| 国产成人精品亚洲午夜麻豆| 99国产精品99久久久久久| 91高清视频在线| 精品剧情在线观看| 1024成人网| 日韩一区精品视频| 国产河南妇女毛片精品久久久| 色综合久久中文字幕综合网| 91麻豆精品国产91久久久| 久久先锋影音av鲁色资源 | 亚洲一区二区三区四区在线免费观看| 视频在线观看国产精品| 国产精品 欧美精品| 欧美在线啊v一区| 欧美mv和日韩mv国产网站| 国产精品国产精品国产专区不蜜| 亚洲福利一区二区三区| 国产在线看一区| 在线免费观看日韩欧美| 精品国精品自拍自在线| 亚洲精品视频免费观看| 另类小说综合欧美亚洲| 91香蕉视频污| 日韩精品中文字幕一区二区三区 | 色国产综合视频| 欧美精品一区二区在线播放| 亚洲欧美激情小说另类| 九一久久久久久| 在线观看亚洲精品视频| 国产无一区二区| 蜜臀久久久99精品久久久久久| 99精品国产99久久久久久白柏| 欧美一区二区三区电影| 亚洲男人的天堂av| 国产一区二区三区黄视频| 欧美日韩小视频| 亚洲欧美一区二区在线观看| 国内久久精品视频| 一本一道综合狠狠老| 久久久av毛片精品| 日韩国产欧美在线视频| 972aa.com艺术欧美| 欧美激情自拍偷拍| 精品一区中文字幕| 欧美日韩电影在线| 亚洲激情一二三区| 成人精品国产一区二区4080| 欧美精品一区二区在线播放| 日本亚洲视频在线| 欧美在线影院一区二区| 中文字幕一区三区| 丁香一区二区三区| 日韩免费观看高清完整版| 日本不卡一二三区黄网| 欧美性三三影院| 亚洲午夜成aⅴ人片| 色视频成人在线观看免| 国产精品乱人伦| 国产suv精品一区二区三区| 久久麻豆一区二区| 黄色精品一二区| 久久综合成人精品亚洲另类欧美| 久久电影网电视剧免费观看| 日韩三级电影网址| 喷水一区二区三区| 91精品在线免费观看| 亚洲va国产va欧美va观看| 欧洲国产伦久久久久久久| 成人免费一区二区三区视频| 91影视在线播放| 亚洲欧美一区二区久久| 欧美中文字幕不卡| 亚洲影院理伦片| 欧美精品乱码久久久久久按摩 | 日韩欧美一区在线观看| 精品在线观看免费| 精品国产a毛片| 国产精品系列在线观看| 国产精品护士白丝一区av| 色综合av在线| 日精品一区二区| 日韩免费看的电影| 国产成人在线色| 亚洲视频在线一区二区| 91极品美女在线| 日韩高清欧美激情| 久久日一线二线三线suv| 国产成人av一区| 伊人婷婷欧美激情| 欧美日韩高清在线| 国产一区二区三区香蕉| 国产精品久久久久久久岛一牛影视| 色噜噜狠狠色综合欧洲selulu| 五月天激情小说综合| 337p粉嫩大胆色噜噜噜噜亚洲| 成人免费视频视频在线观看免费| 亚洲人亚洲人成电影网站色| 在线成人高清不卡|