www.pudn.com > MotionEstimation.rar > Motion.h
// Motion.h: interface for the CMotion class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MOTION_H__810F6C62_235D_11D5_9DCC_5254AB2B9F00__INCLUDED_)
#define AFX_MOTION_H__810F6C62_235D_11D5_9DCC_5254AB2B9F00__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct MBINFO {
int mb_type; //宏块类型
int dquant; //反量化参数
int mcbpc; //色度块cbp
int cbpy; //亮度块cbp
int cod; //指示块是否被编码
int MV[2]; //运动矢量
int var;
int quant; //量化参数
} mbinfo;
class CMotion
{
public:
int width;
int height;
int MPCThred;
int SearchRule;
void CMotion::motion_estimation(unsigned char *oldorg, int width, int height, unsigned char *cur,unsigned char *reconframe, unsigned char *pdata, int sxf, int syf, mbinfo *mbi);
CMotion();
virtual ~CMotion();
private:
void frame_ME(unsigned char *oldorg, int width,int height,
unsigned char *cur, int i, int j, int sxf, int syf,mbinfo *mbi);
//搜索方法
int fullsearch(unsigned char *org,unsigned char *ref,unsigned char *blk,int lx,int i0,int j0,int sx,int sy,int h,int xmax,int ymax,int *iminp,int *jminp);
int TSS(unsigned char *org,unsigned char *blk,int lx,int i0,
int j0,int sx,int sy,int h,int xmax,int ymax,int *iminp,int *jminp);
int JC1search(unsigned char *org,unsigned char *ref,unsigned char *blk,int lx,int i0,int j0,int sx,int sy,int h,int xmax,int ymax,int *iminp,int *jminp);
int JC2search(unsigned char *org,unsigned char *ref,unsigned char *blk,int lx,int i0,int j0,int sx,int sy,int h,int xmax,int ymax,int *iminp,int *jminp);
int LK_ME(unsigned char *org, unsigned char *ref, unsigned char *blk, int lx, int i0, int j0, int h, int xmax,int ymax, int *iminp, int *jminp);
//搜索准则
int MAD(unsigned char *blk1,unsigned char *blk2,int lx,int hx,int hy,int h,int distlim);
};
#endif // !defined(AFX_MOTION_H__810F6C62_235D_11D5_9DCC_5254AB2B9F00__INCLUDED_)