文档中,描述,VF Disable时,其输出如图
在DVSDK的参考代码中
int ALG_afRun(ALG_AfRunPrm * prm, int *focus_value)
{
CSL_H3aAfOutVfDisableOverlay *pAfPaxData;
long int *phyCurAddr;
unsigned short i,j,k, numPax, idx1, idx2;
Uint8 *curAfAddr;
Uint32 accAfVal[9] = {0,0,0,0,0,0,0,0,0};
float avgAfVal[9];
int weighti, weightj, fweight;
int af_pax_vt_cnt, af_pax_hz_cnt;
af_pax_vt_cnt = prm->pH3aInfo->afNumWinV;
af_pax_hz_cnt = prm->pH3aInfo->afNumWinH;
curAfAddr = (Uint8* ) prm->h3aDataVirtAddr;
phyCurAddr = OSA_cmemGetPhysAddr(curAfAddr);
if(phyCurAddr==NULL) {
OSA_ERROR("OSA_cmemGetPhysAddr() failed\n");
}
for(i=0;i<af_pax_vt_cnt-2; i++) {
for(j=0;j<af_pax_hz_cnt-2; j++) {
pAfPaxData = (CSL_H3aAfOutVfDisableOverlay *)curAfAddr;
weighti = (i > (af_pax_vt_cnt-1 - i))?(af_pax_vt_cnt-1 - i):i;
weightj = (j > (af_pax_hz_cnt-1 - j))?(af_pax_hz_cnt-1 - j):j;
fweight = weighti*weightj;
accAfVal[0] += fweight*pAfPaxData->hfvSum_0;
。。。。。。。。。。。。。。。。。。。
accAfVal[8] += fweight*pAfPaxData->hfv2_2;
curAfAddr += sizeof(CSL_H3aAfOutVfDisableOverlay);
}
curAfAddr = (Uint8*)OSA_align( (Uint32)curAfAddr, 32);
}
.......................................
*focus_value = accAfVal[4];
return 0;
}
前后Paxel相差的buff为 sizeof(CSL_H3aAfOutVfDisableOverlay);
其中共有16个Uint32 , 而不是文档中的12个(多了hfvSum_3)
这个是为什么??
代码是正确的吧,的确填充了4个Uint32, 为了buffer对齐?
\brief AF packet format with vertical AF disabled
*/
typedef struct {
Uint32 hfvSum_0;
Uint32 hfv1_0;
Uint32 hfv2_0;
Uint32 reserved_0;
Uint32 hfvSum_1;
Uint32 hfv1_1;
Uint32 hfv2_1;
Uint32 reserved_1;
Uint32 hfvSum_2;
Uint32 hfv1_2;
Uint32 hfv2_2;
Uint32 reserved_2;
Uint32 hfvSum_3;
Uint32 hfv1_3;
Uint32 hfv2_3;
Uint32 reserved_3;
} CSL_H3aAfOutVfDisableOverlay;