Hi all,
Using IPNC8127 to build our own camera. The default mode of resize is normal mode. we want to change to Downscale mode. but the register setting have some problem.
Our usage, input WxH:2448x2048, rszB out WxH:1280x720
rszBSetOutConfig(){
int vertReszRatio = 0;
int horzReszRatio = 0;
rsz_reg->SRC_VSZ = inHeight - 1;
rsz_reg->SRC_HSZ = inWidth - 1;
rszB_reg->RZB_I_VPS = 0;
rszB_reg->RZB_I_HPS = 0;
rszB_reg->RZB_O_VSZ = outHeight - 1;
rszB_reg->RZB_O_HSZ = outWidth - 1;
#if 1
vertReszRatio = (inHeight * 256) / (outHeight);
if (vertReszRatio < 256)
vertReszRatio = 256;
if (vertReszRatio > 4096)
vertReszRatio = 4096;
rszB_reg->RZB_V_DIF = vertReszRatio;
rszB_reg->RZB_V_TYP = 1; //2-tap linear interpolation
horzReszRatio = (inWidth * 256) / (outWidth);
if (horzReszRatio < 256)
horzReszRatio = 256;
if (horzReszRatio > 4096)
horzReszRatio = 4096;
rszB_reg->RZB_H_DIF = horzReszRatio;
rszB_reg->RZB_H_TYP = 1; //2-tap linear interpolation
rszB_reg->RZB_DWN_EN = 1; //enable downscale mode
rszB_reg->RZB_DWN_AV = 0x0;
rszB_reg->RZB_H_PHS = 128;
rszB_reg->RZB_H_PHS_ADJ = 0x1;
#else //IPNC 8127 default setting: Normal mode
vertReszRatio = (inHeight * 256) / (outHeight);
if (vertReszRatio < 16)
vertReszRatio = 16;
if (vertReszRatio > 4096)
vertReszRatio = 4096;
rszB_reg->RZB_V_DIF = vertReszRatio;
rszB_reg->RZB_V_TYP = 0;
horzReszRatio = (inWidth * 256) / (outWidth);
if (horzReszRatio < 16)
horzReszRatio = 16;
if (horzReszRatio > 4096)
horzReszRatio = 4096;
rszB_reg->RZB_H_DIF = horzReszRatio;
rszB_reg->RZB_H_TYP = 0;
rszB_reg->RZB_DWN_EN = 0;
rszB_reg->RZB_DWN_AV = 0;
#endif
}
who can give me some advices? Thanks a lot.