⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interpolate8x8.h

📁 经典的MP4编解码核心库
💻 H
字号:
#include "../common/common.h"

typedef void (INTERPOLATE8X8)(uint8_t * const dst,
					const uint8_t * const src,
					const uint32_t stride,
					const uint32_t rounding);
typedef INTERPOLATE8X8 * INTERPOLATE8X8_PTR;	

extern INTERPOLATE8X8_PTR interpolate8x8_h;
extern INTERPOLATE8X8_PTR interpolate8x8_v;
extern INTERPOLATE8X8_PTR interpolate8x8_hv;

INTERPOLATE8X8 interpolate8x8_h_c;
INTERPOLATE8X8 interpolate8x8_v_c;
INTERPOLATE8X8 interpolate8x8_hv_c;

INTERPOLATE8X8 interpolate8x8_h_mmx;
INTERPOLATE8X8 interpolate8x8_v_mmx;
INTERPOLATE8X8 interpolate8x8_hv_mmx;

INTERPOLATE8X8 interpolate8x8_h_xmm;
INTERPOLATE8X8 interpolate8x8_v_xmm;


INTERPOLATE8X8 interpolate8x8_h_3dn;
INTERPOLATE8X8 interpolate8x8_v_3dn;


void interpolate8x8_c(const uint8_t * const src,
					  uint8_t * const dst_h,
					  uint8_t * const dst_v,
					  uint8_t * const dst_hv,
					  const uint32_t stride,
					  const uint32_t rounding);

static __inline void interpolate_x(uint8_t * const cur,
				     const uint8_t * const ref,
				     const uint32_t x, const uint32_t y,
					 const int32_t dx,  const int dy,
					 const uint32_t stride,
					 const uint32_t rounding)
{
	int32_t hdx, hdy;

	switch ( ((dx&1)<<1) + (dy&1) )  
    {
    case 0 :
		hdx = (dx<0)?-((-dx)>>1):(dx>>1);
		hdy = (dy<0)?-((-dy)>>1):(dy>>1);
		mc_copy_8x8(cur + y*stride + x, ref + (y+hdy)*stride + x + hdx, stride);
		break;

    case 1 :
		hdx = (dx<0)?-((-dx)>>1):(dx>>1);
		hdy = (dy-1);
		hdy = (hdy<0)?-((-hdy)>>1):(hdy>>1);

		interpolate8x8_v(cur + y*stride + x, 
							ref + (y+hdy)*stride + x + hdx, stride, rounding);
		break;

    case 2 :
		hdx = dx-1;
		hdx = (hdx<0)?-((-hdx)>>1):(hdx>>1);
		hdy = (dy<0)?-((-dy)>>1):(dy>>1);
		interpolate8x8_h(cur + y*stride + x,
							ref + (y+hdy)*stride + x + hdx, stride, rounding);
		break;

    default :
		hdx = dx - 1; 
		hdy = dy - 1;
		hdx = (hdx<0)?-((-hdx)>>1):(hdx>>1);
		hdy = (hdy<0)?-((-hdy)>>1):(hdy>>1);
		interpolate8x8_hv(cur + y*stride + x,
							ref + (y+hdy)*stride + x + hdx, stride, rounding);
		break;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -