VPC调用失败

现象描述

VPC模块调用失败,查看日志有类似如下报错信息:

日志信息(1):

RoiNum(0), inputArea rightOffset is 1918, it should be odd!

日志信息(2):

Output bufferSize(65536) should not be smaller than widthStride(256) * heightStride(256) * 3 / 2 = 98304

日志信息(3):

Input widthStride(300) is not right, it should be 16 algined!
Input widthStride(16) is not right, it should not be smaller than 32!

日志信息(4):

bareDataAddr(0xaaaadeccdcd0), bareDataBufferSize(3133440) should be allocated by acldvppMalloc!

日志信息(5):

Both RoiNum(1) outputAddr(0xaaaadeccdcd0) and first roi outputAddr(0xffff00002000) should be allocated by acldvppMalloc!

日志信息(6):

RoiNum(0): inputConfigure cropArea, leftOffset(26) should be smaller than rightOffset(25)!
RoiNum(0): inputConfigure cropArea, upOffset(80) should be smaller than downOffset(79)!
RoiNum(0): inputConfigure cropArea, cropWidth(1931) should not be bigger than width(1920)!
RoiNum(0): inputConfigure cropArea, cropHeight(1270) should not be bigger than height(1088)!
RoiNum(0): inputConfigure cropArea, cropWidth(9) should be between [10, 8192]!
RoiNum(0): inputConfigure cropArea, cropHeight(4) should be between [6, 8192]!
RoiNum(0): inputConfigure cropArea, rightOffset(1921) should be smaller than width(1920)!
RoiNum(0): inputConfigure cropArea, downOffset(1089) should be smaller than height(1088)!

日志信息(7):

RoiNum(0): scale must be in [1/32, 16], cropWidth(1920), pasteWidth(10)!
RoiNum(0): scale must be in [1/32, 16], cropHeight(6), pasteHeight(100)!

可能原因

针对上面日志信息分析,可能存在以下对应原因:

定位思路

  1. 根据日志描述的错误信息,找到VPC对应的配置参数,根据提示进行修改。
  2. 根据日志描述的错误信息,参考应用软件开发指南(C&C++)中VPC参数的约束修改。

处理步骤

根据提示的错误信息进行修改:

  1. 如果为日志信息(1),说明输入图片抠图区域的右偏移错误,应该设置为奇数。
  2. 如果为日志信息(2),说明输入内存的大小不正确,应该检查申请输入内存的代码,申请内存大小应该为1920*1088*3/2,并且bareDataBufferSize这个值也要填写为1920*1088*3/2。
  3. 如果为日志信息(3),说明输入图片的stride值不符合要求,需设置为16的倍数。
  4. 如果为日志信息(4)和日志信息(5),代码中申请内存时,需要使用acldvppMalloc接口申请。
  5. 如果为日志信息(6),需要修改抠图宽度。
  6. 如果为日志信息(7),需要修改缩放范围。