下面的代码,实现将一幅YUV422的双通道图片(640x480大小),取中间区域(560x400大小)使用插值的办法放大至(640x480)。这个算法可以用来实现将图片外围区域截掉。
#define X_RATIO (8)
#define Y_RATIO (6)
PUBLIC void YUVScale(JINF_YUV_CHN_T *const yuv_ptr,const uint32 Width,const uint32 Height)
{
uint8 *const src_y_ptr = (uint16 *)yuv_ptr->y_chn_ptr;
uint8 *const src_uv_ptr = (uint16 *)yuv_ptr->u_chn_ptr;
uint32 x,y,w,h=0,xl,yl,dx,dy;
if ((Width%(X_RATIO<<1)!=0)||(Height%(Y_RATIO<<1)......
阅读全文